This is Info file wget.info, produced by Makeinfo version 1.67 from the
input file /ade-src/fsf/wget/doc/wget.texi.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.  Permission is granted to copy and distribute
modified versions of this manual under the conditions for verbatim
copying, provided also that the sections entitled "Copying" and "GNU
General Public License" are included exactly as in the original, and
provided that the entire resulting derived work is distributed under
the terms of a permission notice identical to this one.


File: wget.info,  Node: Top,  Next: Copying,  Prev: (dir),  Up: (dir)

Wget/1.4.2
**********

   This manual documents version 1.4.2 of Wget [formerly known as
Geturl], the freely available utility for network download.

   Copyright (C) 1996 Hrvoje Niksic <hniksic@srce.hr>

* Menu:

* Copying::             You may give out copies of Wget.
* Overview::            Features of Wget.
* Invoking::            Wget command-line arguments.
* URL Conventions::     What is considered a URL.
* Recursive Retrieval:: Description of recursive retrieval.
* Following Links::     The available methods of chasing links.
* Startup File::        How to create your very own .wgetrc.
* Examples::            Examples of usage.
* Various::             The stuff that doesn't fit anywhere else.
* Concept Index::       A menu covering topics.


File: wget.info,  Node: Copying,  Next: Overview,  Prev: Top,  Up: Top

GNU GENERAL PUBLIC LICENSE
**************************

                         Version 2, June 1991

     Copyright (C) 1989, 1991 Free Software Foundation, Inc.
     675 Mass Ave, Cambridge, MA 02139, USA
     
     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.

Preamble
========

   The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

   When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it in
new free programs; and that you know you can do these things.

   To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

   For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

   We protect your rights with two steps: (1) copyright the software,
and (2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

   Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

   Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

   The precise terms and conditions for copying, distribution and
modification follow.

    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  1. This License applies to any program or other work which contains a
     notice placed by the copyright holder saying it may be distributed
     under the terms of this General Public License.  The "Program",
     below, refers to any such program or work, and a "work based on
     the Program" means either the Program or any derivative work under
     copyright law: that is to say, a work containing the Program or a
     portion of it, either verbatim or with modifications and/or
     translated into another language.  (Hereinafter, translation is
     included without limitation in the term "modification".)  Each
     licensee is addressed as "you".

     Activities other than copying, distribution and modification are
     not covered by this License; they are outside its scope.  The act
     of running the Program is not restricted, and the output from the
     Program is covered only if its contents constitute a work based on
     the Program (independent of having been made by running the
     Program).  Whether that is true depends on what the Program does.

  2. You may copy and distribute verbatim copies of the Program's
     source code as you receive it, in any medium, provided that you
     conspicuously and appropriately publish on each copy an appropriate
     copyright notice and disclaimer of warranty; keep intact all the
     notices that refer to this License and to the absence of any
     warranty; and give any other recipients of the Program a copy of
     this License along with the Program.

     You may charge a fee for the physical act of transferring a copy,
     and you may at your option offer warranty protection in exchange
     for a fee.

  3. You may modify your copy or copies of the Program or any portion
     of it, thus forming a work based on the Program, and copy and
     distribute such modifications or work under the terms of Section 1
     above, provided that you also meet all of these conditions:

       a. You must cause the modified files to carry prominent notices
          stating that you changed the files and the date of any change.

       b. You must cause any work that you distribute or publish, that
          in whole or in part contains or is derived from the Program
          or any part thereof, to be licensed as a whole at no charge
          to all third parties under the terms of this License.

       c. If the modified program normally reads commands interactively
          when run, you must cause it, when started running for such
          interactive use in the most ordinary way, to print or display
          an announcement including an appropriate copyright notice and
          a notice that there is no warranty (or else, saying that you
          provide a warranty) and that users may redistribute the
          program under these conditions, and telling the user how to
          view a copy of this License.  (Exception: if the Program
          itself is interactive but does not normally print such an
          announcement, your work based on the Program is not required
          to print an announcement.)

     These requirements apply to the modified work as a whole.  If
     identifiable sections of that work are not derived from the
     Program, and can be reasonably considered independent and separate
     works in themselves, then this License, and its terms, do not
     apply to those sections when you distribute them as separate
     works.  But when you distribute the same sections as part of a
     whole which is a work based on the Program, the distribution of
     the whole must be on the terms of this License, whose permissions
     for other licensees extend to the entire whole, and thus to each
     and every part regardless of who wrote it.

     Thus, it is not the intent of this section to claim rights or
     contest your rights to work written entirely by you; rather, the
     intent is to exercise the right to control the distribution of
     derivative or collective works based on the Program.

     In addition, mere aggregation of another work not based on the
     Program with the Program (or with a work based on the Program) on
     a volume of a storage or distribution medium does not bring the
     other work under the scope of this License.

  4. You may copy and distribute the Program (or a work based on it,
     under Section 2) in object code or executable form under the terms
     of Sections 1 and 2 above provided that you also do one of the
     following:

       a. Accompany it with the complete corresponding machine-readable
          source code, which must be distributed under the terms of
          Sections 1 and 2 above on a medium customarily used for
          software interchange; or,

       b. Accompany it with a written offer, valid for at least three
          years, to give any third party, for a charge no more than your
          cost of physically performing source distribution, a complete
          machine-readable copy of the corresponding source code, to be
          distributed under the terms of Sections 1 and 2 above on a
          medium customarily used for software interchange; or,

       c. Accompany it with the information you received as to the offer
          to distribute corresponding source code.  (This alternative is
          allowed only for noncommercial distribution and only if you
          received the program in object code or executable form with
          such an offer, in accord with Subsection b above.)

     The source code for a work means the preferred form of the work for
     making modifications to it.  For an executable work, complete
     source code means all the source code for all modules it contains,
     plus any associated interface definition files, plus the scripts
     used to control compilation and installation of the executable.
     However, as a special exception, the source code distributed need
     not include anything that is normally distributed (in either
     source or binary form) with the major components (compiler,
     kernel, and so on) of the operating system on which the executable
     runs, unless that component itself accompanies the executable.

     If distribution of executable or object code is made by offering
     access to copy from a designated place, then offering equivalent
     access to copy the source code from the same place counts as
     distribution of the source code, even though third parties are not
     compelled to copy the source along with the object code.

  5. You may not copy, modify, sublicense, or distribute the Program
     except as expressly provided under this License.  Any attempt
     otherwise to copy, modify, sublicense or distribute the Program is
     void, and will automatically terminate your rights under this
     License.  However, parties who have received copies, or rights,
     from you under this License will not have their licenses
     terminated so long as such parties remain in full compliance.

  6. You are not required to accept this License, since you have not
     signed it.  However, nothing else grants you permission to modify
     or distribute the Program or its derivative works.  These actions
     are prohibited by law if you do not accept this License.
     Therefore, by modifying or distributing the Program (or any work
     based on the Program), you indicate your acceptance of this
     License to do so, and all its terms and conditions for copying,
     distributing or modifying the Program or works based on it.

  7. Each time you redistribute the Program (or any work based on the
     Program), the recipient automatically receives a license from the
     original licensor to copy, distribute or modify the Program
     subject to these terms and conditions.  You may not impose any
     further restrictions on the recipients' exercise of the rights
     granted herein.  You are not responsible for enforcing compliance
     by third parties to this License.

  8. If, as a consequence of a court judgment or allegation of patent
     infringement or for any other reason (not limited to patent
     issues), conditions are imposed on you (whether by court order,
     agreement or otherwise) that contradict the conditions of this
     License, they do not excuse you from the conditions of this
     License.  If you cannot distribute so as to satisfy simultaneously
     your obligations under this License and any other pertinent
     obligations, then as a consequence you may not distribute the
     Program at all.  For example, if a patent license would not permit
     royalty-free redistribution of the Program by all those who
     receive copies directly or indirectly through you, then the only
     way you could satisfy both it and this License would be to refrain
     entirely from distribution of the Program.

     If any portion of this section is held invalid or unenforceable
     under any particular circumstance, the balance of the section is
     intended to apply and the section as a whole is intended to apply
     in other circumstances.

     It is not the purpose of this section to induce you to infringe any
     patents or other property right claims or to contest validity of
     any such claims; this section has the sole purpose of protecting
     the integrity of the free software distribution system, which is
     implemented by public license practices.  Many people have made
     generous contributions to the wide range of software distributed
     through that system in reliance on consistent application of that
     system; it is up to the author/donor to decide if he or she is
     willing to distribute software through any other system and a
     licensee cannot impose that choice.

     This section is intended to make thoroughly clear what is believed
     to be a consequence of the rest of this License.

  9. If the distribution and/or use of the Program is restricted in
     certain countries either by patents or by copyrighted interfaces,
     the original copyright holder who places the Program under this
     License may add an explicit geographical distribution limitation
     excluding those countries, so that distribution is permitted only
     in or among countries not thus excluded.  In such case, this
     License incorporates the limitation as if written in the body of
     this License.

 10. The Free Software Foundation may publish revised and/or new
     versions of the General Public License from time to time.  Such
     new versions will be similar in spirit to the present version, but
     may differ in detail to address new problems or concerns.

     Each version is given a distinguishing version number.  If the
     Program specifies a version number of this License which applies
     to it and "any later version", you have the option of following
     the terms and conditions either of that version or of any later
     version published by the Free Software Foundation.  If the Program
     does not specify a version number of this License, you may choose
     any version ever published by the Free Software Foundation.

 11. If you wish to incorporate parts of the Program into other free
     programs whose distribution conditions are different, write to the
     author to ask for permission.  For software which is copyrighted
     by the Free Software Foundation, write to the Free Software
     Foundation; we sometimes make exceptions for this.  Our decision
     will be guided by the two goals of preserving the free status of
     all derivatives of our free software and of promoting the sharing
     and reuse of software generally.

                                NO WARRANTY

 12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
     WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
     LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
     HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
     WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
     NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
     FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
     QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
     PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
     SERVICING, REPAIR OR CORRECTION.

 13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
     WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
     MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
     LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
     INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
     INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
     DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
     OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
     OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
     ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

                      END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs
=============================================

   If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

   To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

     ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES.
     Copyright (C) 19YY  NAME OF AUTHOR
     
     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
     as published by the Free Software Foundation; either version 2
     of the License, or (at your option) any later version.
     
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
     
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

   Also add information on how to contact you by electronic and paper
mail.

   If the program is interactive, make it output a short notice like
this when it starts in an interactive mode:

     Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
     type `show w'.  This is free software, and you are welcome
     to redistribute it under certain conditions; type `show c'
     for details.

   The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.

   You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the program,
if necessary.  Here is a sample; alter the names:

     Yoyodyne, Inc., hereby disclaims all copyright
     interest in the program `Gnomovision'
     (which makes passes at compilers) written
     by James Hacker.
     
     SIGNATURE OF TY COON, 1 April 1989
     Ty Coon, President of Vice

   This General Public License does not permit incorporating your
program into proprietary programs.  If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library.  If this is what you want to do, use the
GNU Library General Public License instead of this License.


File: wget.info,  Node: Overview,  Next: Invoking,  Prev: Copying,  Up: Top

Overview
********

   Wget [formerly known as Geturl] is a freely available network utility
to retrieve files from the World Wide Web, using HTTP (Hyper Text
Transfer Protocol) and FTP (File Transfer Protocol), the two most
widely used Internet protocols.

   Wget is non-interactive, which means it can work in the background,
while the user is not logged on (so that you may start the program and
log off, letting it do its work), unlike most of the Web browsers, which
require constant user's presence, which is a great hindrance when
transfering a lot of data.

   Wget works exceedingly well on slow or unstable connections, keeping
getting the document until it is fully retrieved, or until a
user-specified retry count is surpassed.  It will try to resume the
download from the point of interruption, using `REST' with FTP and
`Range' with HTTP servers that support them.

   Wget is capable of descending recursively (*Note Recursive
Retrieval::) through the structure of HTML documents and FTP directory
trees, making locally the directory hierarchy similar to the one on the
remote server.  This feature can be used to mirror archives and home
pages, or traverse the web in search of data, like a WWW robot (*Note
Robots::).  In that spirit, Wget understands the `norobots' convention.

   File name wildcard matching and recursive mirroring of directories
are available when retrieving via FTP.  Wget can read the time-stamp
information given by both HTTP and FTP servers, and store it locally.
Thus Wget can see if the remote file has changed since last retrieval,
and automatically retrieve the new version if it has.  This makes Wget
suitable for mirroring of FTP sites, as well as home pages.

   Wget supports PROXY servers, to lighten the network load and to
speed up retrieval.  If you are behind a firewall and have the `socks'
library installed, you can build a socks-aware Wget to reach the net
behind the firewall.

   The retrieval is conveniently traced with printing dots, each dot by
default representing one kilobyte of data received.  Builtin features
offer mechanisms to tune which links you wish to follow (*Note
Following Links::).

   Most of the features are fully configurable, either through command
line options (*Note Invoking::), or via the initialization file
`.wgetrc' (*Note Startup File::).  Wget allows you to define "global"
startup files (`/usr/local/lib/wgetrc' by default) for site settings.


File: wget.info,  Node: Invoking,  Next: URL Conventions,  Prev: Overview,  Up: Top

Invoking
********

   By default, Wget is very simple to invoke.  The basic syntax is:

     wget [options] URL1 [URL2 ...]

   URL is a "Uniform Resource Locator", as defined later (*Note URL
Conventions::).

   Be aware that `ksh' and its descendants (like `zsh') kill off the
background processes during logout.  To prevent this, use `nohup', as
documented in system manuals.

   However, you may wish to change some of the default parameters of
Wget.  You can do it two ways: permanently, adding the appropriate
command to `.wgetrc' (*Note Startup File::), or specifying it on the
command line.

* Menu:

* Option Syntax::       Syntax of options.
* Basic Options::       Basic command line arguments.
* Advanced Options::    Advanced command line arguments.


File: wget.info,  Node: Option Syntax,  Next: Basic Options,  Prev: Invoking,  Up: Invoking

Option Syntax
=============

   Since Wget uses GNU getopts to parse its arguments, every option has
its short and long form.  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.cc.fer.hr/ -o log

   The space between the option accepting an argument and the argument
may be omitted.  Instead `-o log' you can write `-olog'.

   You may put several options that do not require arguments together,
like:

     wget -drc URL

   This is a complete equivalent of:

     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 use the convention
that, when presented an empty list, it means to clear it.  This can be
useful to clear the `.wgetrc' settings.  So, if your .wgetrc sets the
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' (*Note Wgetrc Syntax::).

     wget -X '' -X /~nobody,/~somebody


File: wget.info,  Node: Basic Options,  Next: Advanced Options,  Prev: Option Syntax,  Up: Invoking

Basic Options
=============

   The command line arguments, sorted alphabetically.

`-a logfile'
`--append-output=logfile'
     Append to `logfile' -- the same as -o, but appending to the
     `logfile' (or creating a new one if the old does not exist) instead
     of rewriting the old log file.

`-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 that case `-d' will not work.  Please note that when
     the program is compiled with debug support, it will *not* print
     the debug info unless `-d' is turned on explicitly.

`-h'
`--help'
     Print a help screen. You will also get help if you do not supply
     command-line arguments.

`-i file'
`--input-file=file'
     Read URLs from `file', in which case no URLs need to be 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.  The `file' need not be an HTML document (but no
     harm if it is) -- it is enough if the URLs are just listed
     sequentially.

     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.

`-l depth'
`--level=depth'
     Specify recursion depth level(*Note Recursive Retrieval::).  The
     default maximum depth is 5.

`-nc'
     Do not clobber existing files when saving to directory hierarchy
     within recursive retrieval of several files. This option is
     *extremely* useful when you wish to continue where you left off
     with retrieval of many files.  If the files are .html or (yuck)
     .htm, they will be loaded from the local disk, and parsed as if
     they have been retrieved from the Web.

`-o logfile'
`--output-file=logfile'
     Log all messages to `logfile', instead of the default stdout.  If
     you do not wish the log output to be verbose, use `-nv'
     (non-verbose).

`-q'
`--quiet'
     This option is the opposite of verbose, making Wget completely
     quiet.

`-r'
`--recursive'
     Turn on recursive retrieving (*Note Recursive Retrieval::).

`-t num'
`--tries=num'
     Set number of retries to `num'.  Specify 0 or `inf' for infinite
     retrying.

`-V'
`--version'
     Display the version of Wget.

`-v'
`--verbose'
     Turn on verbose output, with all the available data.  The default
     output is verbose.


File: wget.info,  Node: Advanced Options,  Prev: Basic Options,  Up: Invoking

Advanced Options
================

   The following table contains the alphabetically sorted list of the
"advanced" command line arguments, for people familiar with basic
operating of Wget, wishing to change its default behaviour.  Not for
the faint of heart.

`-A acclist --accept acclist'
`-R rejlist --reject rejlist'
     Specify comma-separated lists of file name suffices or patterns to
     accept or reject. E.g., if you wish to download only GIFs or
     JPEGs, you can use `-A gif,jpg,jpeg'.  If you wish to download
     everything except the cumbersome MPEGs and .AU files, you can use
     `-R mpg,mpeg,au'.

     If a string contains wildcards, it will be considered a globbing
     pattern, and will *not* be matched backwards.  Thus you may
     specify `-A "*bjork*1995*html"' to accept only files containing
     `bjork' and `1995', ending with `html'.

     To download all files except the ones beginning with `bjork', use
     `wget -R "bjork*"'.  The quotes are to prevent expansion by the
     shell.

`-c'
`--continue'
     Continue retrieval of FTP documents, from where it was left off by
     another program or a previous instance of Wget.  Thus you can
     write:

          wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z

     If there is a file name `ls-lR.Z' in the current directory, Wget
     will assume that it is the first portion of the remote file, and
     will require the server to continue the retrieval from an offset
     equal to the length of the local file.

     Note that you need not specify this option if all you want is Wget
     to continue retrieving where it left off when the connection is
     lost -- Wget does this by default.  You need this option when you
     want to continue retrieval of a file already halfway retrieved,
     saved by another FTP client, or left by Wget being killed.

     Without `-c', the previous example would just begin to download the
     remote file to `ls-lR.Z.1'.  `-c' option is also applicable for
     HTTP servers that support `Range'.

`-D domain-list'
`--domains=domain-list'
     Set domains to be accepted and DNS looked-up, where `domain-list'
     is a comma-separated list.  Note that it does *not* turn on `-H'.
     This option speeds things up, even if only one host is spanned
     (*Note Domain Acceptance::).

`--delete-after'
     This option tells Wget to delete every single file it downloads,
     *after* having done so.  It is useful for pre-fetching popular
     pages through proxy, e.g.:

          wget -r -nd --delete-after http://whatever.com/~popular/page/

`--dot-style=style'
     Set the style of dot-traced retrieval.  You can choose between
     several "styles".  With the `default' style each dot represents 1K,
     there are ten dots in a "cluster" and 50 dots in a line.  `binary'
     style has a more "computer"-like orientation -- 8K dots, 16-dots
     clusters and 64 dots per line (which makes for 512K lines).  `mega'
     style is suitable for downloading very large files -- each dot
     represents 64K retrieved, there are eight dots in a cluster, and
     48 dots on each line (so each line contains 3M).  `micro' style is
     exactly the reverse; it is suitable for downloading small files,
     with 128-byte dots, 8 dots per cluster, and 48 dots (6K) per line.

`-e command'
`--execute command'
     Execute `command' as if it were a part of `.wgetrc' (*Note Startup
     File::).  A command thus invoked will take precedence over the
     same command in `.wgetrc'.

`-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>' to HTML, or
     using `--base'.

`-g on/off'
`--glob=on/off'
     Turn FTP globbing on or off.  Globbing means you may use the
     shell-like special characters ("wildcards"), like `*', `?', `['
     and `]' to retrieve more than one file from the same directory at
     once, like:

          wget ftp://gnjilux.cc.fer.hr/*.msg

     By default, globbing will be turned on if the URL contains a
     globbing character.  This option may be used to turn globbing on
     or off permanently.

     You may have to quote the URL to protect it from being expanded by
     your shell.  Globbing makes Wget look for a directory listing,
     which is system-specific.  This is why it currently works only
     with UNIX FTP servers (and the ones emulating UNIX `ls' output).

`--retr-symlinks'
     Retrieve symbolic links on FTP sites as if they were plain files,
     i.e. don't just create links locally.

`-H'
`--span-hosts'
     Enable spanning across hosts when doing recursive retrieving
     (*Note All Hosts::).

`--header=additional-header'
     Define an `additional-header' to be passed to the HTTP servers.
     Headers must contain a `:' preceded by one or more non-blank
     characters, and must not contain newlines.

     You may define more than one additional header by specifying
     `--header' more than once.

          wget --header='Accept-Charset: iso-8859-2' \
               --header='Accept-Language: hr' \
                 http://fly.cc.fer.hr/

     Specification of an empty string as the header value will clear
     all the user-defined headers.

`--http-user=user'
`--http-passwd=password'
     Specify the username `user' and password `password' on a HTTP
     server.  Wget will "crypt" them using the `basic' (insecure) WWW
     authentication scheme.  You can also encode the username and
     password to the URL (*Note URL Conventions::).

`-I list'
`--include-directories=list'
     Specify a comma-separated list of directories you wish to follow
     when downloading, the "opposite" of -exclude-directories.  The
     directories are absolute paths.

     E.g. if you do want Wget to download/follow only things things from
     `/users' and `/cgi-bin', specify `-I /users,/cgi-bin' on the
     command line.

`-k'
`--convert-links'
     Convert the non-relative links to relative ones locally.

`-L --relative'
     Follow only relative links.  Useful for retrieving a specific
     homepage without any distractions, not even those from the same
     hosts (*Note Relative Links::).

`-m'
`--mirror'
     Turn on options suitable for mirroring.  This option turns on
     recursion and time-stamping, sets infinite recursion depth and
     keeps FTP directory listings.  It is currently equivalent to `-r
     -N -l0 -nr'.

`-N'
`--timestamping'
     Use the so-called "time-stamps" to determine whether to retrieve a
     file.  If the last-modification date of the remote file is equal
     to, or older than that of local file, and the sizes of files are
     equal, the remote file will not be retrieved.  This option is
     useful for weekly mirroring of HTTP or FTP sites, since it will
     not permit downloading of the same file twice.

`-nd'
     Do not create a hierarchy of directories when retrieving
     recursively. With this option turned on, all files will get saved
     to the current directory, without clobbering (if a name shows up
     more than once, the filenames will get extensions `.n').

`-nH'
     Disable generation of host-prefixed directories.  By default,
     `wget -r http://fly.cc.fer.hr/' will create a structure of
     directories beginning with `fly.cc.fer.hr/'.  This option disables
     it.

`-nh'
     Disable the time-consuming DNS lookup of almost all hosts (*Note
     Host Checking::).

`-np'
`--no-parent'
     Do not ever ascend to the parent directory when retrieving
     recursively.  This is a useful option, since it guarantees that
     only the files *below* a certain hierarchy will be downloaded.
     *Note No Parent:: for more details.

`-nr'
     Do not remove the `.listing' files generated by FTP.  This is
     useful when running a mirror to see the remote file list.  It can
     also be used for debugging purposes.

`-nv'
     Non-verbose output -- turn off verbose without being completely
     quiet (use `-q' for that), which means that error messages and
     basic information still get printed.

`-O file'
`--output-document=file'
     The documents will not be written to the appropriate files, but
     all will be appended to a unique file specified by this option.
     The number of tries will be set to 1 automatically.  If the `file'
     is `-', the documents will be written to stdout, and `--quiet'
     will be turned on.  This option is useful for making Wget a part
     of pipelines (*Note Advanced Usage::).

     Be careful, however, since setting `--quiet' turns off all the
     useful diagnostics Wget can otherwise give.

`-P prefix'
`--directory-prefix=prefix'
     Set directory prefix (`.' by default) to `prefix'.  The "directory
     prefix" is the directory where all other files and subdirectories
     will be saved to.

`-p'
`--prefix-files'
     Set prefix files.  By default, Wget will save URLs to appropriate
     file names (e.g. `http://yoyodine.com/sharon.gif' will be written
     to `sharon.gif').  With `-p' turned on, all the files will be
     saved to a single file.  If a file with the same name already
     exists, the file name will be appended `.1'.

`-Q quota'
`--quota=quota'
     Specify download quota for automatic retrievals.  The value can be
     specified in bytes (default), kilobytes (with `k' suffix), or
     megabytes (with `m' suffix).

     Note that quota will never affect downloading a single file.  So
     if you specify `wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz',
     all of the `ls-lR.gz' will be downloaded.  The same goes even when
     several URLs are specified on the command-line.  However, quota is
     respected when retrieving either recursively, or from an input
     file.  Thus you may safely type `wget -Q2m -i sites' -- download
     will be aborted when the quota is exceeded.

     Setting quota to 0 or `inf' unlimits the download quota.

`-S'
`--server-response'
     Print the headers sent by HTTP servers and responses sent by FTP
     servers.

`-s'
`--save-headers'
     Save the headers sent by the HTTP server to the file, before the
     actual contents.

`--spider'
     When invoked with this option, Wget will behave as a Web "spider",
     which means that it will not download the pages, just check that
     they are there.  You can use it to check your bookmarks, e.g. with:
     (1)

          wget --spider --force-html -i bookmarks.html
          wget --spider -Fi **/*.html

`-T seconds'
`--timeout=seconds'
     Set the read timeout to `seconds' seconds.  Whenever a read is
     issued, the file descriptor is checked for a timeout, which could
     otherwise leave a pending connection (uninterrupted read).  The
     default timeout is 900 seconds (fifteen minutes).  Setting timeout
     to 0 will disable checking for timeouts.

`-X list'
`--exclude-directories=list'
     Specify a comma-separated list of directories you wish to exclude
     from download.  The directories are absolute paths.

     E.g. if you do not want Wget to download things from `/cgi-bin'
     directory, specify `-X /cgi-bin' on the command line.  If you want
     to load all the files from `/pub' hierarchy except `/pub/emacs',
     specify `-I/pub -X/pub/emacs'.

`-x'
     The opposite of `-nd' -- create a hierarchy of directories, even
     if one would not have been created otherwise.

`-Y on/off'
`--proxy=on/off'
     Turn PROXY support on or off. The proxy is on by default if the
     appropriate environmental variable is defined.

   ---------- Footnotes ----------

   (1)  `**/*.html' is a zsh construct that yields all the html files
in all subdirectories.  The same could have been achieved with ``find .
-name '*.html' -print`'.


File: wget.info,  Node: URL Conventions,  Next: Recursive Retrieval,  Prev: Invoking,  Up: Top

URL Conventions
***************

   "URL" is an acronym for Uniform Resource Locator.  Wget recognizes
the URL syntax as per RFC1738.  This is the most widely used form
(square brackets denote optional parts):

     http://host[:port]/path
     ftp://host[:port]/path

   You can also encode your username and password within a URL:

     ftp://user:password@host/path
     http://user:password@host/path

   Either `user' or `password', or both may be left out (e.g.
`ftp://user@host' is valid).  If you do not specify either the HTTP
username or password, they will be ignored.  If you leave out FTP
username, `anonymous' will be used.  If you leave out FTP password,
your email address will be used for password.

   You can encode the non-printing character in any URL by coding it as
`%xy', where `x' and `y' are hexadecimal digits.  Of course, you must
quote the `%' itself with `%25'.  You can encode `:' and `@' in
passwords with `%3A' and `%40' respectively.

   Two alternative variants are also supported, because of historical
(hysterical?)  reasons and their wide-spreadedness.

   FTP-only syntax (supported by `NcFTP'):
     host:/dir/file

   HTTP-only syntax (supported by `Netscape' and `Lynx'):
     host[:port]/dir/file

   These two alternative forms are deprecated, and may cease being
supported in the future.

   If you do not understand the difference between these notations, or
do not know which one to use, just use the plain ordinary format you use
with your favourite browser, like `Lynx' or `Netscape'.


File: wget.info,  Node: Recursive Retrieval,  Next: Following Links,  Prev: URL Conventions,  Up: Top

Recursive Retrieval
*******************

   Wget is capable of traversing parts of the Web (or a single HTTP or
FTP server), following links and directory structure.  This is called
"recusive" retrieving, or "recursion".

   With HTTP URLs, Wget retrieves and parses the HTML from the given
URL, documents, retrieving the files the HTML document was refering to,
through markups like HREF, or SRC.  If a downloaded document is also an
HTML file, it will be parsed and followed further.  The maximum depth
of retrieval is specified with `-l' option (default 5).  *Note Basic
Options::.

   Wget will create a local hierarchy of files, corresponding to the one
found on the remote server.

   Recursion is an ideal possibility for various presentations, where
slow connections should be bypassed.

   When retrieving an FTP URL recursively, Wget will retrieve all the
data from the given directory and subdirectories, also creating a local
hierarchy.

   You should be warned that invoking recursion may cause grave
overloading on your system, both on client and server side, and your
system administrator may choose not to enable it.  The load can be
minimized by lowering the maximum recursion level (`-l') and/or by
lowering the number of retries (`-t').

   Recursion is a good thing when used properly.  Use it with utmost
care.


File: wget.info,  Node: Following Links,  Next: Startup File,  Prev: Recursive Retrieval,  Up: Top

Following Links
***************

   When retrieving recursively, one does not wish to retrieve the loads
of unnecessary data.  Most of the time the users bear in mind exactly
what they want to download, and want Wget to follow only specific links.

   For example, if you wish to download the music archive from
`fly.cc.fer.hr', you will not want to download all the homepages that
happen to be referenced by an obscure part of the archive.

   Wget possesses mechanisms that allows you to fine-tune which links it
will follow.

* Menu:

* Relative Links::      Follow relative links only.
* Host Checking::       Follow links on the same host.
* Domain Acceptance::   Check on a list of domains.
* All Hosts::           No restrictions.
* No Parent::           Not ascending to parent directory.
* FTP Links::           Following FTP links.


File: wget.info,  Node: Relative Links,  Next: Host Checking,  Prev: Following Links,  Up: Following Links

Relative Links
==============

   When only relative links are followed (option `-L'), recursive
retrieving will never span hosts. `gethostbyname' will never be called,
and the process will be very fast, with the minimum strain of the
network.  This will suit your needs most of the times, especially when
mirroring the output of various `x2html' converters, since they
generally output relative links.


File: wget.info,  Node: Host Checking,  Next: Domain Acceptance,  Prev: Relative Links,  Up: Following Links

Host Checking
=============

   The drawback of following the relative links solely is that humans
often tend to mix them with absolute links to the very same host, and
the very same page.  In this mode (which is the default mode for
following links) all URLs that refer to the same host will be retrieved.

   The problem with this option are the aliases of the hosts and
domains.  Thus there is no way for Wget to know that `regoc.srce.hr' and
`www.srce.hr' are the same host, or that `fly.cc.fer.hr' is the same as
`fly.cc.etf.hr'.  Whenever an absolute link is encountered, the host is
DNS-looked-up with `gethostbyname' to check whether we are maybe
dealing with the same hosts.  Although the results of `gethostbyname'
are hashed, it is still a great slowdown, e.g. when dealing with large
indices of homepages on different hosts (because each of the hosts must
be looked-up and DNS-resolved to see whether it might be the starting
host).

   To avoid the overhead you may use `-nh', which will turn off
DNS-resolving and make Wget compare hosts litterally.  This will make
things run much faster, but also much less reliable.


File: wget.info,  Node: Domain Acceptance,  Next: All Hosts,  Prev: Host Checking,  Up: Following Links

Domain Acceptance
=================

   With the `-D' option you may specify domains that will be followed.
The hosts the domain of which is not in this list will not be
DNS-resolved.  Thus you map specify `-Dmit.edu' just to make sure that
*nothing outside of MIT gets looked up*.  This is very important and
useful.  It also means that `-D' does *not* imply `-H' (it must be
specified explicitly).  Feel free to use this options since it will
speed things up, with almost all the reliability of checking for all
hosts.  Thus you could invoke

     wget -r -D.hr http://fly.cc.fer.hr/

   to make sure that only the hosts in `.hr' domain get DNS-looked-up
for being equal to `fly.cc.fer.hr'.  So `fly.cc.etf.hr' will be checked
(ony once!) and found equal, but `www.gnu.ai.mit.edu' will not even be
checked.

   Of course, domain acceptance can be used to limit the retrieval to
particular domains with spanning of hosts in them, but then you must
specify `-H' explicitly.  E.g.

     wget -r -H -Dmit.edu,stanford.edu http://www.mit.edu/

   will start with `http://www.mit.edu/', following links across MIT
and Stanford.


File: wget.info,  Node: All Hosts,  Next: No Parent,  Prev: Domain Acceptance,  Up: Following Links

All Hosts
=========

   When `-H' is specified without `-D', all hosts are freely spanned.
There are no restrictions whatsoever as to what part of the net Wget
will go to fetch documents.  Such an option is rarely useful.


File: wget.info,  Node: No Parent,  Next: FTP Links,  Prev: All Hosts,  Up: Following Links

No Parent
=========

   Regardless of other link-following facilities, you may wish to ban
following of all links that refer to the hierarchy "upper" than the
beginning directory.  The `--no-parent' option (short `-np') is useful
in this case.  Using it guarantees that you will never leave the
existing hierarchy.  So, supposing you issue Wget with:

     wget -r --no-parent http://somehost/~luzer/my-archive/

   You may rest assured that none of the references to
`/~his-girls-homepage/' or `/our-page.html' will be followed.  Only the
archive you are interested in will be downloaded.

   It is much better than simply using `-L' for the same purpose, since
it will handle absolute paths correctly.  However, it will not go into
additional trouble in preventing DNS lookups.


File: wget.info,  Node: FTP Links,  Prev: No Parent,  Up: Following Links

Following FTP Links
===================

   The rules for FTP are somewhat specific, as it is necessary for them
to be.  To have FTP links followed from HTML documents, you *must*
specify `-f' (`--follow-ftp').  If you do that, FTP links will span
hosts even if `-H' is not set.  Option `--relative-only' (`-L') has no
effect on FTP whatsoever.

   However, domain acceptance (`-D') and suffix rules (`-A'/`-R') apply
normally.


File: wget.info,  Node: Startup File,  Next: Examples,  Prev: Following Links,  Up: Top

Startup File
************

   Once you know how to change default settings of Wget through command
line arguments, you may wish to make some of those settings permanent.
You can do that in a convenient way by creating the Wget startup file
-- `.wgetrc'.

   Wget recognizes a limited set of wgetrc commands and reads them upon
startup.

* Menu:

* Wgetrc Location::   Location of various wgetrc files.
* Wgetrc Syntax::     Syntax of wgetrc.
* Wgetrc Commands::   List of available commands.
* Sample Wgetrc::     A wgetrc example.


File: wget.info,  Node: Wgetrc Location,  Next: Wgetrc Syntax,  Prev: Startup File,  Up: Startup File

Wgetrc Location
===============

   When initializing, Wget will look for a "global" startup file,
`/usr/local/lib/wgetrc' by default (or some prefix other than
`/usr/local', if Wget was not installed there) and read commands from
there, if it exists.

   Then it will look for the user's file.  If the environmental variable
WGETRC is set, Wget will try to load that file.  Failing that, no
further attempts will be made.

   If WGETRC is not set, Wget will try to load `$HOME/.wgetrc'.

   The fact that user's settings are loaded after the system-wide ones
means that in case of collision user's wgetrc *overrides* the
system-wide wgetrc (in `/usr/local/lib/wgetrc' by default).

