1 \input texinfo @c -*-texinfo-*-
5 @settitle GNU Wget Manual
6 @c Disable the monstrous rectangles beside overfull hbox-es.
8 @c Use `odd' to print double-sided.
13 @c Remove this if you don't use A4 paper.
17 @c This should really be auto-generated!
18 @set VERSION 1.5.3+dev
21 @dircategory Net Utilities
22 @dircategory World Wide Web
24 * Wget: (wget). The non-interactive network downloader.
28 This file documents the the GNU Wget utility for downloading network
31 Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
33 Permission is granted to make and distribute verbatim copies of
34 this manual provided the copyright notice and this permission notice
35 are preserved on all copies.
38 Permission is granted to process this file through TeX and print the
39 results, provided the printed document carries a copying permission
40 notice identical to this one except for the removal of this paragraph
41 (this paragraph not being relevant to the printed manual).
43 Permission is granted to copy and distribute modified versions of this
44 manual under the conditions for verbatim copying, provided also that the
45 sections entitled ``Copying'' and ``GNU General Public License'' are
46 included exactly as in the original, and provided that the entire
47 resulting derived work is distributed under the terms of a permission
48 notice identical to this one.
53 @subtitle The noninteractive downloading utility
54 @subtitle Updated for Wget @value{VERSION}, @value{UPDATED}
55 @author by Hrvoje Nik@v{s}i@'{c} and the developers
58 @vskip 0pt plus 1filll
59 Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc.
61 Permission is granted to make and distribute verbatim copies of this
62 manual provided the copyright notice and this permission notice are
63 preserved on all copies.
65 Permission is granted to copy and distribute modified versions of this
66 manual under the conditions for verbatim copying, provided also that the
67 sections entitled ``Copying'' and ``GNU General Public License'' are
68 included exactly as in the original, and provided that the entire
69 resulting derived work is distributed under the terms of a permission
70 notice identical to this one.
72 Permission is granted to copy and distribute translations of this manual
73 into another language, under the above conditions for modified versions,
74 except that this permission notice may be stated in a translation
75 approved by the Free Software Foundation.
79 @node Top, Overview, (dir), (dir)
80 @top Wget @value{VERSION}
82 This manual documents version @value{VERSION} of GNU Wget, the freely
83 available utility for network download.
85 Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc.
88 * Overview:: Features of Wget.
89 * Invoking:: Wget command-line arguments.
90 * Recursive Retrieval:: Description of recursive retrieval.
91 * Following Links:: The available methods of chasing links.
92 * Time-Stamping:: Mirroring according to time-stamps.
93 * Startup File:: Wget's initialization file.
94 * Examples:: Examples of usage.
95 * Various:: The stuff that doesn't fit anywhere else.
96 * Appendices:: Some useful references.
97 * Copying:: You may give out copies of Wget.
98 * Concept Index:: Topics covered by this manual.
102 @node Overview, Invoking, Top, Top
107 GNU Wget is a freely available network utility to retrieve files from
108 the World Wide Web, using @sc{http} (Hyper Text Transfer Protocol) and
109 @sc{ftp} (File Transfer Protocol), the two most widely used Internet
110 protocols. It has many useful features to make downloading easier, some
115 Wget is non-interactive, meaning that it can work in the background,
116 while the user is not logged on. This allows you to start a retrieval
117 and disconnect from the system, letting Wget finish the work. By
118 contrast, most of the Web browsers require constant user's presence,
119 which can be a great hindrance when transferring a lot of data.
123 Wget is capable of descending recursively through the structure of
124 @sc{html} documents and @sc{ftp} directory trees, making a local copy of
125 the directory hierarchy similar to the one on the remote server. This
126 feature can be used to mirror archives and home pages, or traverse the
127 web in search of data, like a @sc{www} robot (@xref{Robots}). In that
128 spirit, Wget understands the @code{norobots} convention.
132 File name wildcard matching and recursive mirroring of directories are
133 available when retrieving via @sc{ftp}. Wget can read the time-stamp
134 information given by both @sc{http} and @sc{ftp} servers, and store it
135 locally. Thus Wget can see if the remote file has changed since last
136 retrieval, and automatically retrieve the new version if it has. This
137 makes Wget suitable for mirroring of @sc{ftp} sites, as well as home
142 Wget works exceedingly well on slow or unstable connections,
143 retrying the document until it is fully retrieved, or until a
144 user-specified retry count is surpassed. It will try to resume the
145 download from the point of interruption, using @code{REST} with @sc{ftp}
146 and @code{Range} with @sc{http} servers that support them.
150 By default, Wget supports proxy servers, which can lighten the network
151 load, speed up retrieval and provide access behind firewalls. However,
152 if you are behind a firewall that requires that you use a socks style
153 gateway, you can get the socks library and build wget with support for
154 socks. Wget also supports the passive @sc{ftp} downloading as an
159 Builtin features offer mechanisms to tune which links you wish to follow
160 (@xref{Following Links}).
164 The retrieval is conveniently traced with printing dots, each dot
165 representing a fixed amount of data received (1KB by default). These
166 representations can be customized to your preferences.
170 Most of the features are fully configurable, either through command line
171 options, or via the initialization file @file{.wgetrc} (@xref{Startup
172 File}). Wget allows you to define @dfn{global} startup files
173 (@file{/usr/local/etc/wgetrc} by default) for site settings.
177 Finally, GNU Wget is free software. This means that everyone may use
178 it, redistribute it and/or modify it under the terms of the GNU General
179 Public License, as published by the Free Software Foundation
183 @node Invoking, Recursive Retrieval, Overview, Top
190 By default, Wget is very simple to invoke. The basic syntax is:
193 wget [@var{option}]@dots{} [@var{URL}]@dots{}
196 Wget will simply download all the @sc{url}s specified on the command
197 line. @var{URL} is a @dfn{Uniform Resource Locator}, as defined below.
199 However, you may wish to change some of the default parameters of
200 Wget. You can do it two ways: permanently, adding the appropriate
201 command to @file{.wgetrc} (@xref{Startup File}), or specifying it on
207 * Basic Startup Options::
208 * Logging and Input File Options::
210 * Directory Options::
213 * Recursive Retrieval Options::
214 * Recursive Accept/Reject Options::
217 @node URL Format, Option Syntax, Invoking, Invoking
222 @dfn{URL} is an acronym for Uniform Resource Locator. A uniform
223 resource locator is a compact string representation for a resource
224 available via the Internet. Wget recognizes the @sc{url} syntax as per
225 @sc{rfc1738}. This is the most widely used form (square brackets denote
229 http://host[:port]/directory/file
230 ftp://host[:port]/directory/file
233 You can also encode your username and password within a @sc{url}:
236 ftp://user:password@@host/path
237 http://user:password@@host/path
240 Either @var{user} or @var{password}, or both, may be left out. If you
241 leave out either the @sc{http} username or password, no authentication
242 will be sent. If you leave out the @sc{ftp} username, @samp{anonymous}
243 will be used. If you leave out the @sc{ftp} password, your email
244 address will be supplied as a default password.@footnote{If you have a
245 @file{.netrc} file in your home directory, password will also be
248 You can encode unsafe characters in a @sc{url} as @samp{%xy}, @code{xy}
249 being the hexadecimal representation of the character's @sc{ascii}
250 value. Some common unsafe characters include @samp{%} (quoted as
251 @samp{%25}), @samp{:} (quoted as @samp{%3A}), and @samp{@@} (quoted as
252 @samp{%40}). Refer to @sc{rfc1738} for a comprehensive list of unsafe
255 Wget also supports the @code{type} feature for @sc{ftp} @sc{url}s. By
256 default, @sc{ftp} documents are retrieved in the binary mode (type
257 @samp{i}), which means that they are downloaded unchanged. Another
258 useful mode is the @samp{a} (@dfn{ASCII}) mode, which converts the line
259 delimiters between the different operating systems, and is thus useful
260 for text files. Here is an example:
263 ftp://host/directory/file;type=a
266 Two alternative variants of @sc{url} specification are also supported,
267 because of historical (hysterical?) reasons and their widespreaded use.
269 @sc{ftp}-only syntax (supported by @code{NcFTP}):
274 @sc{http}-only syntax (introduced by @code{Netscape}):
279 These two alternative forms are deprecated, and may cease being
280 supported in the future.
282 If you do not understand the difference between these notations, or do
283 not know which one to use, just use the plain ordinary format you use
284 with your favorite browser, like @code{Lynx} or @code{Netscape}.
286 @node Option Syntax, Basic Startup Options, URL Format, Invoking
287 @section Option Syntax
288 @cindex option syntax
289 @cindex syntax of options
291 Since Wget uses GNU getopts to process its arguments, every option has a
292 short form and a long form. Long options are more convenient to
293 remember, but take time to type. You may freely mix different option
294 styles, or specify options after the command-line arguments. Thus you
298 wget -r --tries=10 http://fly.cc.fer.hr/ -o log
301 The space between the option accepting an argument and the argument may
302 be omitted. Instead @samp{-o log} you can write @samp{-olog}.
304 You may put several options that do not require arguments together,
311 This is a complete equivalent of:
314 wget -d -r -c @var{URL}
317 Since the options can be specified after the arguments, you may
318 terminate them with @samp{--}. So the following will try to download
319 @sc{url} @samp{-x}, reporting failure to @file{log}:
325 The options that accept comma-separated lists all respect the convention
326 that specifying an empty list clears its value. This can be useful to
327 clear the @file{.wgetrc} settings. For instance, if your @file{.wgetrc}
328 sets @code{exclude_directories} to @file{/cgi-bin}, the following
329 example will first reset it, and then set it to exclude @file{/~nobody}
330 and @file{/~somebody}. You can also clear the lists in @file{.wgetrc}
331 (@xref{Wgetrc Syntax}).
334 wget -X '' -X /~nobody,/~somebody
337 @node Basic Startup Options, Logging and Input File Options, Option Syntax, Invoking
338 @section Basic Startup Options
343 Display the version of Wget.
347 Print a help message describing all of Wget's command-line options.
351 Go to background immediately after startup. If no output file is
352 specified via the @samp{-o}, output is redirected to @file{wget-log}.
354 @cindex execute wgetrc command
355 @item -e @var{command}
356 @itemx --execute @var{command}
357 Execute @var{command} as if it were a part of @file{.wgetrc}
358 (@xref{Startup File}). A command thus invoked will be executed
359 @emph{after} the commands in @file{.wgetrc}, thus taking precedence over
363 @node Logging and Input File Options, Download Options, Basic Startup Options, Invoking
364 @section Logging and Input File Options
369 @item -o @var{logfile}
370 @itemx --output-file=@var{logfile}
371 Log all messages to @var{logfile}. The messages are normally reported
374 @cindex append to log
375 @item -a @var{logfile}
376 @itemx --append-output=@var{logfile}
377 Append to @var{logfile}. This is the same as @samp{-o}, only it appends
378 to @var{logfile} instead of overwriting the old log file. If
379 @var{logfile} does not exist, a new file is created.
384 Turn on debug output, meaning various information important to the
385 developers of Wget if it does not work properly. Your system
386 administrator may have chosen to compile Wget without debug support, in
387 which case @samp{-d} will not work. Please note that compiling with
388 debug support is always safe---Wget compiled with the debug support will
389 @emph{not} print any debug info unless requested with @samp{-d}.
390 @xref{Reporting Bugs} for more information on how to use @samp{-d} for
396 Turn off Wget's output.
401 Turn on verbose output, with all the available data. The default output
406 Non-verbose output---turn off verbose without being completely quiet
407 (use @samp{-q} for that), which means that error messages and basic
408 information still get printed.
412 @itemx --input-file=@var{file}
413 Read @sc{url}s from @var{file}, in which case no @sc{url}s need to be on
414 the command line. If there are @sc{url}s both on the command line and
415 in an input file, those on the command lines will be the first ones to
416 be retrieved. The @var{file} need not be an @sc{html} document (but no
417 harm if it is)---it is enough if the @sc{url}s are just listed
420 However, if you specify @samp{--force-html}, the document will be
421 regarded as @samp{html}. In that case you may have problems with
422 relative links, which you can solve either by adding @code{<base
423 href="@var{url}">} to the documents or by specifying
424 @samp{--base=@var{url}} on the command line.
429 When input is read from a file, force it to be treated as an @sc{html}
430 file. This enables you to retrieve relative links from existing
431 @sc{html} files on your local disk, by adding @code{<base
432 href="@var{url}">} to @sc{html}, or using the @samp{--base} command-line
436 @node Download Options, Directory Options, Logging and Input File Options, Invoking
437 @section Download Options
442 @cindex number of retries
443 @item -t @var{number}
444 @itemx --tries=@var{number}
445 Set number of retries to @var{number}. Specify 0 or @samp{inf} for
449 @itemx --output-document=@var{file}
450 The documents will not be written to the appropriate files, but all will
451 be concatenated together and written to @var{file}. If @var{file}
452 already exists, it will be overwritten. If the @var{file} is @samp{-},
453 the documents will be written to standard output. Including this option
454 automatically sets the number of tries to 1.
459 Do not clobber existing files when saving to directory hierarchy within
460 recursive retrieval of several files. This option is @emph{extremely}
461 useful when you wish to continue where you left off with retrieval of
462 many files. If the files have the @samp{.html} or (yuck) @samp{.htm}
463 suffix, they will be loaded from the local disk, and parsed as if they
464 have been retrieved from the Web.
466 @cindex continue retrieval
469 Continue getting an existing file. This is useful when you want to
470 finish up the download started by another program, or a previous
471 instance of Wget. Thus you can write:
474 wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
477 If there is a file name @file{ls-lR.Z} in the current directory, Wget
478 will assume that it is the first portion of the remote file, and will
479 require the server to continue the retrieval from an offset equal to the
480 length of the local file.
482 Note that you need not specify this option if all you want is Wget to
483 continue retrieving where it left off when the connection is lost---Wget
484 does this by default. You need this option only when you want to
485 continue retrieval of a file already halfway retrieved, saved by another
486 @sc{ftp} client, or left by Wget being killed.
488 Without @samp{-c}, the previous example would just begin to download the
489 remote file to @file{ls-lR.Z.1}. The @samp{-c} option is also
490 applicable for @sc{http} servers that support the @code{Range} header.
493 @cindex retrieval tracing style
494 @item --dot-style=@var{style}
495 Set the retrieval style to @var{style}. Wget traces the retrieval of
496 each document by printing dots on the screen, each dot representing a
497 fixed amount of retrieved data. Any number of dots may be separated in
498 a @dfn{cluster}, to make counting easier. This option allows you to
499 choose one of the pre-defined styles, determining the number of bytes
500 represented by a dot, the number of dots in a cluster, and the number of
503 With the @code{default} style each dot represents 1K, there are ten dots
504 in a cluster and 50 dots in a line. The @code{binary} style has a more
505 ``computer''-like orientation---8K dots, 16-dots clusters and 48 dots
506 per line (which makes for 384K lines). The @code{mega} style is
507 suitable for downloading very large files---each dot represents 64K
508 retrieved, there are eight dots in a cluster, and 48 dots on each line
509 (so each line contains 3M). The @code{micro} style is exactly the
510 reverse; it is suitable for downloading small files, with 128-byte dots,
511 8 dots per cluster, and 48 dots (6K) per line.
514 @itemx --timestamping
515 Turn on time-stamping. @xref{Time-Stamping} for details.
517 @cindex server response, print
519 @itemx --server-response
520 Print the headers sent by @sc{http} servers and responses sent by
523 @cindex Wget as spider
526 When invoked with this option, Wget will behave as a Web @dfn{spider},
527 which means that it will not download the pages, just check that they
528 are there. You can use it to check your bookmarks, e.g. with:
531 wget --spider --force-html -i bookmarks.html
534 This feature needs much more work for Wget to get close to the
535 functionality of real @sc{www} spiders.
539 @itemx --timeout=@var{seconds}
540 Set the read timeout to @var{seconds} seconds. Whenever a network read
541 is issued, the file descriptor is checked for a timeout, which could
542 otherwise leave a pending connection (uninterrupted read). The default
543 timeout is 900 seconds (fifteen minutes). Setting timeout to 0 will
544 disable checking for timeouts.
546 Please do not lower the default timeout value with this option unless
547 you know what you are doing.
551 @item -w @var{seconds}
552 @itemx --wait=@var{seconds}
553 Wait the specified number of seconds between the retrievals. Use of
554 this option is recommended, as it lightens the server load by making the
555 requests less frequent. Instead of in seconds, the time can be
556 specified in minutes using the @code{m} suffix, in hours using @code{h}
557 suffix, or in days using @code{d} suffix.
559 Specifying a large value for this option is useful if the network or the
560 destination host is down, so that Wget can wait long enough to
561 reasonably expect the network error to be fixed before the retry.
565 @itemx --proxy=on/off
566 Turn proxy support on or off. The proxy is on by default if the
567 appropriate environmental variable is defined.
571 @itemx --quota=@var{quota}
572 Specify download quota for automatic retrievals. The value can be
573 specified in bytes (default), kilobytes (with @samp{k} suffix), or
574 megabytes (with @samp{m} suffix).
576 Note that quota will never affect downloading a single file. So if you
577 specify @samp{wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz}, all of the
578 @file{ls-lR.gz} will be downloaded. The same goes even when several
579 @sc{url}s are specified on the command-line. However, quota is
580 respected when retrieving either recursively, or from an input file.
581 Thus you may safely type @samp{wget -Q2m -i sites}---download will be
582 aborted when the quota is exceeded.
584 Setting quota to 0 or to @samp{inf} unlimits the download quota.
587 @node Directory Options, HTTP Options, Download Options, Invoking
588 @section Directory Options
592 @itemx --no-directories
593 Do not create a hierarchy of directories when retrieving
594 recursively. With this option turned on, all files will get saved to the
595 current directory, without clobbering (if a name shows up more than
596 once, the filenames will get extensions @samp{.n}).
599 @itemx --force-directories
600 The opposite of @samp{-nd}---create a hierarchy of directories, even if
601 one would not have been created otherwise. E.g. @samp{wget -x
602 http://fly.cc.fer.hr/robots.txt} will save the downloaded file to
603 @file{fly.cc.fer.hr/robots.txt}.
606 @itemx --no-host-directories
607 Disable generation of host-prefixed directories. By default, invoking
608 Wget with @samp{-r http://fly.cc.fer.hr/} will create a structure of
609 directories beginning with @file{fly.cc.fer.hr/}. This option disables
612 @cindex cut directories
613 @item --cut-dirs=@var{number}
614 Ignore @var{number} directory components. This is useful for getting a
615 fine-grained control over the directory where recursive retrieval will
618 Take, for example, the directory at
619 @samp{ftp://ftp.xemacs.org/pub/xemacs/}. If you retrieve it with
620 @samp{-r}, it will be saved locally under
621 @file{ftp.xemacs.org/pub/xemacs/}. While the @samp{-nH} option can
622 remove the @file{ftp.xemacs.org/} part, you are still stuck with
623 @file{pub/xemacs}. This is where @samp{--cut-dirs} comes in handy; it
624 makes Wget not ``see'' @var{number} remote directory components. Here
625 are several examples of how @samp{--cut-dirs} option works.
629 No options -> ftp.xemacs.org/pub/xemacs/
631 -nH --cut-dirs=1 -> xemacs/
632 -nH --cut-dirs=2 -> .
634 --cut-dirs=1 -> ftp.xemacs.org/xemacs/
639 If you just want to get rid of the directory structure, this option is
640 similar to a combination of @samp{-nd} and @samp{-P}. However, unlike
641 @samp{-nd}, @samp{--cut-dirs} does not lose with subdirectories---for
642 instance, with @samp{-nH --cut-dirs=1}, a @file{beta/} subdirectory will
643 be placed to @file{xemacs/beta}, as one would expect.
645 @cindex directory prefix
646 @item -P @var{prefix}
647 @itemx --directory-prefix=@var{prefix}
648 Set directory prefix to @var{prefix}. The @dfn{directory prefix} is the
649 directory where all other files and subdirectories will be saved to,
650 i.e. the top of the retrieval tree. The default is @samp{.} (the
654 @node HTTP Options, FTP Options, Directory Options, Invoking
655 @section HTTP Options
659 @cindex http password
660 @cindex authentication
661 @item --http-user=@var{user}
662 @itemx --http-passwd=@var{password}
663 Specify the username @var{user} and password @var{password} on an
664 @sc{http} server. According to the type of the challenge, Wget will
665 encode them using either the @code{basic} (insecure) or the
666 @code{digest} authentication scheme.
668 Another way to specify username and password is in the @sc{url} itself
669 (@xref{URL Format}). For more information about security issues with
670 Wget, @xref{Security Considerations}.
675 @itemx --cache=on/off
676 When set to off, disable server-side cache. In this case, Wget will
677 send the remote server an appropriate directive (@samp{Pragma:
678 no-cache}) to get the file from the remote service, rather than
679 returning the cached version. This is especially useful for retrieving
680 and flushing out-of-date documents on proxy servers.
682 Caching is allowed by default.
684 @cindex Content-Length, ignore
685 @cindex ignore length
686 @item --ignore-length
687 Unfortunately, some @sc{http} servers (@sc{cgi} programs, to be more
688 precise) send out bogus @code{Content-Length} headers, which makes Wget
689 go wild, as it thinks not all the document was retrieved. You can spot
690 this syndrome if Wget retries getting the same document again and again,
691 each time claiming that the (otherwise normal) connection has closed on
694 With this option, Wget will ignore the @code{Content-Length} header---as
698 @item --header=@var{additional-header}
699 Define an @var{additional-header} to be passed to the @sc{http} servers.
700 Headers must contain a @samp{:} preceded by one or more non-blank
701 characters, and must not contain newlines.
703 You may define more than one additional header by specifying
704 @samp{--header} more than once.
708 wget --header='Accept-Charset: iso-8859-2' \
709 --header='Accept-Language: hr' \
710 http://fly.cc.fer.hr/
714 Specification of an empty string as the header value will clear all
715 previous user-defined headers.
718 @cindex proxy password
719 @cindex proxy authentication
720 @item --proxy-user=@var{user}
721 @itemx --proxy-passwd=@var{password}
722 Specify the username @var{user} and password @var{password} for
723 authentication on a proxy server. Wget will encode them using the
724 @code{basic} authentication scheme.
726 @cindex server response, save
728 @itemx --save-headers
729 Save the headers sent by the @sc{http} server to the file, preceding the
730 actual contents, with an empty line as the separator.
733 @item -U @var{agent-string}
734 @itemx --user-agent=@var{agent-string}
735 Identify as @var{agent-string} to the @sc{http} server.
737 The @sc{http} protocol allows the clients to identify themselves using a
738 @code{User-Agent} header field. This enables distinguishing the
739 @sc{www} software, usually for statistical purposes or for tracing of
740 protocol violations. Wget normally identifies as
741 @samp{Wget/@var{version}}, @var{version} being the current version
744 However, some sites have been known to impose the policy of tailoring
745 the output according to the @code{User-Agent}-supplied information.
746 While conceptually this is not such a bad idea, it has been abused by
747 servers denying information to clients other than @code{Mozilla} or
748 Microsoft @code{Internet Explorer}. This option allows you to change
749 the @code{User-Agent} line issued by Wget. Use of this option is
750 discouraged, unless you really know what you are doing.
752 @strong{NOTE} that Netscape Communications Corp. has claimed that false
753 transmissions of @samp{Mozilla} as the @code{User-Agent} are a copyright
754 infringement, which will be prosecuted. @strong{DO NOT} misrepresent
758 @node FTP Options, Recursive Retrieval Options, HTTP Options, Invoking
762 @cindex retrieve symbolic links
763 @item --retr-symlinks
764 Retrieve symbolic links on @sc{ftp} sites as if they were plain files,
765 i.e. don't just create links locally.
767 @cindex globbing, toggle
770 Turn @sc{ftp} globbing on or off. Globbing means you may use the
771 shell-like special characters (@dfn{wildcards}), like @samp{*},
772 @samp{?}, @samp{[} and @samp{]} to retrieve more than one file from the
773 same directory at once, like:
776 wget ftp://gnjilux.cc.fer.hr/*.msg
779 By default, globbing will be turned on if the @sc{url} contains a
780 globbing character. This option may be used to turn globbing on or off
783 You may have to quote the @sc{url} to protect it from being expanded by
784 your shell. Globbing makes Wget look for a directory listing, which is
785 system-specific. This is why it currently works only with Unix @sc{ftp}
786 servers (and the ones emulating Unix @code{ls} output).
790 Use the @dfn{passive} @sc{ftp} retrieval scheme, in which the client
791 initiates the data connection. This is sometimes required for @sc{ftp}
792 to work behind firewalls.
795 @node Recursive Retrieval Options, Recursive Accept/Reject Options, FTP Options, Invoking
796 @section Recursive Retrieval Options
801 Turn on recursive retrieving. @xref{Recursive Retrieval} for more
805 @itemx --level=@var{depth}
806 Specify recursion maximum depth level @var{depth} (@xref{Recursive
807 Retrieval}). The default maximum depth is 5.
809 @cindex proxy filling
810 @cindex delete after retrieval
811 @cindex filling proxy cache
813 This option tells Wget to delete every single file it downloads,
814 @emph{after} having done so. It is useful for pre-fetching popular
815 pages through proxy, e.g.:
818 wget -r -nd --delete-after http://whatever.com/~popular/page/
821 The @samp{-r} option is to retrieve recursively, and @samp{-nd} not to
824 @cindex conversion of links
825 @cindex links conversion
827 @itemx --convert-links
828 Convert the non-relative links to relative ones locally. Only the
829 references to the documents actually downloaded will be converted; the
830 rest will be left unchanged.
832 Note that only at the end of the download can Wget know which links have
833 been downloaded. Because of that, much of the work done by @samp{-k}
834 will be performed at the end of the downloads.
836 @cindex backing up converted files
838 @itemx --backup-converted
839 When converting a file, back up the original version with a @samp{.orig} suffix.
843 Turn on options suitable for mirroring. This option turns on recursion
844 and time-stamping, sets infinite recursion depth and keeps @sc{ftp}
845 directory listings. It is currently equivalent to
846 @samp{-r -N -l inf -nr}.
849 @itemx --dont-remove-listing
850 Don't remove the temporary @file{.listing} files generated by @sc{ftp}
851 retrievals. Normally, these files contain the raw directory listings
852 received from @sc{ftp} servers. Not removing them can be useful to
853 access the full remote file list when running a mirror, or for debugging
857 @node Recursive Accept/Reject Options, , Recursive Retrieval Options, Invoking
858 @section Recursive Accept/Reject Options
861 @item -A @var{acclist} --accept @var{acclist}
862 @itemx -R @var{rejlist} --reject @var{rejlist}
863 Specify comma-separated lists of file name suffixes or patterns to
864 accept or reject (@xref{Types of Files} for more details).
866 @item -D @var{domain-list}
867 @itemx --domains=@var{domain-list}
868 Set domains to be accepted and @sc{dns} looked-up, where
869 @var{domain-list} is a comma-separated list. Note that it does
870 @emph{not} turn on @samp{-H}. This option speeds things up, even if
871 only one host is spanned (@xref{Domain Acceptance}).
873 @item --exclude-domains @var{domain-list}
874 Exclude the domains given in a comma-separated @var{domain-list} from
875 @sc{dns}-lookup (@xref{Domain Acceptance}).
879 Follow relative links only. Useful for retrieving a specific home page
880 without any distractions, not even those from the same hosts
881 (@xref{Relative Links}).
883 @cindex follow FTP links
885 Follow @sc{ftp} links from @sc{html} documents. Without this option,
886 Wget will ignore all the @sc{ftp} links.
890 Enable spanning across hosts when doing recursive retrieving (@xref{All
894 @itemx --include-directories=@var{list}
895 Specify a comma-separated list of directories you wish to follow when
896 downloading (@xref{Directory-Based Limits} for more details.) Elements
897 of @var{list} may contain wildcards.
900 @itemx --exclude-directories=@var{list}
901 Specify a comma-separated list of directories you wish to exclude from
902 download (@xref{Directory-Based Limits} for more details.) Elements of
903 @var{list} may contain wildcards.
906 @itemx --no-host-lookup
907 Disable the time-consuming @sc{dns} lookup of almost all hosts
908 (@xref{Host Checking}).
912 Do not ever ascend to the parent directory when retrieving recursively.
913 This is a useful option, since it guarantees that only the files
914 @emph{below} a certain hierarchy will be downloaded.
915 @xref{Directory-Based Limits} for more details.
918 @node Recursive Retrieval, Following Links, Invoking, Top
919 @chapter Recursive Retrieval
922 @cindex recursive retrieval
924 GNU Wget is capable of traversing parts of the Web (or a single
925 @sc{http} or @sc{ftp} server), depth-first following links and directory
926 structure. This is called @dfn{recursive} retrieving, or
929 With @sc{http} @sc{url}s, Wget retrieves and parses the @sc{html} from
930 the given @sc{url}, documents, retrieving the files the @sc{html}
931 document was referring to, through markups like @code{href}, or
932 @code{src}. If the freshly downloaded file is also of type
933 @code{text/html}, it will be parsed and followed further.
935 The maximum @dfn{depth} to which the retrieval may descend is specified
936 with the @samp{-l} option (the default maximum depth is five layers).
937 @xref{Recursive Retrieval}.
939 When retrieving an @sc{ftp} @sc{url} recursively, Wget will retrieve all
940 the data from the given directory tree (including the subdirectories up
941 to the specified depth) on the remote server, creating its mirror image
942 locally. @sc{ftp} retrieval is also limited by the @code{depth}
945 By default, Wget will create a local directory tree, corresponding to
946 the one found on the remote server.
948 Recursive retrieving can find a number of applications, the most
949 important of which is mirroring. It is also useful for @sc{www}
950 presentations, and any other opportunities where slow network
951 connections should be bypassed by storing the files locally.
953 You should be warned that invoking recursion may cause grave overloading
954 on your system, because of the fast exchange of data through the
955 network; all of this may hamper other users' work. The same stands for
956 the foreign server you are mirroring---the more requests it gets in a
957 rows, the greater is its load.
959 Careless retrieving can also fill your file system uncontrollably, which
960 can grind the machine to a halt.
962 The load can be minimized by lowering the maximum recursion level
963 (@samp{-l}) and/or by lowering the number of retries (@samp{-t}). You
964 may also consider using the @samp{-w} option to slow down your requests
965 to the remote servers, as well as the numerous options to narrow the
966 number of followed links (@xref{Following Links}).
968 Recursive retrieval is a good thing when used properly. Please take all
969 precautions not to wreak havoc through carelessness.
971 @node Following Links, Time-Stamping, Recursive Retrieval, Top
972 @chapter Following Links
974 @cindex following links
976 When retrieving recursively, one does not wish to retrieve the loads of
977 unnecessary data. Most of the time the users bear in mind exactly what
978 they want to download, and want Wget to follow only specific links.
980 For example, if you wish to download the music archive from
981 @samp{fly.cc.fer.hr}, you will not want to download all the home pages
982 that happen to be referenced by an obscure part of the archive.
984 Wget possesses several mechanisms that allows you to fine-tune which
985 links it will follow.
988 * Relative Links:: Follow relative links only.
989 * Host Checking:: Follow links on the same host.
990 * Domain Acceptance:: Check on a list of domains.
991 * All Hosts:: No host restrictions.
992 * Types of Files:: Getting only certain files.
993 * Directory-Based Limits:: Getting only certain directories.
994 * FTP Links:: Following FTP links.
997 @node Relative Links, Host Checking, Following Links, Following Links
998 @section Relative Links
999 @cindex relative links
1001 When only relative links are followed (option @samp{-L}), recursive
1002 retrieving will never span hosts. No time-expensive @sc{dns}-lookups
1003 will be performed, and the process will be very fast, with the minimum
1004 strain of the network. This will suit your needs often, especially when
1005 mirroring the output of various @code{x2html} converters, since they
1006 generally output relative links.
1008 @node Host Checking, Domain Acceptance, Relative Links, Following Links
1009 @section Host Checking
1012 @cindex host checking
1014 The drawback of following the relative links solely is that humans often
1015 tend to mix them with absolute links to the very same host, and the very
1016 same page. In this mode (which is the default mode for following links)
1017 all @sc{url}s that refer to the same host will be retrieved.
1019 The problem with this option are the aliases of the hosts and domains.
1020 Thus there is no way for Wget to know that @samp{regoc.srce.hr} and
1021 @samp{www.srce.hr} are the same host, or that @samp{fly.cc.fer.hr} is
1022 the same as @samp{fly.cc.etf.hr}. Whenever an absolute link is
1023 encountered, the host is @sc{dns}-looked-up with @code{gethostbyname} to
1024 check whether we are maybe dealing with the same hosts. Although the
1025 results of @code{gethostbyname} are cached, it is still a great
1026 slowdown, e.g. when dealing with large indices of home pages on different
1027 hosts (because each of the hosts must be @sc{dns}-resolved to see
1028 whether it just @emph{might} be an alias of the starting host).
1030 To avoid the overhead you may use @samp{-nh}, which will turn off
1031 @sc{dns}-resolving and make Wget compare hosts literally. This will
1032 make things run much faster, but also much less reliable
1033 (e.g. @samp{www.srce.hr} and @samp{regoc.srce.hr} will be flagged as
1036 Note that modern @sc{http} servers allow one IP address to host several
1037 @dfn{virtual servers}, each having its own directory hierarchy. Such
1038 ``servers'' are distinguished by their hostnames (all of which point to
1039 the same IP address); for this to work, a client must send a @code{Host}
1040 header, which is what Wget does. However, in that case Wget @emph{must
1041 not} try to divine a host's ``real'' address, nor try to use the same
1042 hostname for each access, i.e. @samp{-nh} must be turned on.
1044 In other words, the @samp{-nh} option must be used to enable the
1045 retrieval from virtual servers distinguished by their hostnames. As the
1046 number of such server setups grow, the behavior of @samp{-nh} may become
1047 the default in the future.
1049 @node Domain Acceptance, All Hosts, Host Checking, Following Links
1050 @section Domain Acceptance
1052 With the @samp{-D} option you may specify the domains that will be
1053 followed. The hosts the domain of which is not in this list will not be
1054 @sc{dns}-resolved. Thus you can specify @samp{-Dmit.edu} just to make
1055 sure that @strong{nothing outside of @sc{mit} gets looked up}. This is
1056 very important and useful. It also means that @samp{-D} does @emph{not}
1057 imply @samp{-H} (span all hosts), which must be specified explicitly.
1058 Feel free to use this options since it will speed things up, with almost
1059 all the reliability of checking for all hosts. Thus you could invoke
1062 wget -r -D.hr http://fly.cc.fer.hr/
1065 to make sure that only the hosts in @samp{.hr} domain get
1066 @sc{dns}-looked-up for being equal to @samp{fly.cc.fer.hr}. So
1067 @samp{fly.cc.etf.hr} will be checked (only once!) and found equal, but
1068 @samp{www.gnu.ai.mit.edu} will not even be checked.
1070 Of course, domain acceptance can be used to limit the retrieval to
1071 particular domains with spanning of hosts in them, but then you must
1072 specify @samp{-H} explicitly. E.g.:
1075 wget -r -H -Dmit.edu,stanford.edu http://www.mit.edu/
1078 will start with @samp{http://www.mit.edu/}, following links across
1079 @sc{mit} and Stanford.
1081 If there are domains you want to exclude specifically, you can do it
1082 with @samp{--exclude-domains}, which accepts the same type of arguments
1083 of @samp{-D}, but will @emph{exclude} all the listed domains. For
1084 example, if you want to download all the hosts from @samp{foo.edu}
1085 domain, with the exception of @samp{sunsite.foo.edu}, you can do it like
1089 wget -rH -Dfoo.edu --exclude-domains sunsite.foo.edu http://www.foo.edu/
1092 @node All Hosts, Types of Files, Domain Acceptance, Following Links
1097 When @samp{-H} is specified without @samp{-D}, all hosts are freely
1098 spanned. There are no restrictions whatsoever as to what part of the
1099 net Wget will go to fetch documents, other than maximum retrieval depth.
1100 If a page references @samp{www.yahoo.com}, so be it. Such an option is
1101 rarely useful for itself.
1103 @node Types of Files, Directory-Based Limits, All Hosts, Following Links
1104 @section Types of Files
1105 @cindex types of files
1107 When downloading material from the web, you will often want to restrict
1108 the retrieval to only certain file types. For example, if you are
1109 interested in downloading @sc{gif}s, you will not be overjoyed to get
1110 loads of PostScript documents, and vice versa.
1112 Wget offers two options to deal with this problem. Each option
1113 description lists a short name, a long name, and the equivalent command
1116 @cindex accept wildcards
1117 @cindex accept suffixes
1118 @cindex wildcards, accept
1119 @cindex suffixes, accept
1121 @item -A @var{acclist}
1122 @itemx --accept @var{acclist}
1123 @itemx accept = @var{acclist}
1124 The argument to @samp{--accept} option is a list of file suffixes or
1125 patterns that Wget will download during recursive retrieval. A suffix
1126 is the ending part of a file, and consists of ``normal'' letters,
1127 e.g. @samp{gif} or @samp{.jpg}. A matching pattern contains shell-like
1128 wildcards, e.g. @samp{books*} or @samp{zelazny*196[0-9]*}.
1130 So, specifying @samp{wget -A gif,jpg} will make Wget download only the
1131 files ending with @samp{gif} or @samp{jpg}, i.e. @sc{gif}s and
1132 @sc{jpeg}s. On the other hand, @samp{wget -A "zelazny*196[0-9]*"} will
1133 download only files beginning with @samp{zelazny} and containing numbers
1134 from 1960 to 1969 anywhere within. Look up the manual of your shell for
1135 a description of how pattern matching works.
1137 Of course, any number of suffixes and patterns can be combined into a
1138 comma-separated list, and given as an argument to @samp{-A}.
1140 @cindex reject wildcards
1141 @cindex reject suffixes
1142 @cindex wildcards, reject
1143 @cindex suffixes, reject
1144 @item -R @var{rejlist}
1145 @itemx --reject @var{rejlist}
1146 @itemx reject = @var{rejlist}
1147 The @samp{--reject} option works the same way as @samp{--accept}, only
1148 its logic is the reverse; Wget will download all files @emph{except} the
1149 ones matching the suffixes (or patterns) in the list.
1151 So, if you want to download a whole page except for the cumbersome
1152 @sc{mpeg}s and @sc{.au} files, you can use @samp{wget -R mpg,mpeg,au}.
1153 Analogously, to download all files except the ones beginning with
1154 @samp{bjork}, use @samp{wget -R "bjork*"}. The quotes are to prevent
1155 expansion by the shell.
1158 The @samp{-A} and @samp{-R} options may be combined to achieve even
1159 better fine-tuning of which files to retrieve. E.g. @samp{wget -A
1160 "*zelazny*" -R .ps} will download all the files having @samp{zelazny} as
1161 a part of their name, but @emph{not} the PostScript files.
1163 Note that these two options do not affect the downloading of @sc{html}
1164 files; Wget must load all the @sc{html}s to know where to go at
1165 all---recursive retrieval would make no sense otherwise.
1167 @node Directory-Based Limits, FTP Links, Types of Files, Following Links
1168 @section Directory-Based Limits
1170 @cindex directory limits
1172 Regardless of other link-following facilities, it is often useful to
1173 place the restriction of what files to retrieve based on the directories
1174 those files are placed in. There can be many reasons for this---the
1175 home pages may be organized in a reasonable directory structure; or some
1176 directories may contain useless information, e.g. @file{/cgi-bin} or
1177 @file{/dev} directories.
1179 Wget offers three different options to deal with this requirement. Each
1180 option description lists a short name, a long name, and the equivalent
1181 command in @file{.wgetrc}.
1183 @cindex directories, include
1184 @cindex include directories
1185 @cindex accept directories
1188 @itemx --include @var{list}
1189 @itemx include_directories = @var{list}
1190 @samp{-I} option accepts a comma-separated list of directories included
1191 in the retrieval. Any other directories will simply be ignored. The
1192 directories are absolute paths.
1194 So, if you wish to download from @samp{http://host/people/bozo/}
1195 following only links to bozo's colleagues in the @file{/people}
1196 directory and the bogus scripts in @file{/cgi-bin}, you can specify:
1199 wget -I /people,/cgi-bin http://host/people/bozo/
1202 @cindex directories, exclude
1203 @cindex exclude directories
1204 @cindex reject directories
1206 @itemx --exclude @var{list}
1207 @itemx exclude_directories = @var{list}
1208 @samp{-X} option is exactly the reverse of @samp{-I}---this is a list of
1209 directories @emph{excluded} from the download. E.g. if you do not want
1210 Wget to download things from @file{/cgi-bin} directory, specify @samp{-X
1211 /cgi-bin} on the command line.
1213 The same as with @samp{-A}/@samp{-R}, these two options can be combined
1214 to get a better fine-tuning of downloading subdirectories. E.g. if you
1215 want to load all the files from @file{/pub} hierarchy except for
1216 @file{/pub/worthless}, specify @samp{-I/pub -X/pub/worthless}.
1221 @itemx no_parent = on
1222 The simplest, and often very useful way of limiting directories is
1223 disallowing retrieval of the links that refer to the hierarchy
1224 @dfn{above} than the beginning directory, i.e. disallowing ascent to the
1225 parent directory/directories.
1227 The @samp{--no-parent} option (short @samp{-np}) is useful in this case.
1228 Using it guarantees that you will never leave the existing hierarchy.
1229 Supposing you issue Wget with:
1232 wget -r --no-parent http://somehost/~luzer/my-archive/
1235 You may rest assured that none of the references to
1236 @file{/~his-girls-homepage/} or @file{/~luzer/all-my-mpegs/} will be
1237 followed. Only the archive you are interested in will be downloaded.
1238 Essentially, @samp{--no-parent} is similar to
1239 @samp{-I/~luzer/my-archive}, only it handles redirections in a more
1240 intelligent fashion.
1243 @node FTP Links, , Directory-Based Limits, Following Links
1244 @section Following FTP Links
1245 @cindex following ftp links
1247 The rules for @sc{ftp} are somewhat specific, as it is necessary for
1248 them to be. @sc{ftp} links in @sc{html} documents are often included
1249 for purposes of reference, and it is often inconvenient to download them
1252 To have @sc{ftp} links followed from @sc{html} documents, you need to
1253 specify the @samp{--follow-ftp} option. Having done that, @sc{ftp}
1254 links will span hosts regardless of @samp{-H} setting. This is logical,
1255 as @sc{ftp} links rarely point to the same host where the @sc{http}
1256 server resides. For similar reasons, the @samp{-L} options has no
1257 effect on such downloads. On the other hand, domain acceptance
1258 (@samp{-D}) and suffix rules (@samp{-A} and @samp{-R}) apply normally.
1260 Also note that followed links to @sc{ftp} directories will not be
1261 retrieved recursively further.
1263 @node Time-Stamping, Startup File, Following Links, Top
1264 @chapter Time-Stamping
1265 @cindex time-stamping
1266 @cindex timestamping
1267 @cindex updating the archives
1268 @cindex incremental updating
1270 One of the most important aspects of mirroring information from the
1271 Internet is updating your archives.
1273 Downloading the whole archive again and again, just to replace a few
1274 changed files is expensive, both in terms of wasted bandwidth and money,
1275 and the time to do the update. This is why all the mirroring tools
1276 offer the option of incremental updating.
1278 Such an updating mechanism means that the remote server is scanned in
1279 search of @dfn{new} files. Only those new files will be downloaded in
1280 the place of the old ones.
1282 A file is considered new if one of these two conditions are met:
1286 A file of that name does not already exist locally.
1289 A file of that name does exist, but the remote file was modified more
1290 recently than the local file.
1293 To implement this, the program needs to be aware of the time of last
1294 modification of both remote and local files. Such information are
1295 called the @dfn{time-stamps}.
1297 The time-stamping in GNU Wget is turned on using @samp{--timestamping}
1298 (@samp{-N}) option, or through @code{timestamping = on} directive in
1299 @file{.wgetrc}. With this option, for each file it intends to download,
1300 Wget will check whether a local file of the same name exists. If it
1301 does, and the remote file is older, Wget will not download it.
1303 If the local file does not exist, or the sizes of the files do not
1304 match, Wget will download the remote file no matter what the time-stamps
1308 * Time-Stamping Usage::
1309 * HTTP Time-Stamping Internals::
1310 * FTP Time-Stamping Internals::
1313 @node Time-Stamping Usage, HTTP Time-Stamping Internals, Time-Stamping, Time-Stamping
1314 @section Time-Stamping Usage
1315 @cindex time-stamping usage
1316 @cindex usage, time-stamping
1318 The usage of time-stamping is simple. Say you would like to download a
1319 file so that it keeps its date of modification.
1322 wget -S http://www.gnu.ai.mit.edu/
1325 A simple @code{ls -l} shows that the time stamp on the local file equals
1326 the state of the @code{Last-Modified} header, as returned by the server.
1327 As you can see, the time-stamping info is preserved locally, even
1330 Several days later, you would like Wget to check if the remote file has
1331 changed, and download it if it has.
1334 wget -N http://www.gnu.ai.mit.edu/
1337 Wget will ask the server for the last-modified date. If the local file
1338 is newer, the remote file will not be re-fetched. However, if the remote
1339 file is more recent, Wget will proceed fetching it normally.
1341 The same goes for @sc{ftp}. For example:
1344 wget ftp://ftp.ifi.uio.no/pub/emacs/gnus/*
1347 @code{ls} will show that the timestamps are set according to the state
1348 on the remote server. Reissuing the command with @samp{-N} will make
1349 Wget re-fetch @emph{only} the files that have been modified.
1351 In both @sc{http} and @sc{ftp} retrieval Wget will time-stamp the local
1352 file correctly (with or without @samp{-N}) if it gets the stamps,
1353 i.e. gets the directory listing for @sc{ftp} or the @code{Last-Modified}
1354 header for @sc{http}.
1356 If you wished to mirror the GNU archive every week, you would use the
1357 following command every week:
1360 wget --timestamping -r ftp://prep.ai.mit.edu/pub/gnu/
1363 @node HTTP Time-Stamping Internals, FTP Time-Stamping Internals, Time-Stamping Usage, Time-Stamping
1364 @section HTTP Time-Stamping Internals
1365 @cindex http time-stamping
1367 Time-stamping in @sc{http} is implemented by checking of the
1368 @code{Last-Modified} header. If you wish to retrieve the file
1369 @file{foo.html} through @sc{http}, Wget will check whether
1370 @file{foo.html} exists locally. If it doesn't, @file{foo.html} will be
1371 retrieved unconditionally.
1373 If the file does exist locally, Wget will first check its local
1374 time-stamp (similar to the way @code{ls -l} checks it), and then send a
1375 @code{HEAD} request to the remote server, demanding the information on
1378 The @code{Last-Modified} header is examined to find which file was
1379 modified more recently (which makes it ``newer''). If the remote file
1380 is newer, it will be downloaded; if it is older, Wget will give
1381 up.@footnote{As an additional check, Wget will look at the
1382 @code{Content-Length} header, and compare the sizes; if they are not the
1383 same, the remote file will be downloaded no matter what the time-stamp
1386 When @samp{--backup-converted} (@samp{-K}) is specified in conjunction
1387 with @samp{-N}, server file @samp{@var{X}} is compared to local file
1388 @samp{@var{X}.orig}, if extant, rather than being compared to local file
1389 @samp{@var{X}}, which will always differ if it's been converted by
1390 @samp{--convert-links} (@samp{-k}).
1392 Arguably, @sc{http} time-stamping should be implemented using the
1393 @code{If-Modified-Since} request.
1395 @node FTP Time-Stamping Internals, , HTTP Time-Stamping Internals, Time-Stamping
1396 @section FTP Time-Stamping Internals
1397 @cindex ftp time-stamping
1399 In theory, @sc{ftp} time-stamping works much the same as @sc{http}, only
1400 @sc{ftp} has no headers---time-stamps must be received from the
1403 For each directory files must be retrieved from, Wget will use the
1404 @code{LIST} command to get the listing. It will try to analyze the
1405 listing, assuming that it is a Unix @code{ls -l} listing, and extract
1406 the time-stamps. The rest is exactly the same as for @sc{http}.
1408 Assumption that every directory listing is a Unix-style listing may
1409 sound extremely constraining, but in practice it is not, as many
1410 non-Unix @sc{ftp} servers use the Unixoid listing format because most
1411 (all?) of the clients understand it. Bear in mind that @sc{rfc959}
1412 defines no standard way to get a file list, let alone the time-stamps.
1413 We can only hope that a future standard will define this.
1415 Another non-standard solution includes the use of @code{MDTM} command
1416 that is supported by some @sc{ftp} servers (including the popular
1417 @code{wu-ftpd}), which returns the exact time of the specified file.
1418 Wget may support this command in the future.
1420 @node Startup File, Examples, Time-Stamping, Top
1421 @chapter Startup File
1422 @cindex startup file
1428 Once you know how to change default settings of Wget through command
1429 line arguments, you may wish to make some of those settings permanent.
1430 You can do that in a convenient way by creating the Wget startup
1431 file---@file{.wgetrc}.
1433 Besides @file{.wgetrc} is the ``main'' initialization file, it is
1434 convenient to have a special facility for storing passwords. Thus Wget
1435 reads and interprets the contents of @file{$HOME/.netrc}, if it finds
1436 it. You can find @file{.netrc} format in your system manuals.
1438 Wget reads @file{.wgetrc} upon startup, recognizing a limited set of
1442 * Wgetrc Location:: Location of various wgetrc files.
1443 * Wgetrc Syntax:: Syntax of wgetrc.
1444 * Wgetrc Commands:: List of available commands.
1445 * Sample Wgetrc:: A wgetrc example.
1448 @node Wgetrc Location, Wgetrc Syntax, Startup File, Startup File
1449 @section Wgetrc Location
1450 @cindex wgetrc location
1451 @cindex location of wgetrc
1453 When initializing, Wget will look for a @dfn{global} startup file,
1454 @file{/usr/local/etc/wgetrc} by default (or some prefix other than
1455 @file{/usr/local}, if Wget was not installed there) and read commands
1456 from there, if it exists.
1458 Then it will look for the user's file. If the environmental variable
1459 @code{WGETRC} is set, Wget will try to load that file. Failing that, no
1460 further attempts will be made.
1462 If @code{WGETRC} is not set, Wget will try to load @file{$HOME/.wgetrc}.
1464 The fact that user's settings are loaded after the system-wide ones
1465 means that in case of collision user's wgetrc @emph{overrides} the
1466 system-wide wgetrc (in @file{/usr/local/etc/wgetrc} by default).
1467 Fascist admins, away!
1469 @node Wgetrc Syntax, Wgetrc Commands, Wgetrc Location, Startup File
1470 @section Wgetrc Syntax
1471 @cindex wgetrc syntax
1472 @cindex syntax of wgetrc
1474 The syntax of a wgetrc command is simple:
1480 The @dfn{variable} will also be called @dfn{command}. Valid
1481 @dfn{values} are different for different commands.
1483 The commands are case-insensitive and underscore-insensitive. Thus
1484 @samp{DIr__PrefiX} is the same as @samp{dirprefix}. Empty lines, lines
1485 beginning with @samp{#} and lines containing white-space only are
1488 Commands that expect a comma-separated list will clear the list on an
1489 empty command. So, if you wish to reset the rejection list specified in
1490 global @file{wgetrc}, you can do it with:
1496 @node Wgetrc Commands, Sample Wgetrc, Wgetrc Syntax, Startup File
1497 @section Wgetrc Commands
1498 @cindex wgetrc commands
1500 The complete set of commands is listed below, the letter after @samp{=}
1501 denoting the value the command takes. It is @samp{on/off} for @samp{on}
1502 or @samp{off} (which can also be @samp{1} or @samp{0}), @var{string} for
1503 any non-empty string or @var{n} for a positive integer. For example,
1504 you may specify @samp{use_proxy = off} to disable use of proxy servers
1505 by default. You may use @samp{inf} for infinite values, where
1508 Most of the commands have their equivalent command-line option
1509 (@xref{Invoking}), except some more obscure or rarely used ones.
1512 @item accept/reject = @var{string}
1513 Same as @samp{-A}/@samp{-R} (@xref{Types of Files}).
1515 @item add_hostdir = on/off
1516 Enable/disable host-prefixed file names. @samp{-nH} disables it.
1518 @item continue = on/off
1519 Enable/disable continuation of the retrieval, the same as @samp{-c}
1522 @item background = on/off
1523 Enable/disable going to background, the same as @samp{-b} (which enables
1526 @item backup_converted = on/off
1527 Enable/disable saving pre-converted files with the suffix @samp{.orig}
1528 -- the same as @samp{-K} (which enables it).
1530 @c @item backups = @var{number}
1531 @c #### Document me!
1532 @item base = @var{string}
1533 Set base for relative @sc{url}s, the same as @samp{-B}.
1535 @item cache = on/off
1536 When set to off, disallow server-caching. See the @samp{-C} option.
1538 @item convert links = on/off
1539 Convert non-relative links locally. The same as @samp{-k}.
1541 @item cut_dirs = @var{n}
1542 Ignore @var{n} remote directory components.
1544 @item debug = on/off
1545 Debug mode, same as @samp{-d}.
1547 @item delete_after = on/off
1548 Delete after download, the same as @samp{--delete-after}.
1550 @item dir_prefix = @var{string}
1551 Top of directory tree, the same as @samp{-P}.
1553 @item dirstruct = on/off
1554 Turning dirstruct on or off, the same as @samp{-x} or @samp{-nd},
1557 @item domains = @var{string}
1558 Same as @samp{-D} (@xref{Domain Acceptance}).
1560 @item dot_bytes = @var{n}
1561 Specify the number of bytes ``contained'' in a dot, as seen throughout
1562 the retrieval (1024 by default). You can postfix the value with
1563 @samp{k} or @samp{m}, representing kilobytes and megabytes,
1564 respectively. With dot settings you can tailor the dot retrieval to
1565 suit your needs, or you can use the predefined @dfn{styles}
1566 (@xref{Download Options}).
1568 @item dots_in_line = @var{n}
1569 Specify the number of dots that will be printed in each line throughout
1570 the retrieval (50 by default).
1572 @item dot_spacing = @var{n}
1573 Specify the number of dots in a single cluster (10 by default).
1575 @item dot_style = @var{string}
1576 Specify the dot retrieval @dfn{style}, as with @samp{--dot-style}.
1578 @item exclude_directories = @var{string}
1579 Specify a comma-separated list of directories you wish to exclude from
1580 download, the same as @samp{-X} (@xref{Directory-Based Limits}).
1582 @item exclude_domains = @var{string}
1583 Same as @samp{--exclude-domains} (@xref{Domain Acceptance}).
1585 @item follow_ftp = on/off
1586 Follow @sc{ftp} links from @sc{html} documents, the same as @samp{-f}.
1588 @item force_html = on/off
1589 If set to on, force the input filename to be regarded as an @sc{html}
1590 document, the same as @samp{-F}.
1592 @item ftp_proxy = @var{string}
1593 Use @var{string} as @sc{ftp} proxy, instead of the one specified in
1597 Turn globbing on/off, the same as @samp{-g}.
1599 @item header = @var{string}
1600 Define an additional header, like @samp{--header}.
1602 @item http_passwd = @var{string}
1603 Set @sc{http} password.
1605 @item http_proxy = @var{string}
1606 Use @var{string} as @sc{http} proxy, instead of the one specified in
1609 @item http_user = @var{string}
1610 Set @sc{http} user to @var{string}.
1612 @item ignore_length = on/off
1613 When set to on, ignore @code{Content-Length} header; the same as
1614 @samp{--ignore-length}.
1616 @item include_directories = @var{string}
1617 Specify a comma-separated list of directories you wish to follow when
1618 downloading, the same as @samp{-I}.
1620 @item input = @var{string}
1621 Read the @sc{url}s from @var{string}, like @samp{-i}.
1623 @item kill_longer = on/off
1624 Consider data longer than specified in content-length header
1625 as invalid (and retry getting it). The default behaviour is to save
1626 as much data as there is, provided there is more than or equal
1627 to the value in @code{Content-Length}.
1629 @item logfile = @var{string}
1630 Set logfile, the same as @samp{-o}.
1632 @item login = @var{string}
1633 Your user name on the remote machine, for @sc{ftp}. Defaults to
1636 @item mirror = on/off
1637 Turn mirroring on/off. The same as @samp{-m}.
1639 @item netrc = on/off
1640 Turn reading netrc on or off.
1642 @item noclobber = on/off
1645 @item no_parent = on/off
1646 Disallow retrieving outside the directory hierarchy, like
1647 @samp{--no-parent} (@xref{Directory-Based Limits}).
1649 @item no_proxy = @var{string}
1650 Use @var{string} as the comma-separated list of domains to avoid in
1651 proxy loading, instead of the one specified in environment.
1653 @item output_document = @var{string}
1654 Set the output filename, the same as @samp{-O}.
1656 @item passive_ftp = on/off
1657 Set passive @sc{ftp}, the same as @samp{--passive-ftp}.
1659 @item passwd = @var{string}
1660 Set your @sc{ftp} password to @var{password}. Without this setting, the
1661 password defaults to @samp{username@@hostname.domainname}.
1663 @item proxy_user = @var{string}
1664 Set proxy authentication user name to @var{string}, like
1665 @samp{--proxy-user}.
1667 @item proxy_passwd = @var{string}
1668 Set proxy authentication password to @var{string}, like
1669 @samp{--proxy-passwd}.
1671 @item quiet = on/off
1672 Quiet mode, the same as @samp{-q}.
1674 @item quota = @var{quota}
1675 Specify the download quota, which is useful to put in global
1676 wgetrc. When download quota is specified, Wget will stop retrieving
1677 after the download sum has become greater than quota. The quota can be
1678 specified in bytes (default), kbytes @samp{k} appended) or mbytes
1679 (@samp{m} appended). Thus @samp{quota = 5m} will set the quota to 5
1680 mbytes. Note that the user's startup file overrides system settings.
1682 @item reclevel = @var{n}
1683 Recursion level, the same as @samp{-l}.
1685 @item recursive = on/off
1686 Recursive on/off, the same as @samp{-r}.
1688 @item relative_only = on/off
1689 Follow only relative links, the same as @samp{-L} (@xref{Relative
1692 @item remove_listing = on/off
1693 If set to on, remove @sc{ftp} listings downloaded by Wget. Setting it
1694 to off is the same as @samp{-nr}.
1696 @item retr_symlinks = on/off
1697 When set to on, retrieve symbolic links as if they were plain files; the
1698 same as @samp{--retr-symlinks}.
1700 @item robots = on/off
1701 Use (or not) @file{/robots.txt} file (@xref{Robots}). Be sure to know
1702 what you are doing before changing the default (which is @samp{on}).
1704 @item server_response = on/off
1705 Choose whether or not to print the @sc{http} and @sc{ftp} server
1706 responses, the same as @samp{-S}.
1708 @item simple_host_check = on/off
1709 Same as @samp{-nh} (@xref{Host Checking}).
1711 @item span_hosts = on/off
1714 @item timeout = @var{n}
1715 Set timeout value, the same as @samp{-T}.
1717 @item timestamping = on/off
1718 Turn timestamping on/off. The same as @samp{-N} (@xref{Time-Stamping}).
1720 @item tries = @var{n}
1721 Set number of retries per @sc{url}, the same as @samp{-t}.
1723 @item use_proxy = on/off
1724 Turn proxy support on/off. The same as @samp{-Y}.
1726 @item verbose = on/off
1727 Turn verbose on/off, the same as @samp{-v}/@samp{-nv}.
1729 @item wait = @var{n}
1730 Wait @var{n} seconds between retrievals, the same as @samp{-w}.
1733 @node Sample Wgetrc, , Wgetrc Commands, Startup File
1734 @section Sample Wgetrc
1735 @cindex sample wgetrc
1737 This is the sample initialization file, as given in the distribution.
1738 It is divided in two section---one for global usage (suitable for global
1739 startup file), and one for local usage (suitable for
1740 @file{$HOME/.wgetrc}). Be careful about the things you change.
1742 Note that all the lines are commented out. For any line to have effect,
1743 you must remove the @samp{#} prefix at the beginning of line.
1747 ### Sample Wget initialization file .wgetrc
1750 ## You can use this file to change the default behaviour of wget or to
1751 ## avoid having to type many many command-line options. This file does
1752 ## not contain a comprehensive list of commands -- look at the manual
1753 ## to find out what you can put into this file.
1755 ## Wget initialization file can reside in /usr/local/etc/wgetrc
1756 ## (global, for all users) or $HOME/.wgetrc (for a single user).
1758 ## To use any of the settings in this file, you will have to uncomment
1759 ## them (and probably change them).
1763 ## Global settings (useful for setting up in /usr/local/etc/wgetrc).
1764 ## Think well before you change them, since they may reduce wget's
1765 ## functionality, and make it behave contrary to the documentation:
1768 # You can set retrieve quota for beginners by specifying a value
1769 # optionally followed by 'K' (kilobytes) or 'M' (megabytes). The
1770 # default quota is unlimited.
1773 # You can lower (or raise) the default number of retries when
1774 # downloading a file (default is 20).
1777 # Lowering the maximum depth of the recursive retrieval is handy to
1778 # prevent newbies from going too "deep" when they unwittingly start
1779 # the recursive retrieval. The default is 5.
1782 # Many sites are behind firewalls that do not allow initiation of
1783 # connections from the outside. On these sites you have to use the
1784 # `passive' feature of FTP. If you are behind such a firewall, you
1785 # can turn this on to make Wget use passive FTP by default.
1790 ## Local settings (for a user to set in his $HOME/.wgetrc). It is
1791 ## *highly* undesirable to put these settings in the global file, since
1792 ## they are potentially dangerous to "normal" users.
1794 ## Even when setting up your own ~/.wgetrc, you should know what you
1795 ## are doing before doing so.
1798 # Set this to on to use timestamping by default:
1801 # It is a good idea to make Wget send your email address in a `From:'
1802 # header with your request (so that server administrators can contact
1803 # you in case of errors). Wget does *not* send `From:' by default.
1804 #header = From: Your Name <username@@site.domain>
1806 # You can set up other headers, like Accept-Language. Accept-Language
1807 # is *not* sent by default.
1808 #header = Accept-Language: en
1810 # You can set the default proxy for Wget to use. It will override the
1811 # value in the environment.
1812 #http_proxy = http://proxy.yoyodyne.com:18023/
1814 # If you do not want to use proxy at all, set this to off.
1817 # You can customize the retrieval outlook. Valid options are default,
1818 # binary, mega and micro.
1819 #dot_style = default
1821 # Setting this to off makes Wget not download /robots.txt. Be sure to
1822 # know *exactly* what /robots.txt is and how it is used before changing
1826 # It can be useful to make Wget wait between connections. Set this to
1827 # the number of seconds you want Wget to wait.
1830 # You can force creating directory structure, even if a single is being
1831 # retrieved, by setting this to on.
1834 # You can turn on recursive retrieving by default (don't do this if
1835 # you are not sure you know what it means) by setting this to on.
1838 # To have Wget follow FTP links from HTML files by default, set this
1843 @node Examples, Various, Startup File, Top
1847 The examples are classified into three sections, because of clarity.
1848 The first section is a tutorial for beginners. The second section
1849 explains some of the more complex program features. The third section
1850 contains advice for mirror administrators, as well as even more complex
1851 features (that some would call perverted).
1854 * Simple Usage:: Simple, basic usage of the program.
1855 * Advanced Usage:: Advanced techniques of usage.
1856 * Guru Usage:: Mirroring and the hairy stuff.
1859 @node Simple Usage, Advanced Usage, Examples, Examples
1860 @section Simple Usage
1864 Say you want to download a @sc{url}. Just type:
1867 wget http://fly.cc.fer.hr/
1870 The response will be something like:
1874 --13:30:45-- http://fly.cc.fer.hr:80/en/
1876 Connecting to fly.cc.fer.hr:80... connected!
1877 HTTP request sent, awaiting response... 200 OK
1878 Length: 4,694 [text/html]
1882 13:30:46 (23.75 KB/s) - `index.html' saved [4694/4694]
1887 But what will happen if the connection is slow, and the file is lengthy?
1888 The connection will probably fail before the whole file is retrieved,
1889 more than once. In this case, Wget will try getting the file until it
1890 either gets the whole of it, or exceeds the default number of retries
1891 (this being 20). It is easy to change the number of tries to 45, to
1892 insure that the whole file will arrive safely:
1895 wget --tries=45 http://fly.cc.fer.hr/jpg/flyweb.jpg
1899 Now let's leave Wget to work in the background, and write its progress
1900 to log file @file{log}. It is tiring to type @samp{--tries}, so we
1901 shall use @samp{-t}.
1904 wget -t 45 -o log http://fly.cc.fer.hr/jpg/flyweb.jpg &
1907 The ampersand at the end of the line makes sure that Wget works in the
1908 background. To unlimit the number of retries, use @samp{-t inf}.
1911 The usage of @sc{ftp} is as simple. Wget will take care of login and
1916 $ wget ftp://gnjilux.cc.fer.hr/welcome.msg
1917 --10:08:47-- ftp://gnjilux.cc.fer.hr:21/welcome.msg
1919 Connecting to gnjilux.cc.fer.hr:21... connected!
1920 Logging in as anonymous ... Logged in!
1921 ==> TYPE I ... done. ==> CWD not needed.
1922 ==> PORT ... done. ==> RETR welcome.msg ... done.
1923 Length: 1,340 (unauthoritative)
1927 10:08:48 (1.28 MB/s) - `welcome.msg' saved [1340]
1932 If you specify a directory, Wget will retrieve the directory listing,
1933 parse it and convert it to @sc{html}. Try:
1936 wget ftp://prep.ai.mit.edu/pub/gnu/
1941 @node Advanced Usage, Guru Usage, Simple Usage, Examples
1942 @section Advanced Usage
1946 You would like to read the list of @sc{url}s from a file? Not a problem
1953 If you specify @samp{-} as file name, the @sc{url}s will be read from
1957 Create a mirror image of GNU @sc{www} site (with the same directory structure
1958 the original has) with only one try per document, saving the log of the
1959 activities to @file{gnulog}:
1962 wget -r -t1 http://www.gnu.ai.mit.edu/ -o gnulog
1966 Retrieve the first layer of yahoo links:
1969 wget -r -l1 http://www.yahoo.com/
1973 Retrieve the index.html of @samp{www.lycos.com}, showing the original
1977 wget -S http://www.lycos.com/
1981 Save the server headers with the file:
1983 wget -s http://www.lycos.com/
1988 Retrieve the first two levels of @samp{wuarchive.wustl.edu}, saving them
1992 wget -P/tmp -l2 ftp://wuarchive.wustl.edu/
1996 You want to download all the @sc{gif}s from an @sc{http} directory.
1997 @samp{wget http://host/dir/*.gif} doesn't work, since @sc{http}
1998 retrieval does not support globbing. In that case, use:
2001 wget -r -l1 --no-parent -A.gif http://host/dir/
2004 It is a bit of a kludge, but it works. @samp{-r -l1} means to retrieve
2005 recursively (@xref{Recursive Retrieval}), with maximum depth of 1.
2006 @samp{--no-parent} means that references to the parent directory are
2007 ignored (@xref{Directory-Based Limits}), and @samp{-A.gif} means to
2008 download only the @sc{gif} files. @samp{-A "*.gif"} would have worked
2012 Suppose you were in the middle of downloading, when Wget was
2013 interrupted. Now you do not want to clobber the files already present.
2017 wget -nc -r http://www.gnu.ai.mit.edu/
2021 If you want to encode your own username and password to @sc{http} or
2022 @sc{ftp}, use the appropriate @sc{url} syntax (@xref{URL Format}).
2025 wget ftp://hniksic:mypassword@@jagor.srce.hr/.emacs
2029 If you do not like the default retrieval visualization (1K dots with 10
2030 dots per cluster and 50 dots per line), you can customize it through dot
2031 settings (@xref{Wgetrc Commands}). For example, many people like the
2032 ``binary'' style of retrieval, with 8K dots and 512K lines:
2035 wget --dot-style=binary ftp://prep.ai.mit.edu/pub/gnu/README
2038 You can experiment with other styles, like:
2041 wget --dot-style=mega ftp://ftp.xemacs.org/pub/xemacs/xemacs-20.4/xemacs-20.4.tar.gz
2042 wget --dot-style=micro http://fly.cc.fer.hr/
2045 To make these settings permanent, put them in your @file{.wgetrc}, as
2046 described before (@xref{Sample Wgetrc}).
2049 @node Guru Usage, , Advanced Usage, Examples
2055 If you wish Wget to keep a mirror of a page (or @sc{ftp}
2056 subdirectories), use @samp{--mirror} (@samp{-m}), which is the shorthand
2057 for @samp{-r -N}. You can put Wget in the crontab file asking it to
2058 recheck a site each Sunday:
2062 0 0 * * 0 wget --mirror ftp://ftp.xemacs.org/pub/xemacs/ -o /home/me/weeklog
2066 You may wish to do the same with someone's home page. But you do not
2067 want to download all those images---you're only interested in @sc{html}.
2070 wget --mirror -A.html http://www.w3.org/
2074 But what about mirroring the hosts networkologically close to you? It
2075 seems so awfully slow because of all that @sc{dns} resolving. Just use
2076 @samp{-D} (@xref{Domain Acceptance}).
2079 wget -rN -Dsrce.hr http://www.srce.hr/
2082 Now Wget will correctly find out that @samp{regoc.srce.hr} is the same
2083 as @samp{www.srce.hr}, but will not even take into consideration the
2084 link to @samp{www.mit.edu}.
2087 You have a presentation and would like the dumb absolute links to be
2088 converted to relative? Use @samp{-k}:
2091 wget -k -r @var{URL}
2094 @cindex redirecting output
2096 You would like the output documents to go to standard output instead of
2097 to files? OK, but Wget will automatically shut up (turn on
2098 @samp{--quiet}) to prevent mixing of Wget output and the retrieved
2102 wget -O - http://jagor.srce.hr/ http://www.srce.hr/
2105 You can also combine the two options and make weird pipelines to
2106 retrieve the documents from remote hotlists:
2109 wget -O - http://cool.list.com/ | wget --force-html -i -
2113 @node Various, Appendices, Examples, Top
2117 This chapter contains all the stuff that could not fit anywhere else.
2120 * Proxies:: Support for proxy servers
2121 * Distribution:: Getting the latest version.
2122 * Mailing List:: Wget mailing list for announcements and discussion.
2123 * Reporting Bugs:: How and where to report bugs.
2124 * Portability:: The systems Wget works on.
2125 * Signals:: Signal-handling performed by Wget.
2128 @node Proxies, Distribution, Various, Various
2132 @dfn{Proxies} are special-purpose @sc{http} servers designed to transfer
2133 data from remote servers to local clients. One typical use of proxies
2134 is lightening network load for users behind a slow connection. This is
2135 achieved by channeling all @sc{http} and @sc{ftp} requests through the
2136 proxy which caches the transferred data. When a cached resource is
2137 requested again, proxy will return the data from cache. Another use for
2138 proxies is for companies that separate (for security reasons) their
2139 internal networks from the rest of Internet. In order to obtain
2140 information from the Web, their users connect and retrieve remote data
2141 using an authorized proxy.
2143 Wget supports proxies for both @sc{http} and @sc{ftp} retrievals. The
2144 standard way to specify proxy location, which Wget recognizes, is using
2145 the following environment variables:
2149 This variable should contain the @sc{url} of the proxy for @sc{http}
2153 This variable should contain the @sc{url} of the proxy for @sc{http}
2154 connections. It is quite common that @sc{http_proxy} and @sc{ftp_proxy}
2155 are set to the same @sc{url}.
2158 This variable should contain a comma-separated list of domain extensions
2159 proxy should @emph{not} be used for. For instance, if the value of
2160 @code{no_proxy} is @samp{.mit.edu}, proxy will not be used to retrieve
2164 In addition to the environment variables, proxy location and settings
2165 may be specified from within Wget itself.
2169 @itemx --proxy=on/off
2170 @itemx proxy = on/off
2171 This option may be used to turn the proxy support on or off. Proxy
2172 support is on by default, provided that the appropriate environment
2175 @item http_proxy = @var{URL}
2176 @itemx ftp_proxy = @var{URL}
2177 @itemx no_proxy = @var{string}
2178 These startup file variables allow you to override the proxy settings
2179 specified by the environment.
2182 Some proxy servers require authorization to enable you to use them. The
2183 authorization consists of @dfn{username} and @dfn{password}, which must
2184 be sent by Wget. As with @sc{http} authorization, several
2185 authentication schemes exist. For proxy authorization only the
2186 @code{Basic} authentication scheme is currently implemented.
2188 You may specify your username and password either through the proxy
2189 @sc{url} or through the command-line options. Assuming that the
2190 company's proxy is located at @samp{proxy.srce.hr} at port 8001, a proxy
2191 @sc{url} location containing authorization data might look like this:
2194 http://hniksic:mypassword@@proxy.company.com:8001/
2197 Alternatively, you may use the @samp{proxy-user} and
2198 @samp{proxy-password} options, and the equivalent @file{.wgetrc}
2199 settings @code{proxy_user} and @code{proxy_passwd} to set the proxy
2200 username and password.
2202 @node Distribution, Mailing List, Proxies, Various
2203 @section Distribution
2204 @cindex latest version
2206 Like all GNU utilities, the latest version of Wget can be found at the
2207 master GNU archive site prep.ai.mit.edu, and its mirrors. For example,
2208 Wget @value{VERSION} can be found at
2209 @url{ftp://prep.ai.mit.edu/gnu/wget/wget-@value{VERSION}.tar.gz}
2211 @node Mailing List, Reporting Bugs, Distribution, Various
2212 @section Mailing List
2213 @cindex mailing list
2216 Wget has its own mailing list at @email{wget@@sunsite.auc.dk}, thanks
2217 to Karsten Thygesen. The mailing list is for discussion of Wget
2218 features and web, reporting Wget bugs (those that you think may be of
2219 interest to the public) and mailing announcements. You are welcome to
2220 subscribe. The more people on the list, the better!
2222 To subscribe, send mail to @email{wget-subscribe@@sunsite.auc.dk}.
2223 the magic word @samp{subscribe} in the subject line. Unsubscribe by
2224 mailing to @email{wget-unsubscribe@@sunsite.auc.dk}.
2226 The mailing list is archived at @url{http://fly.cc.fer.hr/archive/wget}.
2228 @node Reporting Bugs, Portability, Mailing List, Various
2229 @section Reporting Bugs
2231 @cindex reporting bugs
2234 You are welcome to send bug reports about GNU Wget to
2235 @email{bug-wget@@gnu.org}. The bugs that you think are of the
2236 interest to the public (i.e. more people should be informed about them)
2237 can be Cc-ed to the mailing list at @email{wget@@sunsite.auc.dk}.
2239 Before actually submitting a bug report, please try to follow a few
2244 Please try to ascertain that the behaviour you see really is a bug. If
2245 Wget crashes, it's a bug. If Wget does not behave as documented,
2246 it's a bug. If things work strange, but you are not sure about the way
2247 they are supposed to work, it might well be a bug.
2250 Try to repeat the bug in as simple circumstances as possible. E.g. if
2251 Wget crashes on @samp{wget -rLl0 -t5 -Y0 http://yoyodyne.com -o
2252 /tmp/log}, you should try to see if it will crash with a simpler set of
2255 Also, while I will probably be interested to know the contents of your
2256 @file{.wgetrc} file, just dumping it into the debug message is probably
2257 a bad idea. Instead, you should first try to see if the bug repeats
2258 with @file{.wgetrc} moved out of the way. Only if it turns out that
2259 @file{.wgetrc} settings affect the bug, should you mail me the relevant
2263 Please start Wget with @samp{-d} option and send the log (or the
2264 relevant parts of it). If Wget was compiled without debug support,
2265 recompile it. It is @emph{much} easier to trace bugs with debug support
2269 If Wget has crashed, try to run it in a debugger, e.g. @code{gdb `which
2270 wget` core} and type @code{where} to get the backtrace.
2273 Find where the bug is, fix it and send me the patches. :-)
2276 @node Portability, Signals, Reporting Bugs, Various
2277 @section Portability
2279 @cindex operating systems
2281 Since Wget uses GNU Autoconf for building and configuring, and avoids
2282 using ``special'' ultra--mega--cool features of any particular Unix, it
2283 should compile (and work) on all common Unix flavors.
2285 Various Wget versions have been compiled and tested under many kinds of
2286 Unix systems, including Solaris, Linux, SunOS, OSF (aka Digital Unix),
2287 Ultrix, *BSD, IRIX, and others; refer to the file @file{MACHINES} in the
2288 distribution directory for a comprehensive list. If you compile it on
2289 an architecture not listed there, please let me know so I can update it.
2291 Wget should also compile on the other Unix systems, not listed in
2292 @file{MACHINES}. If it doesn't, please let me know.
2294 Thanks to kind contributors, this version of Wget compiles and works on
2295 Microsoft Windows 95 and Windows NT platforms. It has been compiled
2296 successfully using MS Visual C++ 4.0, Watcom, and Borland C compilers,
2297 with Winsock as networking software. Naturally, it is crippled of some
2298 features available on Unix, but it should work as a substitute for
2299 people stuck with Windows. Note that the Windows port is
2300 @strong{neither tested nor maintained} by me---all questions and
2301 problems should be reported to Wget mailing list at
2302 @email{wget@@sunsite.auc.dk} where the maintainers will look at them.
2304 @node Signals, , Portability, Various
2306 @cindex signal handling
2309 Since the purpose of Wget is background work, it catches the hangup
2310 signal (@code{SIGHUP}) and ignores it. If the output was on standard
2311 output, it will be redirected to a file named @file{wget-log}.
2312 Otherwise, @code{SIGHUP} is ignored. This is convenient when you wish
2313 to redirect the output of Wget after having started it.
2316 $ wget http://www.ifi.uio.no/~larsi/gnus.tar.gz &
2317 $ kill -HUP %% # Redirect the output to wget-log
2320 Other than that, Wget will not try to interfere with signals in any
2321 way. @kbd{C-c}, @code{kill -TERM} and @code{kill -KILL} should kill it
2324 @node Appendices, Copying, Various, Top
2327 This chapter contains some references I consider useful, like the Robots
2328 Exclusion Standard specification, as well as a list of contributors to
2332 * Robots:: Wget as a WWW robot.
2333 * Security Considerations:: Security with Wget.
2334 * Contributors:: People who helped.
2337 @node Robots, Security Considerations, Appendices, Appendices
2341 @cindex server maintenance
2343 Since Wget is able to traverse the web, it counts as one of the Web
2344 @dfn{robots}. Thus Wget understands @dfn{Robots Exclusion Standard}
2345 (@sc{res})---contents of @file{/robots.txt}, used by server
2346 administrators to shield parts of their systems from wanderings of Wget.
2348 Norobots support is turned on only when retrieving recursively, and
2349 @emph{never} for the first page. Thus, you may issue:
2352 wget -r http://fly.cc.fer.hr/
2355 First the index of fly.cc.fer.hr will be downloaded. If Wget finds
2356 anything worth downloading on the same host, only @emph{then} will it
2357 load the robots, and decide whether or not to load the links after all.
2358 @file{/robots.txt} is loaded only once per host. Wget does not support
2359 the robots @code{META} tag.
2361 The description of the norobots standard was written, and is maintained
2362 by Martijn Koster @email{m.koster@@webcrawler.com}. With his
2363 permission, I contribute a (slightly modified) TeXified version of the
2367 * Introduction to RES::
2369 * User-Agent Field::
2371 * Norobots Examples::
2374 @node Introduction to RES, RES Format, Robots, Robots
2375 @subsection Introduction to RES
2376 @cindex norobots introduction
2378 @dfn{WWW Robots} (also called @dfn{wanderers} or @dfn{spiders}) are
2379 programs that traverse many pages in the World Wide Web by recursively
2380 retrieving linked pages. For more information see the robots page.
2382 In 1993 and 1994 there have been occasions where robots have visited
2383 @sc{www} servers where they weren't welcome for various
2384 reasons. Sometimes these reasons were robot specific, e.g. certain
2385 robots swamped servers with rapid-fire requests, or retrieved the same
2386 files repeatedly. In other situations robots traversed parts of @sc{www}
2387 servers that weren't suitable, e.g. very deep virtual trees, duplicated
2388 information, temporary information, or cgi-scripts with side-effects
2391 These incidents indicated the need for established mechanisms for
2392 @sc{www} servers to indicate to robots which parts of their server
2393 should not be accessed. This standard addresses this need with an
2394 operational solution.
2396 This document represents a consensus on 30 June 1994 on the robots
2397 mailing list (@code{robots@@webcrawler.com}), between the majority of
2398 robot authors and other people with an interest in robots. It has also
2399 been open for discussion on the Technical World Wide Web mailing list
2400 (@code{www-talk@@info.cern.ch}). This document is based on a previous
2401 working draft under the same title.
2403 It is not an official standard backed by a standards body, or owned by
2404 any commercial organization. It is not enforced by anybody, and there
2405 no guarantee that all current and future robots will use it. Consider
2406 it a common facility the majority of robot authors offer the @sc{www}
2407 community to protect @sc{www} server against unwanted accesses by their
2410 The latest version of this document can be found at
2411 @url{http://info.webcrawler.com/mak/projects/robots/norobots.html}.
2413 @node RES Format, User-Agent Field, Introduction to RES, Robots
2414 @subsection RES Format
2415 @cindex norobots format
2417 The format and semantics of the @file{/robots.txt} file are as follows:
2419 The file consists of one or more records separated by one or more blank
2420 lines (terminated by @code{CR}, @code{CR/NL}, or @code{NL}). Each
2421 record contains lines of the form:
2424 <field>:<optionalspace><value><optionalspace>
2427 The field name is case insensitive.
2429 Comments can be included in file using UNIX Bourne shell conventions:
2430 the @samp{#} character is used to indicate that preceding space (if any)
2431 and the remainder of the line up to the line termination is discarded.
2432 Lines containing only a comment are discarded completely, and therefore
2433 do not indicate a record boundary.
2435 The record starts with one or more User-agent lines, followed by one or
2436 more Disallow lines, as detailed below. Unrecognized headers are
2439 The presence of an empty @file{/robots.txt} file has no explicit
2440 associated semantics, it will be treated as if it was not present,
2441 i.e. all robots will consider themselves welcome.
2443 @node User-Agent Field, Disallow Field, RES Format, Robots
2444 @subsection User-Agent Field
2445 @cindex norobots user-agent
2447 The value of this field is the name of the robot the record is
2448 describing access policy for.
2450 If more than one User-agent field is present the record describes an
2451 identical access policy for more than one robot. At least one field
2452 needs to be present per record.
2454 The robot should be liberal in interpreting this field. A case
2455 insensitive substring match of the name without version information is
2458 If the value is @samp{*}, the record describes the default access policy
2459 for any robot that has not matched any of the other records. It is not
2460 allowed to have multiple such records in the @file{/robots.txt} file.
2462 @node Disallow Field, Norobots Examples, User-Agent Field, Robots
2463 @subsection Disallow Field
2464 @cindex norobots disallow
2466 The value of this field specifies a partial @sc{url} that is not to be
2467 visited. This can be a full path, or a partial path; any @sc{url} that
2468 starts with this value will not be retrieved. For example,
2469 @w{@samp{Disallow: /help}} disallows both @samp{/help.html} and
2470 @samp{/help/index.html}, whereas @w{@samp{Disallow: /help/}} would
2471 disallow @samp{/help/index.html} but allow @samp{/help.html}.
2473 Any empty value, indicates that all @sc{url}s can be retrieved. At least
2474 one Disallow field needs to be present in a record.
2476 @node Norobots Examples, , Disallow Field, Robots
2477 @subsection Norobots Examples
2478 @cindex norobots examples
2480 The following example @samp{/robots.txt} file specifies that no robots
2481 should visit any @sc{url} starting with @samp{/cyberworld/map/} or
2485 # robots.txt for http://www.site.com/
2488 Disallow: /cyberworld/map/ # This is an infinite virtual URL space
2489 Disallow: /tmp/ # these will soon disappear
2492 This example @samp{/robots.txt} file specifies that no robots should
2493 visit any @sc{url} starting with @samp{/cyberworld/map/}, except the
2494 robot called @samp{cybermapper}:
2497 # robots.txt for http://www.site.com/
2500 Disallow: /cyberworld/map/ # This is an infinite virtual URL space
2502 # Cybermapper knows where to go.
2503 User-agent: cybermapper
2507 This example indicates that no robots should visit this site further:
2515 @node Security Considerations, Contributors, Robots, Appendices
2516 @section Security Considerations
2519 When using Wget, you must be aware that it sends unencrypted passwords
2520 through the network, which may present a security problem. Here are the
2521 main issues, and some solutions.
2525 The passwords on the command line are visible using @code{ps}. If this
2526 is a problem, avoid putting passwords from the command line---e.g. you
2527 can use @file{.netrc} for this.
2530 Using the insecure @dfn{basic} authentication scheme, unencrypted
2531 passwords are transmitted through the network routers and gateways.
2534 The @sc{ftp} passwords are also in no way encrypted. There is no good
2535 solution for this at the moment.
2538 Although the ``normal'' output of Wget tries to hide the passwords,
2539 debugging logs show them, in all forms. This problem is avoided by
2540 being careful when you send debug logs (yes, even when you send them to
2544 @node Contributors, , Security Considerations, Appendices
2545 @section Contributors
2546 @cindex contributors
2549 GNU Wget was written by Hrvoje Nik@v{s}i@'{c} @email{hniksic@@iskon.hr}.
2552 GNU Wget was written by Hrvoje Niksic @email{hniksic@@iskon.hr}.
2554 However, its development could never have gone as far as it has, were it
2555 not for the help of many people, either with bug reports, feature
2556 proposals, patches, or letters saying ``Thanks!''.
2558 Special thanks goes to the following people (no particular order):
2562 Karsten Thygesen---donated the mailing list and the initial @sc{ftp}
2566 Shawn McHorse---bug reports and patches.
2569 Kaveh R. Ghazi---on-the-fly @code{ansi2knr}-ization.
2572 Gordon Matzigkeit---@file{.netrc} support.
2576 Zlatko @v{C}alu@v{s}i@'{c}, Tomislav Vujec and Dra@v{z}en
2577 Ka@v{c}ar---feature suggestions and ``philosophical'' discussions.
2580 Zlatko Calusic, Tomislav Vujec and Drazen Kacar---feature suggestions
2581 and ``philosophical'' discussions.
2585 Darko Budor---initial port to Windows.
2588 Antonio Rosella---help and suggestions, plus the Italian translation.
2592 Tomislav Petrovi@'{c}, Mario Miko@v{c}evi@'{c}---many bug reports and
2596 Tomislav Petrovic, Mario Mikocevic---many bug reports and suggestions.
2601 Fran@,{c}ois Pinard---many thorough bug reports and discussions.
2604 Francois Pinard---many thorough bug reports and discussions.
2608 Karl Eichwalder---lots of help with internationalization and other
2612 Junio Hamano---donated support for Opie and @sc{http} @code{Digest}
2616 Brian Gough---a generous donation.
2619 The following people have provided patches, bug/build reports, useful
2620 suggestions, beta testing services, fan mail and all the other things
2621 that make maintenance so much fun:
2626 Roger Beeman and the Gurus at Cisco,
2635 Kristijan @v{C}onka@v{s},
2651 Aleksandar Erkalovi@'{c},
2654 Aleksandar Erkalovic,
2667 Erik Magnus Hulthen,
2677 Goran Kezunovi@'{c},
2687 $\Sigma\acute{\iota}\mu o\varsigma\;
2688 \Xi\varepsilon\nu\iota\tau\acute{\epsilon}\lambda\lambda\eta\varsigma$
2689 (Simos KSenitellis),
2706 @c Texinfo doesn't grok @'{@i}, so we have to use TeX itself.
2708 Juan Jos\'{e} Rodr\'{\i}gues,
2711 Juan Jose Rodrigues,
2720 Szakacsits Szabolcs,
2724 Douglas E. Wegscheid,
2734 Apologies to all who I accidentally left out, and many thanks to all the
2735 subscribers of the Wget mailing list.
2737 @node Copying, Concept Index, Appendices, Top
2738 @unnumbered GNU GENERAL PUBLIC LICENSE
2741 @center Version 2, June 1991
2744 Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
2745 675 Mass Ave, Cambridge, MA 02139, USA
2747 Everyone is permitted to copy and distribute verbatim copies
2748 of this license document, but changing it is not allowed.
2751 @unnumberedsec Preamble
2753 The licenses for most software are designed to take away your
2754 freedom to share and change it. By contrast, the GNU General Public
2755 License is intended to guarantee your freedom to share and change free
2756 software---to make sure the software is free for all its users. This
2757 General Public License applies to most of the Free Software
2758 Foundation's software and to any other program whose authors commit to
2759 using it. (Some other Free Software Foundation software is covered by
2760 the GNU Library General Public License instead.) You can apply it to
2763 When we speak of free software, we are referring to freedom, not
2764 price. Our General Public Licenses are designed to make sure that you
2765 have the freedom to distribute copies of free software (and charge for
2766 this service if you wish), that you receive source code or can get it
2767 if you want it, that you can change the software or use pieces of it
2768 in new free programs; and that you know you can do these things.
2770 To protect your rights, we need to make restrictions that forbid
2771 anyone to deny you these rights or to ask you to surrender the rights.
2772 These restrictions translate to certain responsibilities for you if you
2773 distribute copies of the software, or if you modify it.
2775 For example, if you distribute copies of such a program, whether
2776 gratis or for a fee, you must give the recipients all the rights that
2777 you have. You must make sure that they, too, receive or can get the
2778 source code. And you must show them these terms so they know their
2781 We protect your rights with two steps: (1) copyright the software, and
2782 (2) offer you this license which gives you legal permission to copy,
2783 distribute and/or modify the software.
2785 Also, for each author's protection and ours, we want to make certain
2786 that everyone understands that there is no warranty for this free
2787 software. If the software is modified by someone else and passed on, we
2788 want its recipients to know that what they have is not the original, so
2789 that any problems introduced by others will not reflect on the original
2790 authors' reputations.
2792 Finally, any free program is threatened constantly by software
2793 patents. We wish to avoid the danger that redistributors of a free
2794 program will individually obtain patent licenses, in effect making the
2795 program proprietary. To prevent this, we have made it clear that any
2796 patent must be licensed for everyone's free use or not licensed at all.
2798 The precise terms and conditions for copying, distribution and
2799 modification follow.
2802 @unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2805 @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2810 This License applies to any program or other work which contains
2811 a notice placed by the copyright holder saying it may be distributed
2812 under the terms of this General Public License. The ``Program'', below,
2813 refers to any such program or work, and a ``work based on the Program''
2814 means either the Program or any derivative work under copyright law:
2815 that is to say, a work containing the Program or a portion of it,
2816 either verbatim or with modifications and/or translated into another
2817 language. (Hereinafter, translation is included without limitation in
2818 the term ``modification''.) Each licensee is addressed as ``you''.
2820 Activities other than copying, distribution and modification are not
2821 covered by this License; they are outside its scope. The act of
2822 running the Program is not restricted, and the output from the Program
2823 is covered only if its contents constitute a work based on the
2824 Program (independent of having been made by running the Program).
2825 Whether that is true depends on what the Program does.
2828 You may copy and distribute verbatim copies of the Program's
2829 source code as you receive it, in any medium, provided that you
2830 conspicuously and appropriately publish on each copy an appropriate
2831 copyright notice and disclaimer of warranty; keep intact all the
2832 notices that refer to this License and to the absence of any warranty;
2833 and give any other recipients of the Program a copy of this License
2834 along with the Program.
2836 You may charge a fee for the physical act of transferring a copy, and
2837 you may at your option offer warranty protection in exchange for a fee.
2840 You may modify your copy or copies of the Program or any portion
2841 of it, thus forming a work based on the Program, and copy and
2842 distribute such modifications or work under the terms of Section 1
2843 above, provided that you also meet all of these conditions:
2847 You must cause the modified files to carry prominent notices
2848 stating that you changed the files and the date of any change.
2851 You must cause any work that you distribute or publish, that in
2852 whole or in part contains or is derived from the Program or any
2853 part thereof, to be licensed as a whole at no charge to all third
2854 parties under the terms of this License.
2857 If the modified program normally reads commands interactively
2858 when run, you must cause it, when started running for such
2859 interactive use in the most ordinary way, to print or display an
2860 announcement including an appropriate copyright notice and a
2861 notice that there is no warranty (or else, saying that you provide
2862 a warranty) and that users may redistribute the program under
2863 these conditions, and telling the user how to view a copy of this
2864 License. (Exception: if the Program itself is interactive but
2865 does not normally print such an announcement, your work based on
2866 the Program is not required to print an announcement.)
2869 These requirements apply to the modified work as a whole. If
2870 identifiable sections of that work are not derived from the Program,
2871 and can be reasonably considered independent and separate works in
2872 themselves, then this License, and its terms, do not apply to those
2873 sections when you distribute them as separate works. But when you
2874 distribute the same sections as part of a whole which is a work based
2875 on the Program, the distribution of the whole must be on the terms of
2876 this License, whose permissions for other licensees extend to the
2877 entire whole, and thus to each and every part regardless of who wrote it.
2879 Thus, it is not the intent of this section to claim rights or contest
2880 your rights to work written entirely by you; rather, the intent is to
2881 exercise the right to control the distribution of derivative or
2882 collective works based on the Program.
2884 In addition, mere aggregation of another work not based on the Program
2885 with the Program (or with a work based on the Program) on a volume of
2886 a storage or distribution medium does not bring the other work under
2887 the scope of this License.
2890 You may copy and distribute the Program (or a work based on it,
2891 under Section 2) in object code or executable form under the terms of
2892 Sections 1 and 2 above provided that you also do one of the following:
2896 Accompany it with the complete corresponding machine-readable
2897 source code, which must be distributed under the terms of Sections
2898 1 and 2 above on a medium customarily used for software interchange; or,
2901 Accompany it with a written offer, valid for at least three
2902 years, to give any third party, for a charge no more than your
2903 cost of physically performing source distribution, a complete
2904 machine-readable copy of the corresponding source code, to be
2905 distributed under the terms of Sections 1 and 2 above on a medium
2906 customarily used for software interchange; or,
2909 Accompany it with the information you received as to the offer
2910 to distribute corresponding source code. (This alternative is
2911 allowed only for noncommercial distribution and only if you
2912 received the program in object code or executable form with such
2913 an offer, in accord with Subsection b above.)
2916 The source code for a work means the preferred form of the work for
2917 making modifications to it. For an executable work, complete source
2918 code means all the source code for all modules it contains, plus any
2919 associated interface definition files, plus the scripts used to
2920 control compilation and installation of the executable. However, as a
2921 special exception, the source code distributed need not include
2922 anything that is normally distributed (in either source or binary
2923 form) with the major components (compiler, kernel, and so on) of the
2924 operating system on which the executable runs, unless that component
2925 itself accompanies the executable.
2927 If distribution of executable or object code is made by offering
2928 access to copy from a designated place, then offering equivalent
2929 access to copy the source code from the same place counts as
2930 distribution of the source code, even though third parties are not
2931 compelled to copy the source along with the object code.
2934 You may not copy, modify, sublicense, or distribute the Program
2935 except as expressly provided under this License. Any attempt
2936 otherwise to copy, modify, sublicense or distribute the Program is
2937 void, and will automatically terminate your rights under this License.
2938 However, parties who have received copies, or rights, from you under
2939 this License will not have their licenses terminated so long as such
2940 parties remain in full compliance.
2943 You are not required to accept this License, since you have not
2944 signed it. However, nothing else grants you permission to modify or
2945 distribute the Program or its derivative works. These actions are
2946 prohibited by law if you do not accept this License. Therefore, by
2947 modifying or distributing the Program (or any work based on the
2948 Program), you indicate your acceptance of this License to do so, and
2949 all its terms and conditions for copying, distributing or modifying
2950 the Program or works based on it.
2953 Each time you redistribute the Program (or any work based on the
2954 Program), the recipient automatically receives a license from the
2955 original licensor to copy, distribute or modify the Program subject to
2956 these terms and conditions. You may not impose any further
2957 restrictions on the recipients' exercise of the rights granted herein.
2958 You are not responsible for enforcing compliance by third parties to
2962 If, as a consequence of a court judgment or allegation of patent
2963 infringement or for any other reason (not limited to patent issues),
2964 conditions are imposed on you (whether by court order, agreement or
2965 otherwise) that contradict the conditions of this License, they do not
2966 excuse you from the conditions of this License. If you cannot
2967 distribute so as to satisfy simultaneously your obligations under this
2968 License and any other pertinent obligations, then as a consequence you
2969 may not distribute the Program at all. For example, if a patent
2970 license would not permit royalty-free redistribution of the Program by
2971 all those who receive copies directly or indirectly through you, then
2972 the only way you could satisfy both it and this License would be to
2973 refrain entirely from distribution of the Program.
2975 If any portion of this section is held invalid or unenforceable under
2976 any particular circumstance, the balance of the section is intended to
2977 apply and the section as a whole is intended to apply in other
2980 It is not the purpose of this section to induce you to infringe any
2981 patents or other property right claims or to contest validity of any
2982 such claims; this section has the sole purpose of protecting the
2983 integrity of the free software distribution system, which is
2984 implemented by public license practices. Many people have made
2985 generous contributions to the wide range of software distributed
2986 through that system in reliance on consistent application of that
2987 system; it is up to the author/donor to decide if he or she is willing
2988 to distribute software through any other system and a licensee cannot
2991 This section is intended to make thoroughly clear what is believed to
2992 be a consequence of the rest of this License.
2995 If the distribution and/or use of the Program is restricted in
2996 certain countries either by patents or by copyrighted interfaces, the
2997 original copyright holder who places the Program under this License
2998 may add an explicit geographical distribution limitation excluding
2999 those countries, so that distribution is permitted only in or among
3000 countries not thus excluded. In such case, this License incorporates
3001 the limitation as if written in the body of this License.
3004 The Free Software Foundation may publish revised and/or new versions
3005 of the General Public License from time to time. Such new versions will
3006 be similar in spirit to the present version, but may differ in detail to
3007 address new problems or concerns.
3009 Each version is given a distinguishing version number. If the Program
3010 specifies a version number of this License which applies to it and ``any
3011 later version'', you have the option of following the terms and conditions
3012 either of that version or of any later version published by the Free
3013 Software Foundation. If the Program does not specify a version number of
3014 this License, you may choose any version ever published by the Free Software
3018 If you wish to incorporate parts of the Program into other free
3019 programs whose distribution conditions are different, write to the author
3020 to ask for permission. For software which is copyrighted by the Free
3021 Software Foundation, write to the Free Software Foundation; we sometimes
3022 make exceptions for this. Our decision will be guided by the two goals
3023 of preserving the free status of all derivatives of our free software and
3024 of promoting the sharing and reuse of software generally.
3027 @heading NO WARRANTY
3035 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
3036 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
3037 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
3038 PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
3039 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3040 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
3041 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
3042 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
3043 REPAIR OR CORRECTION.
3046 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
3047 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
3048 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
3049 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
3050 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
3051 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
3052 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
3053 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
3054 POSSIBILITY OF SUCH DAMAGES.
3058 @heading END OF TERMS AND CONDITIONS
3061 @center END OF TERMS AND CONDITIONS
3065 @unnumberedsec How to Apply These Terms to Your New Programs
3067 If you develop a new program, and you want it to be of the greatest
3068 possible use to the public, the best way to achieve this is to make it
3069 free software which everyone can redistribute and change under these terms.
3071 To do so, attach the following notices to the program. It is safest
3072 to attach them to the start of each source file to most effectively
3073 convey the exclusion of warranty; and each file should have at least
3074 the ``copyright'' line and a pointer to where the full notice is found.
3077 @var{one line to give the program's name and an idea of what it does.}
3078 Copyright (C) 19@var{yy} @var{name of author}
3080 This program is free software; you can redistribute it and/or
3081 modify it under the terms of the GNU General Public License
3082 as published by the Free Software Foundation; either version 2
3083 of the License, or (at your option) any later version.
3085 This program is distributed in the hope that it will be useful,
3086 but WITHOUT ANY WARRANTY; without even the implied warranty of
3087 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3088 GNU General Public License for more details.
3090 You should have received a copy of the GNU General Public License
3091 along with this program; if not, write to the Free Software
3092 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3095 Also add information on how to contact you by electronic and paper mail.
3097 If the program is interactive, make it output a short notice like this
3098 when it starts in an interactive mode:
3101 Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
3102 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
3103 type `show w'. This is free software, and you are welcome
3104 to redistribute it under certain conditions; type `show c'
3108 The hypothetical commands @samp{show w} and @samp{show c} should show
3109 the appropriate parts of the General Public License. Of course, the
3110 commands you use may be called something other than @samp{show w} and
3111 @samp{show c}; they could even be mouse-clicks or menu items---whatever
3114 You should also get your employer (if you work as a programmer) or your
3115 school, if any, to sign a ``copyright disclaimer'' for the program, if
3116 necessary. Here is a sample; alter the names:
3120 Yoyodyne, Inc., hereby disclaims all copyright
3121 interest in the program `Gnomovision'
3122 (which makes passes at compilers) written
3125 @var{signature of Ty Coon}, 1 April 1989
3126 Ty Coon, President of Vice
3130 This General Public License does not permit incorporating your program into
3131 proprietary programs. If your program is a subroutine library, you may
3132 consider it more useful to permit linking proprietary applications with the
3133 library. If this is what you want to do, use the GNU Library General
3134 Public License instead of this License.
3136 @node Concept Index, , Copying, Top
3137 @unnumbered Concept Index