home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Online / wget / doc / wget.info-1 (.txt) < prev    next >
GNU Info File  |  2000-08-25  |  51KB  |  950 lines

  1. This is Info file wget.info, produced by Makeinfo version 1.68 from the
  2. input file ./wget.texi.
  3. INFO-DIR-SECTION Net Utilities
  4. INFO-DIR-SECTION World Wide Web
  5. START-INFO-DIR-ENTRY
  6. * Wget: (wget).         The non-interactive network downloader.
  7. END-INFO-DIR-ENTRY
  8.    This file documents the the GNU Wget utility for downloading network
  9. data.
  10.    Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the sections entitled "Copying" and "GNU General Public License"
  17. are included exactly as in the original, and provided that the entire
  18. resulting derived work is distributed under the terms of a permission
  19. notice identical to this one.
  20. File: wget.info,  Node: Top,  Next: Overview,  Prev: (dir),  Up: (dir)
  21. Wget 1.5.3
  22. **********
  23.    This manual documents version 1.5.3 of GNU Wget, the freely
  24. available utility for network download.
  25.    Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
  26. * Menu:
  27. * Overview::            Features of Wget.
  28. * Invoking::            Wget command-line arguments.
  29. * Recursive Retrieval:: Description of recursive retrieval.
  30. * Following Links::     The available methods of chasing links.
  31. * Time-Stamping::       Mirroring according to time-stamps.
  32. * Startup File::        Wget's initialization file.
  33. * Examples::            Examples of usage.
  34. * Various::             The stuff that doesn't fit anywhere else.
  35. * Appendices::          Some useful references.
  36. * Copying::             You may give out copies of Wget.
  37. * Concept Index::       Topics covered by this manual.
  38. File: wget.info,  Node: Overview,  Next: Invoking,  Prev: Top,  Up: Top
  39. Overview
  40. ********
  41.    GNU Wget is a freely available network utility to retrieve files from
  42. the World Wide Web, using HTTP (Hyper Text Transfer Protocol) and FTP
  43. (File Transfer Protocol), the two most widely used Internet protocols.
  44. It has many useful features to make downloading easier, some of them
  45. being:
  46.    * Wget is non-interactive, meaning that it can work in the
  47.      background, while the user is not logged on.  This allows you to
  48.      start a retrieval and disconnect from the system, letting Wget
  49.      finish the work.  By contrast, most of the Web browsers require
  50.      constant user's presence, which can be a great hindrance when
  51.      transferring a lot of data.
  52.    * Wget is capable of descending recursively through the structure of
  53.      HTML documents and FTP directory trees, making a local copy of the
  54.      directory hierarchy similar to the one on the remote server.  This
  55.      feature can be used to mirror archives and home pages, or traverse
  56.      the web in search of data, like a WWW robot (*Note Robots::).  In
  57.      that spirit, Wget understands the `norobots' convention.
  58.    * File name wildcard matching and recursive mirroring of directories
  59.      are available when retrieving via FTP.  Wget can read the
  60.      time-stamp information given by both HTTP and FTP servers, and
  61.      store it locally.  Thus Wget can see if the remote file has
  62.      changed since last retrieval, and automatically retrieve the new
  63.      version if it has.  This makes Wget suitable for mirroring of FTP
  64.      sites, as well as home pages.
  65.    * Wget works exceedingly well on slow or unstable connections,
  66.      retrying the document until it is fully retrieved, or until a
  67.      user-specified retry count is surpassed.  It will try to resume the
  68.      download from the point of interruption, using `REST' with FTP and
  69.      `Range' with HTTP servers that support them.
  70.    * By default, Wget supports proxy servers, which can lighten the
  71.      network load, speed up retrieval and provide access behind
  72.      firewalls.  However, if you are behind a firewall that requires
  73.      that you use a socks style gateway, you can get the socks library
  74.      and build wget with support for socks.  Wget also supports the
  75.      passive FTP downloading as an option.
  76.    * Builtin features offer mechanisms to tune which links you wish to
  77.      follow (*Note Following Links::).
  78.    * The retrieval is conveniently traced with printing dots, each dot
  79.      representing a fixed amount of data received (1KB by default).
  80.      These representations can be customized to your preferences.
  81.    * Most of the features are fully configurable, either through
  82.      command line options, or via the initialization file `.wgetrc'
  83.      (*Note Startup File::).  Wget allows you to define "global"
  84.      startup files (`/usr/local/etc/wgetrc' by default) for site
  85.      settings.
  86.    * Finally, GNU Wget is free software.  This means that everyone may
  87.      use it, redistribute it and/or modify it under the terms of the
  88.      GNU General Public License, as published by the Free Software
  89.      Foundation (*Note Copying::).
  90. File: wget.info,  Node: Invoking,  Next: Recursive Retrieval,  Prev: Overview,  Up: Top
  91. Invoking
  92. ********
  93.    By default, Wget is very simple to invoke.  The basic syntax is:
  94.      wget [OPTION]... [URL]...
  95.    Wget will simply download all the URLs specified on the command
  96. line.  URL is a "Uniform Resource Locator", as defined below.
  97.    However, you may wish to change some of the default parameters of
  98. Wget.  You can do it two ways: permanently, adding the appropriate
  99. command to `.wgetrc' (*Note Startup File::), or specifying it on the
  100. command line.
  101. * Menu:
  102. * URL Format::
  103. * Option Syntax::
  104. * Basic Startup Options::
  105. * Logging and Input File Options::
  106. * Download Options::
  107. * Directory Options::
  108. * HTTP Options::
  109. * FTP Options::
  110. * Recursive Retrieval Options::
  111. * Recursive Accept/Reject Options::
  112. File: wget.info,  Node: URL Format,  Next: Option Syntax,  Prev: Invoking,  Up: Invoking
  113. URL Format
  114. ==========
  115.    "URL" is an acronym for Uniform Resource Locator.  A uniform
  116. resource locator is a compact string representation for a resource
  117. available via the Internet.  Wget recognizes the URL syntax as per
  118. RFC1738.  This is the most widely used form (square brackets denote
  119. optional parts):
  120.      http://host[:port]/directory/file
  121.      ftp://host[:port]/directory/file
  122.    You can also encode your username and password within a URL:
  123.      ftp://user:password@host/path
  124.      http://user:password@host/path
  125.    Either USER or PASSWORD, or both, may be left out.  If you leave out
  126. either the HTTP username or password, no authentication will be sent.
  127. If you leave out the FTP username, `anonymous' will be used.  If you
  128. leave out the FTP password, your email address will be supplied as a
  129. default password.(1)
  130.    You can encode unsafe characters in a URL as `%xy', `xy' being the
  131. hexadecimal representation of the character's ASCII value.  Some common
  132. unsafe characters include `%' (quoted as `%25'), `:' (quoted as `%3A'),
  133. and `@' (quoted as `%40').  Refer to RFC1738 for a comprehensive list
  134. of unsafe characters.
  135.    Wget also supports the `type' feature for FTP URLs.  By default, FTP
  136. documents are retrieved in the binary mode (type `i'), which means that
  137. they are downloaded unchanged.  Another useful mode is the `a'
  138. ("ASCII") mode, which converts the line delimiters between the
  139. different operating systems, and is thus useful for text files.  Here
  140. is an example:
  141.      ftp://host/directory/file;type=a
  142.    Two alternative variants of URL specification are also supported,
  143. because of historical (hysterical?) reasons and their wide-spreadedness.
  144.    FTP-only syntax (supported by `NcFTP'):
  145.      host:/dir/file
  146.    HTTP-only syntax (introduced by `Netscape'):
  147.      host[:port]/dir/file
  148.    These two alternative forms are deprecated, and may cease being
  149. supported in the future.
  150.    If you do not understand the difference between these notations, or
  151. do not know which one to use, just use the plain ordinary format you use
  152. with your favorite browser, like `Lynx' or `Netscape'.
  153.    ---------- Footnotes ----------
  154.    (1) If you have a `.netrc' file in your home directory, password
  155. will also be searched for there.
  156. File: wget.info,  Node: Option Syntax,  Next: Basic Startup Options,  Prev: URL Format,  Up: Invoking
  157. Option Syntax
  158. =============
  159.    Since Wget uses GNU getopts to process its arguments, every option
  160. has a short form and a long form.  Long options are more convenient to
  161. remember, but take time to type.  You may freely mix different option
  162. styles, or specify options after the command-line arguments. Thus you
  163. may write:
  164.      wget -r --tries=10 http://fly.cc.fer.hr/ -o log
  165.    The space between the option accepting an argument and the argument
  166. may be omitted.  Instead `-o log' you can write `-olog'.
  167.    You may put several options that do not require arguments together,
  168. like:
  169.      wget -drc URL
  170.    This is a complete equivalent of:
  171.      wget -d -r -c URL
  172.    Since the options can be specified after the arguments, you may
  173. terminate them with `--'.  So the following will try to download URL
  174. `-x', reporting failure to `log':
  175.      wget -o log -- -x
  176.    The options that accept comma-separated lists all respect the
  177. convention that specifying an empty list clears its value.  This can be
  178. useful to clear the `.wgetrc' settings.  For instance, if your `.wgetrc'
  179. sets `exclude_directories' to `/cgi-bin', the following example will
  180. first reset it, and then set it to exclude `/~nobody' and `/~somebody'.
  181. You can also clear the lists in `.wgetrc' (*Note Wgetrc Syntax::).
  182.      wget -X '' -X /~nobody,/~somebody
  183. File: wget.info,  Node: Basic Startup Options,  Next: Logging and Input File Options,  Prev: Option Syntax,  Up: Invoking
  184. Basic Startup Options
  185. =====================
  186. `--version'
  187.      Display the version of Wget.
  188. `--help'
  189.      Print a help message describing all of Wget's command-line options.
  190. `--background'
  191.      Go to background immediately after startup.  If no output file is
  192.      specified via the `-o', output is redirected to `wget-log'.
  193. `-e COMMAND'
  194. `--execute COMMAND'
  195.      Execute COMMAND as if it were a part of `.wgetrc' (*Note Startup
  196.      File::).  A command thus invoked will be executed *after* the
  197.      commands in `.wgetrc', thus taking precedence over them.
  198. File: wget.info,  Node: Logging and Input File Options,  Next: Download Options,  Prev: Basic Startup Options,  Up: Invoking
  199. Logging and Input File Options
  200. ==============================
  201. `-o LOGFILE'
  202. `--output-file=LOGFILE'
  203.      Log all messages to LOGFILE.  The messages are normally reported
  204.      to standard error.
  205. `-a LOGFILE'
  206. `--append-output=LOGFILE'
  207.      Append to LOGFILE.  This is the same as `-o', only it appends to
  208.      LOGFILE instead of overwriting the old log file.  If LOGFILE does
  209.      not exist, a new file is created.
  210. `--debug'
  211.      Turn on debug output, meaning various information important to the
  212.      developers of Wget if it does not work properly.  Your system
  213.      administrator may have chosen to compile Wget without debug
  214.      support, in which case `-d' will not work.  Please note that
  215.      compiling with debug support is always safe--Wget compiled with
  216.      the debug support will *not* print any debug info unless requested
  217.      with `-d'.  *Note Reporting Bugs:: for more information on how to
  218.      use `-d' for sending bug reports.
  219. `--quiet'
  220.      Turn off Wget's output.
  221. `--verbose'
  222.      Turn on verbose output, with all the available data.  The default
  223.      output is verbose.
  224. `-nv'
  225. `--non-verbose'
  226.      Non-verbose output--turn off verbose without being completely quiet
  227.      (use `-q' for that), which means that error messages and basic
  228.      information still get printed.
  229. `-i FILE'
  230. `--input-file=FILE'
  231.      Read URLs from FILE, in which case no URLs need to be on the
  232.      command line.  If there are URLs both on the command line and in
  233.      an input file, those on the command lines will be the first ones to
  234.      be retrieved.  The FILE need not be an HTML document (but no harm
  235.      if it is)--it is enough if the URLs are just listed sequentially.
  236.      However, if you specify `--force-html', the document will be
  237.      regarded as `html'.  In that case you may have problems with
  238.      relative links, which you can solve either by adding `<base
  239.      href="URL">' to the documents or by specifying `--base=URL' on the
  240.      command line.
  241. `--force-html'
  242.      When input is read from a file, force it to be treated as an HTML
  243.      file.  This enables you to retrieve relative links from existing
  244.      HTML files on your local disk, by adding `<base href="URL">' to
  245.      HTML, or using the `--base' command-line option.
  246. File: wget.info,  Node: Download Options,  Next: Directory Options,  Prev: Logging and Input File Options,  Up: Invoking
  247. Download Options
  248. ================
  249. `-t NUMBER'
  250. `--tries=NUMBER'
  251.      Set number of retries to NUMBER.  Specify 0 or `inf' for infinite
  252.      retrying.
  253. `-O FILE'
  254. `--output-document=FILE'
  255.      The documents will not be written to the appropriate files, but
  256.      all will be concatenated together and written to FILE.  If FILE
  257.      already exists, it will be overwritten.  If the FILE is `-', the
  258.      documents will be written to standard output.  Including this
  259.      option automatically sets the number of tries to 1.
  260. `-nc'
  261. `--no-clobber'
  262.      Do not clobber existing files when saving to directory hierarchy
  263.      within recursive retrieval of several files. This option is
  264.      *extremely* useful when you wish to continue where you left off
  265.      with retrieval of many files.  If the files have the `.html' or
  266.      (yuck) `.htm' suffix, they will be loaded from the local disk, and
  267.      parsed as if they have been retrieved from the Web.
  268. `--continue'
  269.      Continue getting an existing file.  This is useful when you want to
  270.      finish up the download started by another program, or a previous
  271.      instance of Wget.  Thus you can write:
  272.           wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
  273.      If there is a file name `ls-lR.Z' in the current directory, Wget
  274.      will assume that it is the first portion of the remote file, and
  275.      will require the server to continue the retrieval from an offset
  276.      equal to the length of the local file.
  277.      Note that you need not specify this option if all you want is Wget
  278.      to continue retrieving where it left off when the connection is
  279.      lost--Wget does this by default.  You need this option only when
  280.      you want to continue retrieval of a file already halfway
  281.      retrieved, saved by another FTP client, or left by Wget being
  282.      killed.
  283.      Without `-c', the previous example would just begin to download the
  284.      remote file to `ls-lR.Z.1'.  The `-c' option is also applicable
  285.      for HTTP servers that support the `Range' header.
  286. `--dot-style=STYLE'
  287.      Set the retrieval style to STYLE.  Wget traces the retrieval of
  288.      each document by printing dots on the screen, each dot
  289.      representing a fixed amount of retrieved data.  Any number of dots
  290.      may be separated in a "cluster", to make counting easier.  This
  291.      option allows you to choose one of the pre-defined styles,
  292.      determining the number of bytes represented by a dot, the number
  293.      of dots in a cluster, and the number of dots on the line.
  294.      With the `default' style each dot represents 1K, there are ten dots
  295.      in a cluster and 50 dots in a line.  The `binary' style has a more
  296.      "computer"-like orientation--8K dots, 16-dots clusters and 48 dots
  297.      per line (which makes for 384K lines).  The `mega' style is
  298.      suitable for downloading very large files--each dot represents 64K
  299.      retrieved, there are eight dots in a cluster, and 48 dots on each
  300.      line (so each line contains 3M).  The `micro' style is exactly the
  301.      reverse; it is suitable for downloading small files, with 128-byte
  302.      dots, 8 dots per cluster, and 48 dots (6K) per line.
  303. `--timestamping'
  304.      Turn on time-stamping.  *Note Time-Stamping:: for details.
  305. `--server-response'
  306.      Print the headers sent by HTTP servers and responses sent by FTP
  307.      servers.
  308. `--spider'
  309.      When invoked with this option, Wget will behave as a Web "spider",
  310.      which means that it will not download the pages, just check that
  311.      they are there.  You can use it to check your bookmarks, e.g. with:
  312.           wget --spider --force-html -i bookmarks.html
  313.      This feature needs much more work for Wget to get close to the
  314.      functionality of real WWW spiders.
  315. `-T seconds'
  316. `--timeout=SECONDS'
  317.      Set the read timeout to SECONDS seconds.  Whenever a network read
  318.      is issued, the file descriptor is checked for a timeout, which
  319.      could otherwise leave a pending connection (uninterrupted read).
  320.      The default timeout is 900 seconds (fifteen minutes).  Setting
  321.      timeout to 0 will disable checking for timeouts.
  322.      Please do not lower the default timeout value with this option
  323.      unless you know what you are doing.
  324. `-w SECONDS'
  325. `--wait=SECONDS'
  326.      Wait the specified number of seconds between the retrievals.  Use
  327.      of this option is recommended, as it lightens the server load by
  328.      making the requests less frequent.  Instead of in seconds, the
  329.      time can be specified in minutes using the `m' suffix, in hours
  330.      using `h' suffix, or in days using `d' suffix.
  331.      Specifying a large value for this option is useful if the network
  332.      or the destination host is down, so that Wget can wait long enough
  333.      to reasonably expect the network error to be fixed before the
  334.      retry.
  335. `-Y on/off'
  336. `--proxy=on/off'
  337.      Turn proxy support on or off. The proxy is on by default if the
  338.      appropriate environmental variable is defined.
  339. `-Q QUOTA'
  340. `--quota=QUOTA'
  341.      Specify download quota for automatic retrievals.  The value can be
  342.      specified in bytes (default), kilobytes (with `k' suffix), or
  343.      megabytes (with `m' suffix).
  344.      Note that quota will never affect downloading a single file.  So
  345.      if you specify `wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz',
  346.      all of the `ls-lR.gz' will be downloaded.  The same goes even when
  347.      several URLs are specified on the command-line.  However, quota is
  348.      respected when retrieving either recursively, or from an input
  349.      file.  Thus you may safely type `wget -Q2m -i sites'--download
  350.      will be aborted when the quota is exceeded.
  351.      Setting quota to 0 or to `inf' unlimits the download quota.
  352. File: wget.info,  Node: Directory Options,  Next: HTTP Options,  Prev: Download Options,  Up: Invoking
  353. Directory Options
  354. =================
  355. `-nd'
  356. `--no-directories'
  357.      Do not create a hierarchy of directories when retrieving
  358.      recursively. With this option turned on, all files will get saved
  359.      to the current directory, without clobbering (if a name shows up
  360.      more than once, the filenames will get extensions `.n').
  361. `--force-directories'
  362.      The opposite of `-nd'--create a hierarchy of directories, even if
  363.      one would not have been created otherwise.  E.g. `wget -x
  364.      http://fly.cc.fer.hr/robots.txt' will save the downloaded file to
  365.      `fly.cc.fer.hr/robots.txt'.
  366. `-nH'
  367. `--no-host-directories'
  368.      Disable generation of host-prefixed directories.  By default,
  369.      invoking Wget with `-r http://fly.cc.fer.hr/' will create a
  370.      structure of directories beginning with `fly.cc.fer.hr/'.  This
  371.      option disables such behavior.
  372. `--cut-dirs=NUMBER'
  373.      Ignore NUMBER directory components.  This is useful for getting a
  374.      fine-grained control over the directory where recursive retrieval
  375.      will be saved.
  376.      Take, for example, the directory at
  377.      `ftp://ftp.xemacs.org/pub/xemacs/'.  If you retrieve it with `-r',
  378.      it will be saved locally under `ftp.xemacs.org/pub/xemacs/'.
  379.      While the `-nH' option can remove the `ftp.xemacs.org/' part, you
  380.      are still stuck with `pub/xemacs'.  This is where `--cut-dirs'
  381.      comes in handy; it makes Wget not "see" NUMBER remote directory
  382.      components.  Here are several examples of how `--cut-dirs' option
  383.      works.
  384.           No options        -> ftp.xemacs.org/pub/xemacs/
  385.           -nH               -> pub/xemacs/
  386.           -nH --cut-dirs=1  -> xemacs/
  387.           -nH --cut-dirs=2  -> .
  388.           
  389.           --cut-dirs=1      -> ftp.xemacs.org/xemacs/
  390.           ...
  391.      If you just want to get rid of the directory structure, this
  392.      option is similar to a combination of `-nd' and `-P'.  However,
  393.      unlike `-nd', `--cut-dirs' does not lose with subdirectories--for
  394.      instance, with `-nH --cut-dirs=1', a `beta/' subdirectory will be
  395.      placed to `xemacs/beta', as one would expect.
  396. `-P PREFIX'
  397. `--directory-prefix=PREFIX'
  398.      Set directory prefix to PREFIX.  The "directory prefix" is the
  399.      directory where all other files and subdirectories will be saved
  400.      to, i.e. the top of the retrieval tree.  The default is `.' (the
  401.      current directory).
  402. File: wget.info,  Node: HTTP Options,  Next: FTP Options,  Prev: Directory Options,  Up: Invoking
  403. HTTP Options
  404. ============
  405. `--http-user=USER'
  406. `--http-passwd=PASSWORD'
  407.      Specify the username USER and password PASSWORD on an HTTP server.
  408.      According to the type of the challenge, Wget will encode them
  409.      using either the `basic' (insecure) or the `digest' authentication
  410.      scheme.
  411.      Another way to specify username and password is in the URL itself
  412.      (*Note URL Format::).  For more information about security issues
  413.      with Wget, *Note Security Considerations::.
  414. `-C on/off'
  415. `--cache=on/off'
  416.      When set to off, disable server-side cache.  In this case, Wget
  417.      will send the remote server an appropriate directive (`Pragma:
  418.      no-cache') to get the file from the remote service, rather than
  419.      returning the cached version.  This is especially useful for
  420.      retrieving and flushing out-of-date documents on proxy servers.
  421.      Caching is allowed by default.
  422. `--ignore-length'
  423.      Unfortunately, some HTTP servers (CGI programs, to be more
  424.      precise) send out bogus `Content-Length' headers, which makes Wget
  425.      go wild, as it thinks not all the document was retrieved.  You can
  426.      spot this syndrome if Wget retries getting the same document again
  427.      and again, each time claiming that the (otherwise normal)
  428.      connection has closed on the very same byte.
  429.      With this option, Wget will ignore the `Content-Length' header--as
  430.      if it never existed.
  431. `--header=ADDITIONAL-HEADER'
  432.      Define an ADDITIONAL-HEADER to be passed to the HTTP servers.
  433.      Headers must contain a `:' preceded by one or more non-blank
  434.      characters, and must not contain newlines.
  435.      You may define more than one additional header by specifying
  436.      `--header' more than once.
  437.           wget --header='Accept-Charset: iso-8859-2' \
  438.                --header='Accept-Language: hr'        \
  439.                  http://fly.cc.fer.hr/
  440.      Specification of an empty string as the header value will clear all
  441.      previous user-defined headers.
  442. `--proxy-user=USER'
  443. `--proxy-passwd=PASSWORD'
  444.      Specify the username USER and password PASSWORD for authentication
  445.      on a proxy server.  Wget will encode them using the `basic'
  446.      authentication scheme.
  447. `--save-headers'
  448.      Save the headers sent by the HTTP server to the file, preceding the
  449.      actual contents, with an empty line as the separator.
  450. `-U AGENT-STRING'
  451. `--user-agent=AGENT-STRING'
  452.      Identify as AGENT-STRING to the HTTP server.
  453.      The HTTP protocol allows the clients to identify themselves using a
  454.      `User-Agent' header field.  This enables distinguishing the WWW
  455.      software, usually for statistical purposes or for tracing of
  456.      protocol violations.  Wget normally identifies as `Wget/VERSION',
  457.      VERSION being the current version number of Wget.
  458.      However, some sites have been known to impose the policy of
  459.      tailoring the output according to the `User-Agent'-supplied
  460.      information.  While conceptually this is not such a bad idea, it
  461.      has been abused by servers denying information to clients other
  462.      than `Mozilla' or Microsoft `Internet Explorer'.  This option
  463.      allows you to change the `User-Agent' line issued by Wget.  Use of
  464.      this option is discouraged, unless you really know what you are
  465.      doing.
  466.      *NOTE* that Netscape Communications Corp. has claimed that false
  467.      transmissions of `Mozilla' as the `User-Agent' are a copyright
  468.      infringement, which will be prosecuted.  *DO NOT* misrepresent
  469.      Wget as Mozilla.
  470. File: wget.info,  Node: FTP Options,  Next: Recursive Retrieval Options,  Prev: HTTP Options,  Up: Invoking
  471. FTP Options
  472. ===========
  473. `--retr-symlinks'
  474.      Retrieve symbolic links on FTP sites as if they were plain files,
  475.      i.e. don't just create links locally.
  476. `-g on/off'
  477. `--glob=on/off'
  478.      Turn FTP globbing on or off.  Globbing means you may use the
  479.      shell-like special characters ("wildcards"), like `*', `?', `['
  480.      and `]' to retrieve more than one file from the same directory at
  481.      once, like:
  482.           wget ftp://gnjilux.cc.fer.hr/*.msg
  483.      By default, globbing will be turned on if the URL contains a
  484.      globbing character.  This option may be used to turn globbing on
  485.      or off permanently.
  486.      You may have to quote the URL to protect it from being expanded by
  487.      your shell.  Globbing makes Wget look for a directory listing,
  488.      which is system-specific.  This is why it currently works only
  489.      with Unix FTP servers (and the ones emulating Unix `ls' output).
  490. `--passive-ftp'
  491.      Use the "passive" FTP retrieval scheme, in which the client
  492.      initiates the data connection.  This is sometimes required for FTP
  493.      to work behind firewalls.
  494. File: wget.info,  Node: Recursive Retrieval Options,  Next: Recursive Accept/Reject Options,  Prev: FTP Options,  Up: Invoking
  495. Recursive Retrieval Options
  496. ===========================
  497. `--recursive'
  498.      Turn on recursive retrieving.  *Note Recursive Retrieval:: for more
  499.      details.
  500. `-l DEPTH'
  501. `--level=DEPTH'
  502.      Specify recursion maximum depth level DEPTH (*Note Recursive
  503.      Retrieval::).  The default maximum depth is 5.
  504. `--delete-after'
  505.      This option tells Wget to delete every single file it downloads,
  506.      *after* having done so.  It is useful for pre-fetching popular
  507.      pages through proxy, e.g.:
  508.           wget -r -nd --delete-after http://whatever.com/~popular/page/
  509.      The `-r' option is to retrieve recursively, and `-nd' not to
  510.      create directories.
  511. `--convert-links'
  512.      Convert the non-relative links to relative ones locally.  Only the
  513.      references to the documents actually downloaded will be converted;
  514.      the rest will be left unchanged.
  515.      Note that only at the end of the download can Wget know which
  516.      links have been downloaded.  Because of that, much of the work
  517.      done by `-k' will be performed at the end of the downloads.
  518. `--mirror'
  519.      Turn on options suitable for mirroring.  This option turns on
  520.      recursion and time-stamping, sets infinite recursion depth and
  521.      keeps FTP directory listings.  It is currently equivalent to `-r
  522.      -N -l inf -nr'.
  523. `-nr'
  524. `--dont-remove-listing'
  525.      Don't remove the temporary `.listing' files generated by FTP
  526.      retrievals.  Normally, these files contain the raw directory
  527.      listings received from FTP servers.  Not removing them can be
  528.      useful to access the full remote file list when running a mirror,
  529.      or for debugging purposes.
  530. File: wget.info,  Node: Recursive Accept/Reject Options,  Prev: Recursive Retrieval Options,  Up: Invoking
  531. Recursive Accept/Reject Options
  532. ===============================
  533. `-A ACCLIST --accept ACCLIST'
  534. `-R REJLIST --reject REJLIST'
  535.      Specify comma-separated lists of file name suffixes or patterns to
  536.      accept or reject (*Note Types of Files:: for more details).
  537. `-D DOMAIN-LIST'
  538. `--domains=DOMAIN-LIST'
  539.      Set domains to be accepted and DNS looked-up, where DOMAIN-LIST is
  540.      a comma-separated list.  Note that it does *not* turn on `-H'.
  541.      This option speeds things up, even if only one host is spanned
  542.      (*Note Domain Acceptance::).
  543. `--exclude-domains DOMAIN-LIST'
  544.      Exclude the domains given in a comma-separated DOMAIN-LIST from
  545.      DNS-lookup (*Note Domain Acceptance::).
  546. `--relative'
  547.      Follow relative links only.  Useful for retrieving a specific home
  548.      page without any distractions, not even those from the same hosts
  549.      (*Note Relative Links::).
  550. `--follow-ftp'
  551.      Follow FTP links from HTML documents.  Without this option, Wget
  552.      will ignore all the FTP links.
  553. `--span-hosts'
  554.      Enable spanning across hosts when doing recursive retrieving
  555.      (*Note All Hosts::).
  556. `-I LIST'
  557. `--include-directories=LIST'
  558.      Specify a comma-separated list of directories you wish to follow
  559.      when downloading (*Note Directory-Based Limits:: for more
  560.      details.)  Elements of LIST may contain wildcards.
  561. `-X LIST'
  562. `--exclude-directories=LIST'
  563.      Specify a comma-separated list of directories you wish to exclude
  564.      from download (*Note Directory-Based Limits:: for more details.)
  565.      Elements of LIST may contain wildcards.
  566. `-nh'
  567. `--no-host-lookup'
  568.      Disable the time-consuming DNS lookup of almost all hosts (*Note
  569.      Host Checking::).
  570. `-np'
  571. `--no-parent'
  572.      Do not ever ascend to the parent directory when retrieving
  573.      recursively.  This is a useful option, since it guarantees that
  574.      only the files *below* a certain hierarchy will be downloaded.
  575.      *Note Directory-Based Limits:: for more details.
  576. File: wget.info,  Node: Recursive Retrieval,  Next: Following Links,  Prev: Invoking,  Up: Top
  577. Recursive Retrieval
  578. *******************
  579.    GNU Wget is capable of traversing parts of the Web (or a single HTTP
  580. or FTP server), depth-first following links and directory structure.
  581. This is called "recursive" retrieving, or "recursion".
  582.    With HTTP URLs, Wget retrieves and parses the HTML from the given
  583. URL, documents, retrieving the files the HTML document was referring
  584. to, through markups like `href', or `src'.  If the freshly downloaded
  585. file is also of type `text/html', it will be parsed and followed
  586. further.
  587.    The maximum "depth" to which the retrieval may descend is specified
  588. with the `-l' option (the default maximum depth is five layers).  *Note
  589. Recursive Retrieval::.
  590.    When retrieving an FTP URL recursively, Wget will retrieve all the
  591. data from the given directory tree (including the subdirectories up to
  592. the specified depth) on the remote server, creating its mirror image
  593. locally.  FTP retrieval is also limited by the `depth' parameter.
  594.    By default, Wget will create a local directory tree, corresponding to
  595. the one found on the remote server.
  596.    Recursive retrieving can find a number of applications, the most
  597. important of which is mirroring.  It is also useful for WWW
  598. presentations, and any other opportunities where slow network
  599. connections should be bypassed by storing the files locally.
  600.    You should be warned that invoking recursion may cause grave
  601. overloading on your system, because of the fast exchange of data
  602. through the network; all of this may hamper other users' work.  The
  603. same stands for the foreign server you are mirroring--the more requests
  604. it gets in a rows, the greater is its load.
  605.    Careless retrieving can also fill your file system unctrollably,
  606. which can grind the machine to a halt.
  607.    The load can be minimized by lowering the maximum recursion level
  608. (`-l') and/or by lowering the number of retries (`-t').  You may also
  609. consider using the `-w' option to slow down your requests to the remote
  610. servers, as well as the numerous options to narrow the number of
  611. followed links (*Note Following Links::).
  612.    Recursive retrieval is a good thing when used properly.  Please take
  613. all precautions not to wreak havoc through carelessness.
  614. File: wget.info,  Node: Following Links,  Next: Time-Stamping,  Prev: Recursive Retrieval,  Up: Top
  615. Following Links
  616. ***************
  617.    When retrieving recursively, one does not wish to retrieve the loads
  618. of unnecessary data.  Most of the time the users bear in mind exactly
  619. what they want to download, and want Wget to follow only specific links.
  620.    For example, if you wish to download the music archive from
  621. `fly.cc.fer.hr', you will not want to download all the home pages that
  622. happen to be referenced by an obscure part of the archive.
  623.    Wget possesses several mechanisms that allows you to fine-tune which
  624. links it will follow.
  625. * Menu:
  626. * Relative Links::         Follow relative links only.
  627. * Host Checking::          Follow links on the same host.
  628. * Domain Acceptance::      Check on a list of domains.
  629. * All Hosts::              No host restrictions.
  630. * Types of Files::         Getting only certain files.
  631. * Directory-Based Limits:: Getting only certain directories.
  632. * FTP Links::              Following FTP links.
  633. File: wget.info,  Node: Relative Links,  Next: Host Checking,  Prev: Following Links,  Up: Following Links
  634. Relative Links
  635. ==============
  636.    When only relative links are followed (option `-L'), recursive
  637. retrieving will never span hosts.  No time-expensive DNS-lookups will
  638. be performed, and the process will be very fast, with the minimum
  639. strain of the network.  This will suit your needs often, especially when
  640. mirroring the output of various `x2html' converters, since they
  641. generally output relative links.
  642. File: wget.info,  Node: Host Checking,  Next: Domain Acceptance,  Prev: Relative Links,  Up: Following Links
  643. Host Checking
  644. =============
  645.    The drawback of following the relative links solely is that humans
  646. often tend to mix them with absolute links to the very same host, and
  647. the very same page.  In this mode (which is the default mode for
  648. following links) all URLs the that refer to the same host will be
  649. retrieved.
  650.    The problem with this option are the aliases of the hosts and
  651. domains.  Thus there is no way for Wget to know that `regoc.srce.hr' and
  652. `www.srce.hr' are the same host, or that `fly.cc.fer.hr' is the same as
  653. `fly.cc.etf.hr'.  Whenever an absolute link is encountered, the host is
  654. DNS-looked-up with `gethostbyname' to check whether we are maybe
  655. dealing with the same hosts.  Although the results of `gethostbyname'
  656. are cached, it is still a great slowdown, e.g. when dealing with large
  657. indices of home pages on different hosts (because each of the hosts
  658. must be and DNS-resolved to see whether it just *might* an alias of the
  659. starting host).
  660.    To avoid the overhead you may use `-nh', which will turn off
  661. DNS-resolving and make Wget compare hosts literally.  This will make
  662. things run much faster, but also much less reliable (e.g. `www.srce.hr'
  663. and `regoc.srce.hr' will be flagged as different hosts).
  664.    Note that modern HTTP servers allows one IP address to host several
  665. "virtual servers", each having its own directory hieratchy.  Such
  666. "servers" are distinguished by their hostnames (all of which point to
  667. the same IP address); for this to work, a client must send a `Host'
  668. header, which is what Wget does.  However, in that case Wget *must not*
  669. try to divine a host's "real" address, nor try to use the same hostname
  670. for each access, i.e. `-nh' must be turned on.
  671.    In other words, the `-nh' option must be used to enabling the
  672. retrieval from virtual servers distinguished by their hostnames.  As the
  673. number of such server setups grow, the behavior of `-nh' may become the
  674. default in the future.
  675. File: wget.info,  Node: Domain Acceptance,  Next: All Hosts,  Prev: Host Checking,  Up: Following Links
  676. Domain Acceptance
  677. =================
  678.    With the `-D' option you may specify the domains that will be
  679. followed.  The hosts the domain of which is not in this list will not be
  680. DNS-resolved.  Thus you can specify `-Dmit.edu' just to make sure that
  681. *nothing outside of MIT gets looked up*.  This is very important and
  682. useful.  It also means that `-D' does *not* imply `-H' (span all
  683. hosts), which must be specified explicitly.  Feel free to use this
  684. options since it will speed things up, with almost all the reliability
  685. of checking for all hosts.  Thus you could invoke
  686.      wget -r -D.hr http://fly.cc.fer.hr/
  687.    to make sure that only the hosts in `.hr' domain get DNS-looked-up
  688. for being equal to `fly.cc.fer.hr'.  So `fly.cc.etf.hr' will be checked
  689. (only once!) and found equal, but `www.gnu.ai.mit.edu' will not even be
  690. checked.
  691.    Of course, domain acceptance can be used to limit the retrieval to
  692. particular domains with spanning of hosts in them, but then you must
  693. specify `-H' explicitly.  E.g.:
  694.      wget -r -H -Dmit.edu,stanford.edu http://www.mit.edu/
  695.    will start with `http://www.mit.edu/', following links across MIT
  696. and Stanford.
  697.    If there are domains you want to exclude specifically, you can do it
  698. with `--exclude-domains', which accepts the same type of arguments of
  699. `-D', but will *exclude* all the listed domains.  For example, if you
  700. want to download all the hosts from `foo.edu' domain, with the
  701. exception of `sunsite.foo.edu', you can do it like this:
  702.      wget -rH -Dfoo.edu --exclude-domains sunsite.foo.edu http://www.foo.edu/
  703. File: wget.info,  Node: All Hosts,  Next: Types of Files,  Prev: Domain Acceptance,  Up: Following Links
  704. All Hosts
  705. =========
  706.    When `-H' is specified without `-D', all hosts are freely spanned.
  707. There are no restrictions whatsoever as to what part of the net Wget
  708. will go to fetch documents, other than maximum retrieval depth.  If a
  709. page references `www.yahoo.com', so be it.  Such an option is rarely
  710. useful for itself.
  711. File: wget.info,  Node: Types of Files,  Next: Directory-Based Limits,  Prev: All Hosts,  Up: Following Links
  712. Types of Files
  713. ==============
  714.    When downloading material from the web, you will often want to
  715. restrict the retrieval to only certain file types.  For example, if you
  716. are interested in downloading GIFS, you will not be overjoyed to get
  717. loads of Postscript documents, and vice versa.
  718.    Wget offers two options to deal with this problem.  Each option
  719. description lists a short name, a long name, and the equivalent command
  720. in `.wgetrc'.
  721. `-A ACCLIST'
  722. `--accept ACCLIST'
  723. `accept = ACCLIST'
  724.      The argument to `--accept' option is a list of file suffixes or
  725.      patterns that Wget will download during recursive retrieval.  A
  726.      suffix is the ending part of a file, and consists of "normal"
  727.      letters, e.g. `gif' or `.jpg'.  A matching pattern contains
  728.      shell-like wildcards, e.g. `books*' or `zelazny*196[0-9]*'.
  729.      So, specifying `wget -A gif,jpg' will make Wget download only the
  730.      files ending with `gif' or `jpg', i.e. GIFs and JPEGs.  On the
  731.      other hand, `wget -A "zelazny*196[0-9]*"' will download only files
  732.      beginning with `zelazny' and containing numbers from 1960 to 1969
  733.      anywhere within.  Look up the manual of your shell for a
  734.      description of how pattern matching works.
  735.      Of course, any number of suffixes and patterns can be combined
  736.      into a comma-separated list, and given as an argument to `-A'.
  737. `-R REJLIST'
  738. `--reject REJLIST'
  739. `reject = REJLIST'
  740.      The `--reject' option works the same way as `--accept', only its
  741.      logic is the reverse; Wget will download all files *except* the
  742.      ones matching the suffixes (or patterns) in the list.
  743.      So, if you want to download a whole page except for the cumbersome
  744.      MPEGs and .AU files, you can use `wget -R mpg,mpeg,au'.
  745.      Analogously, to download all files except the ones beginning with
  746.      `bjork', use `wget -R "bjork*"'.  The quotes are to prevent
  747.      expansion by the shell.
  748.    The `-A' and `-R' options may be combined to achieve even better
  749. fine-tuning of which files to retrieve.  E.g. `wget -A "*zelazny*" -R
  750. .ps' will download all the files having `zelazny' as a part of their
  751. name, but *not* the postscript files.
  752.    Note that these two options do not affect the downloading of HTML
  753. files; Wget must load all the HTMLs to know where to go at
  754. all--recursive retrieval would make no sense otherwise.
  755. File: wget.info,  Node: Directory-Based Limits,  Next: FTP Links,  Prev: Types of Files,  Up: Following Links
  756. Directory-Based Limits
  757. ======================
  758.    Regardless of other link-following facilities, it is often useful to
  759. place the restriction of what files to retrieve based on the directories
  760. those files are placed in.  There can be many reasons for this--the
  761. home pages may be organized in a reasonable directory structure; or some
  762. directories may contain useless information, e.g. `/cgi-bin' or `/dev'
  763. directories.
  764.    Wget offers three different options to deal with this requirement.
  765. Each option description lists a short name, a long name, and the
  766. equivalent command in `.wgetrc'.
  767. `-I LIST'
  768. `--include LIST'
  769. `include_directories = LIST'
  770.      `-I' option accepts a comma-separated list of directories included
  771.      in the retrieval.  Any other directories will simply be ignored.
  772.      The directories are absolute paths.
  773.      So, if you wish to download from `http://host/people/bozo/'
  774.      following only links to bozo's colleagues in the `/people'
  775.      directory and the bogus scripts in `/cgi-bin', you can specify:
  776.           wget -I /people,/cgi-bin http://host/people/bozo/
  777. `-X LIST'
  778. `--exclude LIST'
  779. `exclude_directories = LIST'
  780.      `-X' option is exactly the reverse of `-I'--this is a list of
  781.      directories *excluded* from the download.  E.g. if you do not want
  782.      Wget to download things from `/cgi-bin' directory, specify `-X
  783.      /cgi-bin' on the command line.
  784.      The same as with `-A'/`-R', these two options can be combined to
  785.      get a better fine-tuning of downloading subdirectories.  E.g. if
  786.      you want to load all the files from `/pub' hierarchy except for
  787.      `/pub/worthless', specify `-I/pub -X/pub/worthless'.
  788. `-np'
  789. `--no-parent'
  790. `no_parent = on'
  791.      The simplest, and often very useful way of limiting directories is
  792.      disallowing retrieval of the links that refer to the hierarchy
  793.      "upper" than the beginning directory, i.e. disallowing ascent to
  794.      the parent directory/directories.
  795.      The `--no-parent' option (short `-np') is useful in this case.
  796.      Using it guarantees that you will never leave the existing
  797.      hierarchy.  Supposing you issue Wget with:
  798.           wget -r --no-parent http://somehost/~luzer/my-archive/
  799.      You may rest assured that none of the references to
  800.      `/~his-girls-homepage/' or `/~luzer/all-my-mpegs/' will be
  801.      followed.  Only the archive you are interested in will be
  802.      downloaded.  Essentially, `--no-parent' is similar to
  803.      `-I/~luzer/my-archive', only it handles redirections in a more
  804.      intelligent fashion.
  805. File: wget.info,  Node: FTP Links,  Prev: Directory-Based Limits,  Up: Following Links
  806. Following FTP Links
  807. ===================
  808.    The rules for FTP are somewhat specific, as it is necessary for them
  809. to be.  FTP links in HTML documents are often included for purposes of
  810. reference, and it is often inconvenient to download them by default.
  811.    To have FTP links followed from HTML documents, you need to specify
  812. the `--follow-ftp' option.  Having done that, FTP links will span hosts
  813. regardless of `-H' setting.  This is logical, as FTP links rarely point
  814. to the same host where the HTTP server resides.  For similar reasons,
  815. the `-L' options has no effect on such downloads.  On the other hand,
  816. domain acceptance (`-D') and suffix rules (`-A' and `-R') apply
  817. normally.
  818.    Also note that followed links to FTP directories will not be
  819. retrieved recursively further.
  820. File: wget.info,  Node: Time-Stamping,  Next: Startup File,  Prev: Following Links,  Up: Top
  821. Time-Stamping
  822. *************
  823.    One of the most important aspects of mirroring information from the
  824. Internet is updating your archives.
  825.    Downloading the whole archive again and again, just to replace a few
  826. changed files is expensive, both in terms of wasted bandwidth and money,
  827. and the time to do the update.  This is why all the mirroring tools
  828. offer the option of incremental updating.
  829.    Such an updating mechanism means that the remote server is scanned in
  830. search of "new" files.  Only those new files will be downloaded in the
  831. place of the old ones.
  832.    A file is considered new if one of these two conditions are met:
  833.   1. A file of that name does not already exist locally.
  834.   2. A file of that name does exist, but the remote file was modified
  835.      more recently than the local file.
  836.    To implement this, the program needs to be aware of the time of last
  837. modification of both remote and local files.  Such information are
  838. called the "time-stamps".
  839.    The time-stamping in GNU Wget is turned on using `--timestamping'
  840. (`-N') option, or through `timestamping = on' directive in `.wgetrc'.
  841. With this option, for each file it intends to download, Wget will check
  842. whether a local file of the same name exists.  If it does, and the
  843. remote file is older, Wget will not download it.
  844.    If the local file does not exist, or the sizes of the files do not
  845. match, Wget will download the remote file no matter what the time-stamps
  846. * Menu:
  847. * Time-Stamping Usage::
  848. * HTTP Time-Stamping Internals::
  849. * FTP Time-Stamping Internals::
  850. File: wget.info,  Node: Time-Stamping Usage,  Next: HTTP Time-Stamping Internals,  Prev: Time-Stamping,  Up: Time-Stamping
  851. Time-Stamping Usage
  852. ===================
  853.    The usage of time-stamping is simple.  Say you would like to
  854. download a file so that it keeps its date of modification.
  855.      wget -S http://www.gnu.ai.mit.edu/
  856.    A simple `ls -l' shows that the time stamp on the local file equals
  857. the state of the `Last-Modified' header, as returned by the server.  As
  858. you can see, the time-stamping info is preserved locally, even without
  859. `-N'.
  860.    Several days later, you would like Wget to check if the remote file
  861. has changed, and download it if it has.
  862.      wget -N http://www.gnu.ai.mit.edu/
  863.    Wget will ask the server for the last-modified date.  If the local
  864. file is newer, the remote file will not be re-fetched.  However, if the
  865. remote file is more recent, Wget will proceed fetching it normally.
  866.    The same goes for FTP.  For example:
  867.      wget ftp://ftp.ifi.uio.no/pub/emacs/gnus/*
  868.    `ls' will show that the timestamps are set according to the state on
  869. the remote server.  Reissuing the command with `-N' will make Wget
  870. re-fetch *only* the files that have been modified.
  871.    In both HTTP and FTP retrieval Wget will time-stamp the local file
  872. correctly (with or without `-N') if it gets the stamps, i.e. gets the
  873. directory listing for FTP or the `Last-Modified' header for HTTP.
  874.    If you wished to mirror the GNU archive every week, you would use the
  875. following command every week:
  876.      wget --timestamping -r ftp://prep.ai.mit.edu/pub/gnu/
  877. File: wget.info,  Node: HTTP Time-Stamping Internals,  Next: FTP Time-Stamping Internals,  Prev: Time-Stamping Usage,  Up: Time-Stamping
  878. HTTP Time-Stamping Internals
  879. ============================
  880.    Time-stamping in HTTP is implemented by checking of the
  881. `Last-Modified' header.  If you wish to retrieve the file `foo.html'
  882. through HTTP, Wget will check whether `foo.html' exists locally.  If it
  883. doesn't, `foo.html' will be retrieved unconditionally.
  884.    If the file does exist locally, Wget will first check its local
  885. time-stamp (similar to the way `ls -l' checks it), and then send a
  886. `HEAD' request to the remote server, demanding the information on the
  887. remote file.
  888.    The `Last-Modified' header is examined to find which file was
  889. modified more recently (which makes it "newer").  If the remote file is
  890. newer, it will be downloaded; if it is older, Wget will give up.(1)
  891.    Arguably, HTTP time-stamping should be implemented using the
  892. `If-Modified-Since' request.
  893.    ---------- Footnotes ----------
  894.    (1) As an additional check, Wget will look at the `Content-Length'
  895. header, and compare the sizes; if they are not the same, the remote
  896. file will be downloaded no matter what the time-stamp says.
  897. File: wget.info,  Node: FTP Time-Stamping Internals,  Prev: HTTP Time-Stamping Internals,  Up: Time-Stamping
  898. FTP Time-Stamping Internals
  899. ===========================
  900.    In theory, FTP time-stamping works much the same as HTTP, only FTP
  901. has no headers--time-stamps must be received from the directory
  902. listings.
  903.    For each directory files must be retrieved from, Wget will use the
  904. `LIST' command to get the listing.  It will try to analyze the listing,
  905. assuming that it is a Unix `ls -l' listing, and extract the
  906. time-stamps.  The rest is exactly the same as for HTTP.
  907.    Assumption that every directory listing is a Unix-style listing may
  908. sound extremely constraining, but in practice it is not, as many
  909. non-Unix FTP servers use the Unixoid listing format because most (all?)
  910. of the clients understand it.  Bear in mind that RFC959 defines no
  911. standard way to get a file list, let alone the time-stamps.  We can
  912. only hope that a future standard will define this.
  913.    Another non-standard solution includes the use of `MDTM' command
  914. that is supported by some FTP servers (including the popular
  915. `wu-ftpd'), which returns the exact time of the specified file.  Wget
  916. may support this command in the future.
  917. File: wget.info,  Node: Startup File,  Next: Examples,  Prev: Time-Stamping,  Up: Top
  918. Startup File
  919. ************
  920.    Once you know how to change default settings of Wget through command
  921. line arguments, you may wish to make some of those settings permanent.
  922. You can do that in a convenient way by creating the Wget startup
  923. file--`.wgetrc'.
  924.    Besides `.wgetrc' is the "main" initialization file, it is
  925. convenient to have a special facility for storing passwords.  Thus Wget
  926. reads and interprets the contents of `$HOME/.netrc', if it finds it.
  927. You can find `.netrc' format in your system manuals.
  928.    Wget reads `.wgetrc' upon startup, recognizing a limited set of
  929. commands.
  930. * Menu:
  931. * Wgetrc Location::   Location of various wgetrc files.
  932. * Wgetrc Syntax::     Syntax of wgetrc.
  933. * Wgetrc Commands::   List of available commands.
  934. * Sample Wgetrc::     A wgetrc example.
  935. File: wget.info,  Node: Wgetrc Location,  Next: Wgetrc Syntax,  Prev: Startup File,  Up: Startup File
  936. Wgetrc Location
  937. ===============
  938.    When initializing, Wget will look for a "global" startup file,
  939. `/usr/local/etc/wgetrc' by default (or some prefix other than
  940. `/usr/local', if Wget was not installed there) and read commands from
  941. there, if it exists.
  942.    Then it will look for the user's file.  If the environmental variable
  943. `WGETRC' is set, Wget will try to load that file.  Failing that, no
  944. further attempts will be made.
  945.    If `WGETRC' is not set, Wget will try to load `$HOME/.wgetrc'.
  946.    The fact that user's settings are loaded after the system-wide ones
  947. means that in case of collision user's wgetrc *overrides* the
  948. system-wide wgetrc (in `/usr/local/etc/wgetrc' by default).  Fascist
  949. admins, away!
  950.