Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WGET(1) GNU Wget WGET(1)
- NAME
- Wget - The non-interactive network downloader.
- SYNOPSIS
- wget [option]... [URL]...
- DESCRIPTION
- GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through
- HTTP proxies.
- Wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect
- from the system, letting Wget finish the work. By contrast, most of the Web browsers require constant user's presence, which can be a great hindrance when
- transferring a lot of data.
- Wget can follow links in HTML, XHTML, and CSS pages, to create local versions of remote web sites, fully recreating the directory structure of the original
- site. This is sometimes referred to as "recursive downloading." While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be
- instructed to convert the links in downloaded files to point at the local files, for offline viewing.
- Wget has been designed for robustness over slow or unstable network connections; if a download fails due to a network problem, it will keep retrying until
- the whole file has been retrieved. If the server supports regetting, it will instruct the server to continue the download from where it left off.
- OPTIONS
- Option Syntax
- Since Wget uses GNU getopt to process command-line arguments, every option has a long form along with the short one. Long options are more convenient to
- remember, but take time to type. You may freely mix different option styles, or specify options after the command-line arguments. Thus you may write:
- wget -r --tries=10 http://fly.srk.fer.hr/ -o log
- The space between the option accepting an argument and the argument may be omitted. Instead of -o log you can write -olog.
- You may put several options that do not require arguments together, like:
- wget -drc <URL>
- This is completely equivalent to:
- wget -d -r -c <URL>
- Since the options can be specified after the arguments, you may terminate them with --. So the following will try to download URL -x, reporting failure to
- log:
- wget -o log -- -x
- The options that accept comma-separated lists all respect the convention that specifying an empty list clears its value. This can be useful to clear the
- .wgetrc settings. For instance, if your .wgetrc sets "exclude_directories" to /cgi-bin, the following example will first reset it, and then set it to
- exclude /~nobody and /~somebody. You can also clear the lists in .wgetrc.
- wget -X " -X /~nobody,/~somebody
- Most options that do not accept arguments are boolean options, so named because their state can be captured with a yes-or-no ("boolean") variable. For
- example, --follow-ftp tells Wget to follow FTP links from HTML files and, on the other hand, --no-glob tells it not to perform file globbing on FTP URLs. A
- boolean option is either affirmative or negative (beginning with --no). All such options share several properties.
- Unless stated otherwise, it is assumed that the default behavior is the opposite of what the option accomplishes. For example, the documented existence of
- --follow-ftp assumes that the default is to not follow FTP links from HTML pages.
- Affirmative options can be negated by prepending the --no- to the option name; negative options can be negated by omitting the --no- prefix. This might
- seem superfluous---if the default for an affirmative option is to not do something, then why provide a way to explicitly turn it off? But the startup file
- may in fact change the default. For instance, using "follow_ftp = on" in .wgetrc makes Wget follow FTP links by default, and using --no-follow-ftp is the
- only way to restore the factory default from the command line.
- Basic Startup Options
- -V
- --version
- Display the version of Wget.
- -h
- --help
- Print a help message describing all of Wget's command-line options.
- -b
- --background
- Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.
- -e command
- --execute command
- Execute command as if it were a part of .wgetrc. A command thus invoked will be executed after the commands in .wgetrc, thus taking precedence over
- them. If you need to specify more than one wgetrc command, use multiple instances of -e.
- Logging and Input File Options
- -o logfile
- --output-file=logfile
- Log all messages to logfile. The messages are normally reported to standard error.
- -a logfile
- --append-output=logfile
- Append to logfile. This is the same as -o, only it appends to logfile instead of overwriting the old log file. If logfile does not exist, a new file
- is created.
- -d
- --debug
- Turn on debug output, meaning various information important to the developers of Wget if it does not work properly. Your system administrator may have
- chosen to compile Wget without debug support, in which case -d will not work. Please note that compiling with debug support is always safe---Wget
- compiled with the debug support will not print any debug info unless requested with -d.
- -q
- --quiet
- Turn off Wget's output.
- -v
- --verbose
- Turn on verbose output, with all the available data. The default output is verbose.
- -nv
- --no-verbose
- Turn off verbose without being completely quiet (use -q for that), which means that error messages and basic information still get printed.
- --report-speed=type
- Output bandwidth as type. The only accepted value is bits.
- -i file
- --input-file=file
- Read URLs from a local or external file. If - is specified as file, URLs are read from the standard input. (Use ./- to read from a file literally
- named -.)
- If this function is used, no URLs need be present on the command line. If there are URLs both on the command line and in an input file, those on the
- command lines will be the first ones to be retrieved. If --force-html is not specified, then file should consist of a series of URLs, one per line.
- However, if you specify --force-html, the document will be regarded as html. In that case you may have problems with relative links, which you can
- solve either by adding "<base href="url">" to the documents or by specifying --base=url on the command line.
- If the file is an external one, the document will be automatically treated as html if the Content-Type matches text/html. Furthermore, the file's
- location will be implicitly used as base href if none was specified.
- -F
- --force-html
- When input is read from a file, force it to be treated as an HTML file. This enables you to retrieve relative links from existing HTML files on your
- local disk, by adding "<base href="url">" to HTML, or using the --base command-line option.
- -B URL
- --base=URL
- Resolves relative links using URL as the point of reference, when reading links from an HTML file specified via the -i/--input-file option (together
- with --force-html, or when the input file was fetched remotely from a server describing it as HTML). This is equivalent to the presence of a "BASE" tag
- in the HTML input file, with URL as the value for the "href" attribute.
- For instance, if you specify http://foo/bar/a.html for URL, and Wget reads ../baz/b.html from the input file, it would be resolved to
- http://foo/baz/b.html.
- --config=FILE
- Specify the location of a startup file you wish to use.
- Download Options
- --bind-address=ADDRESS
- When making client TCP/IP connections, bind to ADDRESS on the local machine. ADDRESS may be specified as a hostname or IP address. This option can be
- useful if your machine is bound to multiple IPs.
- -t number
- --tries=number
- Set number of tries to number. Specify 0 or inf for infinite retrying. The default is to retry 20 times, with the exception of fatal errors like
- "connection refused" or "not found" (404), which are not retried.
- -O file
- --output-document=file
- The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If - is used as file, documents
- will be printed to standard output, disabling link conversion. (Use ./- to print to a file literally named -.)
- Use of -O is not intended to mean simply "use the name file instead of the one in the URL;" rather, it is analogous to shell redirection: wget -O file
- http://foo is intended to work like wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will be written there.
- For this reason, -N (for timestamp-checking) is not supported in combination with -O: since file is always newly created, it will always have a very new
- timestamp. A warning will be issued if this combination is used.
- Similarly, using -r or -p with -O may not work as you expect: Wget won't just download the first file to file and then download the rest to their normal
- names: all downloaded content will be placed in file. This was disabled in version 1.11, but h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement