Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.93 KB | None | 0 0
  1. WGET(1) GNU Wget WGET(1)
  2.  
  3.  
  4.  
  5. NAME
  6. Wget - The non-interactive network downloader.
  7.  
  8. SYNOPSIS
  9. wget [option]... [URL]...
  10.  
  11. DESCRIPTION
  12. 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
  13. HTTP proxies.
  14.  
  15. 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
  16. 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
  17. transferring a lot of data.
  18.  
  19. 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
  20. site. This is sometimes referred to as "recursive downloading." While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be
  21. instructed to convert the links in downloaded files to point at the local files, for offline viewing.
  22.  
  23. 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
  24. 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.
  25.  
  26. OPTIONS
  27. Option Syntax
  28. 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
  29. 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:
  30.  
  31. wget -r --tries=10 http://fly.srk.fer.hr/ -o log
  32.  
  33. The space between the option accepting an argument and the argument may be omitted. Instead of -o log you can write -olog.
  34.  
  35. You may put several options that do not require arguments together, like:
  36.  
  37. wget -drc <URL>
  38.  
  39. This is completely equivalent to:
  40.  
  41. wget -d -r -c <URL>
  42.  
  43. 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
  44. log:
  45.  
  46. wget -o log -- -x
  47.  
  48. 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
  49. .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
  50. exclude /~nobody and /~somebody. You can also clear the lists in .wgetrc.
  51.  
  52. wget -X " -X /~nobody,/~somebody
  53.  
  54. 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
  55. 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
  56. boolean option is either affirmative or negative (beginning with --no). All such options share several properties.
  57.  
  58. Unless stated otherwise, it is assumed that the default behavior is the opposite of what the option accomplishes. For example, the documented existence of
  59. --follow-ftp assumes that the default is to not follow FTP links from HTML pages.
  60.  
  61. 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
  62. 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
  63. 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
  64. only way to restore the factory default from the command line.
  65.  
  66. Basic Startup Options
  67. -V
  68. --version
  69. Display the version of Wget.
  70.  
  71. -h
  72. --help
  73. Print a help message describing all of Wget's command-line options.
  74.  
  75. -b
  76. --background
  77. Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.
  78.  
  79. -e command
  80. --execute command
  81. 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
  82. them. If you need to specify more than one wgetrc command, use multiple instances of -e.
  83.  
  84. Logging and Input File Options
  85. -o logfile
  86. --output-file=logfile
  87. Log all messages to logfile. The messages are normally reported to standard error.
  88.  
  89. -a logfile
  90. --append-output=logfile
  91. 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
  92. is created.
  93.  
  94. -d
  95. --debug
  96. Turn on debug output, meaning various information important to the developers of Wget if it does not work properly. Your system administrator may have
  97. 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
  98. compiled with the debug support will not print any debug info unless requested with -d.
  99.  
  100. -q
  101. --quiet
  102. Turn off Wget's output.
  103.  
  104. -v
  105. --verbose
  106. Turn on verbose output, with all the available data. The default output is verbose.
  107.  
  108. -nv
  109. --no-verbose
  110. Turn off verbose without being completely quiet (use -q for that), which means that error messages and basic information still get printed.
  111.  
  112. --report-speed=type
  113. Output bandwidth as type. The only accepted value is bits.
  114.  
  115. -i file
  116. --input-file=file
  117. 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
  118. named -.)
  119.  
  120. 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
  121. 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.
  122.  
  123. 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
  124. solve either by adding "<base href="url">" to the documents or by specifying --base=url on the command line.
  125.  
  126. 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
  127. location will be implicitly used as base href if none was specified.
  128.  
  129. -F
  130. --force-html
  131. 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
  132. local disk, by adding "<base href="url">" to HTML, or using the --base command-line option.
  133.  
  134. -B URL
  135. --base=URL
  136. 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
  137. 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
  138. in the HTML input file, with URL as the value for the "href" attribute.
  139.  
  140. 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
  141. http://foo/baz/b.html.
  142.  
  143. --config=FILE
  144. Specify the location of a startup file you wish to use.
  145.  
  146. Download Options
  147. --bind-address=ADDRESS
  148. 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
  149. useful if your machine is bound to multiple IPs.
  150.  
  151. -t number
  152. --tries=number
  153. 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
  154. "connection refused" or "not found" (404), which are not retried.
  155.  
  156. -O file
  157. --output-document=file
  158. 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
  159. will be printed to standard output, disabling link conversion. (Use ./- to print to a file literally named -.)
  160.  
  161. 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
  162. 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.
  163.  
  164. 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
  165. timestamp. A warning will be issued if this combination is used.
  166.  
  167. 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
  168. 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