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.
20 @dircategory Net Utilities
21 @dircategory World Wide Web
23 * Wget: (wget). The non-interactive network downloader.
27 This file documents the the GNU Wget utility for downloading network
30 Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
32 Permission is granted to make and distribute verbatim copies of
33 this manual provided the copyright notice and this permission notice
34 are preserved on all copies.
37 Permission is granted to process this file through TeX and print the
38 results, provided the printed document carries a copying permission
39 notice identical to this one except for the removal of this paragraph
40 (this paragraph not being relevant to the printed manual).
42 Permission is granted to copy and distribute modified versions of this
43 manual under the conditions for verbatim copying, provided also that the
44 sections entitled ``Copying'' and ``GNU General Public License'' are
45 included exactly as in the original, and provided that the entire
46 resulting derived work is distributed under the terms of a permission
47 notice identical to this one.
52 @subtitle The noninteractive downloading utility
53 @subtitle Updated for Wget @value{VERSION}, @value{UPDATED}
54 @author by Hrvoje Nik@v{s}i@'{c}
57 @vskip 0pt plus 1filll
58 Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc.
60 Permission is granted to make and distribute verbatim copies of this
61 manual provided the copyright notice and this permission notice are
62 preserved on all copies.
64 Permission is granted to copy and distribute modified versions of this
65 manual under the conditions for verbatim copying, provided also that the
66 sections entitled ``Copying'' and ``GNU General Public License'' are
67 included exactly as in the original, and provided that the entire
68 resulting derived work is distributed under the terms of a permission
69 notice identical to this one.
71 Permission is granted to copy and distribute translations of this manual
72 into another language, under the above conditions for modified versions,
73 except that this permission notice may be stated in a translation
74 approved by the Free Software Foundation.
78 @node Top, Overview, (dir), (dir)
79 @top Wget @value{VERSION}
81 This manual documents version @value{VERSION} of GNU Wget, the freely
82 available utility for network download.
84 Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc.
87 * Overview:: Features of Wget.
88 * Invoking:: Wget command-line arguments.
89 * Recursive Retrieval:: Description of recursive retrieval.
90 * Following Links:: The available methods of chasing links.
91 * Time-Stamping:: Mirroring according to time-stamps.
92 * Startup File:: Wget's initialization file.
93 * Examples:: Examples of usage.
94 * Various:: The stuff that doesn't fit anywhere else.
95 * Appendices:: Some useful references.
96 * Copying:: You may give out copies of Wget.
97 * Concept Index:: Topics covered by this manual.
101 @node Overview, Invoking, Top, Top
106 GNU Wget is a freely available network utility to retrieve files from
107 the World Wide Web, using @sc{http} (Hyper Text Transfer Protocol) and
108 @sc{ftp} (File Transfer Protocol), the two most widely used Internet
109 protocols. It has many useful features to make downloading easier, some
114 Wget is non-interactive, meaning that it can work in the background,
115 while the user is not logged on. This allows you to start a retrieval
116 and disconnect from the system, letting Wget finish the work. By
117 contrast, most of the Web browsers require constant user's presence,
118 which can be a great hindrance when transferring a lot of data.
122 Wget is capable of descending recursively through the structure of
123 @sc{html} documents and @sc{ftp} directory trees, making a local copy of
124 the directory hierarchy similar to the one on the remote server. This
125 feature can be used to mirror archives and home pages, or traverse the
126 web in search of data, like a @sc{www} robot (@xref{Robots}). In that
127 spirit, Wget understands the @code{norobots} convention.
131 File name wildcard matching and recursive mirroring of directories are
132 available when retrieving via @sc{ftp}. Wget can read the time-stamp
133 information given by both @sc{http} and @sc{ftp} servers, and store it
134 locally. Thus Wget can see if the remote file has changed since last
135 retrieval, and automatically retrieve the new version if it has. This
136 makes Wget suitable for mirroring of @sc{ftp} sites, as well as home
141 Wget works exceedingly well on slow or unstable connections,
142 retrying the document until it is fully retrieved, or until a
143 user-specified retry count is surpassed. It will try to resume the
144 download from the point of interruption, using @code{REST} with @sc{ftp}
145 and @code{Range} with @sc{http} servers that support them.
149 By default, Wget supports proxy servers, which can lighten the network
150 load, speed up retrieval and provide access behind firewalls. However,
151 if you are behind a firewall that requires that you use a socks style
152 gateway, you can get the socks library and build wget with support for
153 socks. Wget also supports the passive @sc{ftp} downloading as an
158 Builtin features offer mechanisms to tune which links you wish to follow
159 (@xref{Following Links}).
163 The retrieval is conveniently traced with printing dots, each dot
164 representing a fixed amount of data received (1KB by default). These
165 representations can be customized to your preferences.
169 Most of the features are fully configurable, either through command line
170 options, or via the initialization file @file{.wgetrc} (@xref{Startup
171 File}). Wget allows you to define @dfn{global} startup files
172 (@file{/usr/local/etc/wgetrc} by default) for site settings.
176 Finally, GNU Wget is free software. This means that everyone may use
177 it, redistribute it and/or modify it under the terms of the GNU General
178 Public License, as published by the Free Software Foundation
182 @node Invoking, Recursive Retrieval, Overview, Top
189 By default, Wget is very simple to invoke. The basic syntax is:
192 wget [@var{option}]@dots{} [@var{URL}]@dots{}
195 Wget will simply download all the @sc{url}s specified on the command
196 line. @var{URL} is a @dfn{Uniform Resource Locator}, as defined below.
198 However, you may wish to change some of the default parameters of
199 Wget. You can do it two ways: permanently, adding the appropriate
200 command to @file{.wgetrc} (@xref{Startup File}), or specifying it on
206 * Basic Startup Options::
207 * Logging and Input File Options::
209 * Directory Options::
212 * Recursive Retrieval Options::
213 * Recursive Accept/Reject Options::
216 @node URL Format, Option Syntax, Invoking, Invoking
221 @dfn{URL} is an acronym for Uniform Resource Locator. A uniform
222 resource locator is a compact string representation for a resource
223 available via the Internet. Wget recognizes the @sc{url} syntax as per
224 @sc{rfc1738}. This is the most widely used form (square brackets denote
228 http://host[:port]/directory/file
229 ftp://host[:port]/directory/file
232 You can also encode your username and password within a @sc{url}:
235 ftp://user:password@@host/path
236 http://user:password@@host/path
239 Either @var{user} or @var{password}, or both, may be left out. If you
240 leave out either the @sc{http} username or password, no authentication
241 will be sent. If you leave out the @sc{ftp} username, @samp{anonymous}
242 will be used. If you leave out the @sc{ftp} password, your email
243 address will be supplied as a default password.@footnote{If you have a
244 @file{.netrc} file in your home directory, password will also be
247 You can encode unsafe characters in a @sc{url} as @samp{%xy}, @code{xy}
248 being the hexadecimal representation of the character's @sc{ascii}
249 value. Some common unsafe characters include @samp{%} (quoted as
250 @samp{%25}), @samp{:} (quoted as @samp{%3A}), and @samp{@@} (quoted as
251 @samp{%40}). Refer to @sc{rfc1738} for a comprehensive list of unsafe
254 Wget also supports the @code{type} feature for @sc{ftp} @sc{url}s. By
255 default, @sc{ftp} documents are retrieved in the binary mode (type
256 @samp{i}), which means that they are downloaded unchanged. Another
257 useful mode is the @samp{a} (@dfn{ASCII}) mode, which converts the line
258 delimiters between the different operating systems, and is thus useful
259 for text files. Here is an example:
262 ftp://host/directory/file;type=a
265 Two alternative variants of @sc{url} specification are also supported,
266 because of historical (hysterical?) reasons and their wide-spreadedness.
268 @sc{ftp}-only syntax (supported by @code{NcFTP}):
273 @sc{http}-only syntax (introduced by @code{Netscape}):
278 These two alternative forms are deprecated, and may cease being
279 supported in the future.
281 If you do not understand the difference between these notations, or do
282 not know which one to use, just use the plain ordinary format you use
283 with your favorite browser, like @code{Lynx} or @code{Netscape}.
285 @node Option Syntax, Basic Startup Options, URL Format, Invoking
286 @section Option Syntax
287 @cindex option syntax
288 @cindex syntax of options
290 Since Wget uses GNU getopts to process its arguments, every option has a
291 short form and a long form. Long options are more convenient to
292 remember, but take time to type. You may freely mix different option
293 styles, or specify options after the command-line arguments. Thus you
297 wget -r --tries=10 http://fly.cc.fer.hr/ -o log
300 The space between the option accepting an argument and the argument may
301 be omitted. Instead @samp{-o log} you can write @samp{-olog}.
303 You may put several options that do not require arguments together,
310 This is a complete equivalent of:
313 wget -d -r -c @var{URL}
316 Since the options can be specified after the arguments, you may
317 terminate them with @samp{--}. So the following will try to download
318 @sc{url} @samp{-x}, reporting failure to @file{log}:
324 The options that accept comma-separated lists all respect the convention
325 that specifying an empty list clears its value. This can be useful to
326 clear the @file{.wgetrc} settings. For instance, if your @file{.wgetrc}
327 sets @code{exclude_directories} to @file{/cgi-bin}, the following
328 example will first reset it, and then set it to exclude @file{/~nobody}
329 and @file{/~somebody}. You can also clear the lists in @file{.wgetrc}
330 (@xref{Wgetrc Syntax}).
333 wget -X '' -X /~nobody,/~somebody
336 @node Basic Startup Options, Logging and Input File Options, Option Syntax, Invoking
337 @section Basic Startup Options
342 Display the version of Wget.
346 Print a help message describing all of Wget's command-line options.
350 Go to background immediately after startup. If no output file is
351 specified via the @samp{-o}, output is redirected to @file{wget-log}.
353 @cindex execute wgetrc command
354 @item -e @var{command}
355 @itemx --execute @var{command}
356 Execute @var{command} as if it were a part of @file{.wgetrc}
357 (@xref{Startup File}). A command thus invoked will be executed
358 @emph{after} the commands in @file{.wgetrc}, thus taking precedence over
362 @node Logging and Input File Options, Download Options, Basic Startup Options, Invoking
363 @section Logging and Input File Options
368 @item -o @var{logfile}
369 @itemx --output-file=@var{logfile}
370 Log all messages to @var{logfile}. The messages are normally reported
373 @cindex append to log
374 @item -a @var{logfile}
375 @itemx --append-output=@var{logfile}
376 Append to @var{logfile}. This is the same as @samp{-o}, only it appends
377 to @var{logfile} instead of overwriting the old log file. If
378 @var{logfile} does not exist, a new file is created.
383 Turn on debug output, meaning various information important to the
384 developers of Wget if it does not work properly. Your system
385 administrator may have chosen to compile Wget without debug support, in
386 which case @samp{-d} will not work. Please note that compiling with
387 debug support is always safe---Wget compiled with the debug support will
388 @emph{not} print any debug info unless requested with @samp{-d}.
389 @xref{Reporting Bugs} for more information on how to use @samp{-d} for
395 Turn off Wget's output.
400 Turn on verbose output, with all the available data. The default output
405 Non-verbose output---turn off verbose without being completely quiet
406 (use @samp{-q} for that), which means that error messages and basic
407 information still get printed.
411 @itemx --input-file=@var{file}
412 Read @sc{url}s from @var{file}, in which case no @sc{url}s need to be on
413 the command line. If there are @sc{url}s both on the command line and
414 in an input file, those on the command lines will be the first ones to
415 be retrieved. The @var{file} need not be an @sc{html} document (but no
416 harm if it is)---it is enough if the @sc{url}s are just listed
419 However, if you specify @samp{--force-html}, the document will be
420 regarded as @samp{html}. In that case you may have problems with
421 relative links, which you can solve either by adding @code{<base
422 href="@var{url}">} to the documents or by specifying
423 @samp{--base=@var{url}} on the command line.
428 When input is read from a file, force it to be treated as an @sc{html}
429 file. This enables you to retrieve relative links from existing
430 @sc{html} files on your local disk, by adding @code{<base
431 href="@var{url}">} to @sc{html}, or using the @samp{--base} command-line
435 @node Download Options, Directory Options, Logging and Input File Options, Invoking
436 @section Download Options
441 @cindex number of retries
442 @item -t @var{number}
443 @itemx --tries=@var{number}
444 Set number of retries to @var{number}. Specify 0 or @samp{inf} for
448 @itemx --output-document=@var{file}
449 The documents will not be written to the appropriate files, but all will
450 be concatenated together and written to @var{file}. If @var{file}
451 already exists, it will be overwritten. If the @var{file} is @samp{-},
452 the documents will be written to standard output. Including this option
453 automatically sets the number of tries to 1.
458 Do not clobber existing files when saving to directory hierarchy within
459 recursive retrieval of several files. This option is @emph{extremely}
460 useful when you wish to continue where you left off with retrieval of
461 many files. If the files have the @samp{.html} or (yuck) @samp{.htm}
462 suffix, they will be loaded from the local disk, and parsed as if they
463 have been retrieved from the Web.
465 @cindex continue retrieval
468 Continue getting an existing file. This is useful when you want to
469 finish up the download started by another program, or a previous
470 instance of Wget. Thus you can write:
473 wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
476 If there is a file name @file{ls-lR.Z} in the current directory, Wget
477 will assume that it is the first portion of the remote file, and will
478 require the server to continue the retrieval from an offset equal to the
479 length of the local file.
481 Note that you need not specify this option if all you want is Wget to
482 continue retrieving where it left off when the connection is lost---Wget
483 does this by default. You need this option only when you want to
484 continue retrieval of a file already halfway retrieved, saved by another
485 @sc{ftp} client, or left by Wget being killed.
487 Without @samp{-c}, the previous example would just begin to download the
488 remote file to @file{ls-lR.Z.1}. The @samp{-c} option is also
489 applicable for @sc{http} servers that support the @code{Range} header.
492 @cindex retrieval tracing style
493 @item --dot-style=@var{style}
494 Set the retrieval style to @var{style}. Wget traces the retrieval of
495 each document by printing dots on the screen, each dot representing a
496 fixed amount of retrieved data. Any number of dots may be separated in
497 a @dfn{cluster}, to make counting easier. This option allows you to
498 choose one of the pre-defined styles, determining the number of bytes
499 represented by a dot, the number of dots in a cluster, and the number of
502 With the @code{default} style each dot represents 1K, there are ten dots
503 in a cluster and 50 dots in a line. The @code{binary} style has a more
504 ``computer''-like orientation---8K dots, 16-dots clusters and 48 dots
505 per line (which makes for 384K lines). The @code{mega} style is
506 suitable for downloading very large files---each dot represents 64K
507 retrieved, there are eight dots in a cluster, and 48 dots on each line
508 (so each line contains 3M). The @code{micro} style is exactly the
509 reverse; it is suitable for downloading small files, with 128-byte dots,
510 8 dots per cluster, and 48 dots (6K) per line.
513 @itemx --timestamping
514 Turn on time-stamping. @xref{Time-Stamping} for details.
516 @cindex server response, print
518 @itemx --server-response
519 Print the headers sent by @sc{http} servers and responses sent by
522 @cindex Wget as spider
525 When invoked with this option, Wget will behave as a Web @dfn{spider},
526 which means that it will not download the pages, just check that they
527 are there. You can use it to check your bookmarks, e.g. with:
530 wget --spider --force-html -i bookmarks.html
533 This feature needs much more work for Wget to get close to the
534 functionality of real @sc{www} spiders.
538 @itemx --timeout=@var{seconds}
539 Set the read timeout to @var{seconds} seconds. Whenever a network read
540 is issued, the file descriptor is checked for a timeout, which could
541 otherwise leave a pending connection (uninterrupted read). The default
542 timeout is 900 seconds (fifteen minutes). Setting timeout to 0 will
543 disable checking for timeouts.
545 Please do not lower the default timeout value with this option unless
546 you know what you are doing.
550 @item -w @var{seconds}
551 @itemx --wait=@var{seconds}
552 Wait the specified number of seconds between the retrievals. Use of
553 this option is recommended, as it lightens the server load by making the
554 requests less frequent. Instead of in seconds, the time can be
555 specified in minutes using the @code{m} suffix, in hours using @code{h}
556 suffix, or in days using @code{d} suffix.
558 Specifying a large value for this option is useful if the network or the
559 destination host is down, so that Wget can wait long enough to
560 reasonably expect the network error to be fixed before the retry.
564 @itemx --proxy=on/off
565 Turn proxy support on or off. The proxy is on by default if the
566 appropriate environmental variable is defined.
570 @itemx --quota=@var{quota}
571 Specify download quota for automatic retrievals. The value can be
572 specified in bytes (default), kilobytes (with @samp{k} suffix), or
573 megabytes (with @samp{m} suffix).
575 Note that quota will never affect downloading a single file. So if you
576 specify @samp{wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz}, all of the
577 @file{ls-lR.gz} will be downloaded. The same goes even when several
578 @sc{url}s are specified on the command-line. However, quota is
579 respected when retrieving either recursively, or from an input file.
580 Thus you may safely type @samp{wget -Q2m -i sites}---download will be
581 aborted when the quota is exceeded.
583 Setting quota to 0 or to @samp{inf} unlimits the download quota.
586 @node Directory Options, HTTP Options, Download Options, Invoking
587 @section Directory Options
591 @itemx --no-directories
592 Do not create a hierarchy of directories when retrieving
593 recursively. With this option turned on, all files will get saved to the
594 current directory, without clobbering (if a name shows up more than
595 once, the filenames will get extensions @samp{.n}).
598 @itemx --force-directories
599 The opposite of @samp{-nd}---create a hierarchy of directories, even if
600 one would not have been created otherwise. E.g. @samp{wget -x
601 http://fly.cc.fer.hr/robots.txt} will save the downloaded file to
602 @file{fly.cc.fer.hr/robots.txt}.
605 @itemx --no-host-directories
606 Disable generation of host-prefixed directories. By default, invoking
607 Wget with @samp{-r http://fly.cc.fer.hr/} will create a structure of
608 directories beginning with @file{fly.cc.fer.hr/}. This option disables
611 @cindex cut directories
612 @item --cut-dirs=@var{number}
613 Ignore @var{number} directory components. This is useful for getting a
614 fine-grained control over the directory where recursive retrieval will
617 Take, for example, the directory at
618 @samp{ftp://ftp.xemacs.org/pub/xemacs/}. If you retrieve it with
619 @samp{-r}, it will be saved locally under
620 @file{ftp.xemacs.org/pub/xemacs/}. While the @samp{-nH} option can
621 remove the @file{ftp.xemacs.org/} part, you are still stuck with
622 @file{pub/xemacs}. This is where @samp{--cut-dirs} comes in handy; it
623 makes Wget not ``see'' @var{number} remote directory components. Here
624 are several examples of how @samp{--cut-dirs} option works.
628 No options -> ftp.xemacs.org/pub/xemacs/
630 -nH --cut-dirs=1 -> xemacs/
631 -nH --cut-dirs=2 -> .
633 --cut-dirs=1 -> ftp.xemacs.org/xemacs/
638 If you just want to get rid of the directory structure, this option is
639 similar to a combination of @samp{-nd} and @samp{-P}. However, unlike
640 @samp{-nd}, @samp{--cut-dirs} does not lose with subdirectories---for
641 instance, with @samp{-nH --cut-dirs=1}, a @file{beta/} subdirectory will
642 be placed to @file{xemacs/beta}, as one would expect.
644 @cindex directory prefix
645 @item -P @var{prefix}
646 @itemx --directory-prefix=@var{prefix}
647 Set directory prefix to @var{prefix}. The @dfn{directory prefix} is the
648 directory where all other files and subdirectories will be saved to,
649 i.e. the top of the retrieval tree. The default is @samp{.} (the
653 @node HTTP Options, FTP Options, Directory Options, Invoking
654 @section HTTP Options
658 @cindex http password
659 @cindex authentication
660 @item --http-user=@var{user}
661 @itemx --http-passwd=@var{password}
662 Specify the username @var{user} and password @var{password} on an
663 @sc{http} server. According to the type of the challenge, Wget will
664 encode them using either the @code{basic} (insecure) or the
665 @code{digest} authentication scheme.
667 Another way to specify username and password is in the @sc{url} itself
668 (@xref{URL Format}). For more information about security issues with
669 Wget, @xref{Security Considerations}.
674 @itemx --cache=on/off
675 When set to off, disable server-side cache. In this case, Wget will
676 send the remote server an appropriate directive (@samp{Pragma:
677 no-cache}) to get the file from the remote service, rather than
678 returning the cached version. This is especially useful for retrieving
679 and flushing out-of-date documents on proxy servers.
681 Caching is allowed by default.
683 @cindex Content-Length, ignore
684 @cindex ignore length
685 @item --ignore-length
686 Unfortunately, some @sc{http} servers (@sc{cgi} programs, to be more
687 precise) send out bogus @code{Content-Length} headers, which makes Wget
688 go wild, as it thinks not all the document was retrieved. You can spot
689 this syndrome if Wget retries getting the same document again and again,
690 each time claiming that the (otherwise normal) connection has closed on
693 With this option, Wget will ignore the @code{Content-Length} header---as
697 @item --header=@var{additional-header}
698 Define an @var{additional-header} to be passed to the @sc{http} servers.
699 Headers must contain a @samp{:} preceded by one or more non-blank
700 characters, and must not contain newlines.
702 You may define more than one additional header by specifying
703 @samp{--header} more than once.
707 wget --header='Accept-Charset: iso-8859-2' \
708 --header='Accept-Language: hr' \
709 http://fly.cc.fer.hr/
713 Specification of an empty string as the header value will clear all
714 previous user-defined headers.
717 @cindex proxy password
718 @cindex proxy authentication
719 @item --proxy-user=@var{user}
720 @itemx --proxy-passwd=@var{password}
721 Specify the username @var{user} and password @var{password} for
722 authentication on a proxy server. Wget will encode them using the
723 @code{basic} authentication scheme.
725 @cindex server response, save
727 @itemx --save-headers
728 Save the headers sent by the @sc{http} server to the file, preceding the
729 actual contents, with an empty line as the separator.
732 @item -U @var{agent-string}
733 @itemx --user-agent=@var{agent-string}
734 Identify as @var{agent-string} to the @sc{http} server.
736 The @sc{http} protocol allows the clients to identify themselves using a
737 @code{User-Agent} header field. This enables distinguishing the
738 @sc{www} software, usually for statistical purposes or for tracing of
739 protocol violations. Wget normally identifies as
740 @samp{Wget/@var{version}}, @var{version} being the current version
743 However, some sites have been known to impose the policy of tailoring
744 the output according to the @code{User-Agent}-supplied information.
745 While conceptually this is not such a bad idea, it has been abused by
746 servers denying information to clients other than @code{Mozilla} or
747 Microsoft @code{Internet Explorer}. This option allows you to change
748 the @code{User-Agent} line issued by Wget. Use of this option is
749 discouraged, unless you really know what you are doing.
751 @strong{NOTE} that Netscape Communications Corp. has claimed that false
752 transmissions of @samp{Mozilla} as the @code{User-Agent} are a copyright
753 infringement, which will be prosecuted. @strong{DO NOT} misrepresent
757 @node FTP Options, Recursive Retrieval Options, HTTP Options, Invoking
761 @cindex retrieve symbolic links
762 @item --retr-symlinks
763 Retrieve symbolic links on @sc{ftp} sites as if they were plain files,
764 i.e. don't just create links locally.
766 @cindex globbing, toggle
769 Turn @sc{ftp} globbing on or off. Globbing means you may use the
770 shell-like special characters (@dfn{wildcards}), like @samp{*},
771 @samp{?}, @samp{[} and @samp{]} to retrieve more than one file from the
772 same directory at once, like:
775 wget ftp://gnjilux.cc.fer.hr/*.msg
778 By default, globbing will be turned on if the @sc{url} contains a
779 globbing character. This option may be used to turn globbing on or off
782 You may have to quote the @sc{url} to protect it from being expanded by
783 your shell. Globbing makes Wget look for a directory listing, which is
784 system-specific. This is why it currently works only with Unix @sc{ftp}
785 servers (and the ones emulating Unix @code{ls} output).
789 Use the @dfn{passive} @sc{ftp} retrieval scheme, in which the client
790 initiates the data connection. This is sometimes required for @sc{ftp}
791 to work behind firewalls.
794 @node Recursive Retrieval Options, Recursive Accept/Reject Options, FTP Options, Invoking
795 @section Recursive Retrieval Options
800 Turn on recursive retrieving. @xref{Recursive Retrieval} for more
804 @itemx --level=@var{depth}
805 Specify recursion maximum depth level @var{depth} (@xref{Recursive
806 Retrieval}). The default maximum depth is 5.
808 @cindex proxy filling
809 @cindex delete after retrieval
810 @cindex filling proxy cache
812 This option tells Wget to delete every single file it downloads,
813 @emph{after} having done so. It is useful for pre-fetching popular
814 pages through proxy, e.g.:
817 wget -r -nd --delete-after http://whatever.com/~popular/page/
820 The @samp{-r} option is to retrieve recursively, and @samp{-nd} not to
823 @cindex conversion of links
824 @cindex links conversion
826 @itemx --convert-links
827 Convert the non-relative links to relative ones locally. Only the
828 references to the documents actually downloaded will be converted; the
829 rest will be left unchanged.
831 Note that only at the end of the download can Wget know which links have
832 been downloaded. Because of that, much of the work done by @samp{-k}
833 will be performed at the end of the downloads.
837 Turn on options suitable for mirroring. This option turns on recursion
838 and time-stamping, sets infinite recursion depth and keeps @sc{ftp}
839 directory listings. It is currently equivalent to
840 @samp{-r -N -l inf -nr}.
843 @itemx --dont-remove-listing
844 Don't remove the temporary @file{.listing} files generated by @sc{ftp}
845 retrievals. Normally, these files contain the raw directory listings
846 received from @sc{ftp} servers. Not removing them can be useful to
847 access the full remote file list when running a mirror, or for debugging
851 @node Recursive Accept/Reject Options, , Recursive Retrieval Options, Invoking
852 @section Recursive Accept/Reject Options
855 @item -A @var{acclist} --accept @var{acclist}
856 @itemx -R @var{rejlist} --reject @var{rejlist}
857 Specify comma-separated lists of file name suffixes or patterns to
858 accept or reject (@xref{Types of Files} for more details).
860 @item -D @var{domain-list}
861 @itemx --domains=@var{domain-list}
862 Set domains to be accepted and @sc{dns} looked-up, where
863 @var{domain-list} is a comma-separated list. Note that it does
864 @emph{not} turn on @samp{-H}. This option speeds things up, even if
865 only one host is spanned (@xref{Domain Acceptance}).
867 @item --exclude-domains @var{domain-list}
868 Exclude the domains given in a comma-separated @var{domain-list} from
869 @sc{dns}-lookup (@xref{Domain Acceptance}).
873 Follow relative links only. Useful for retrieving a specific home page
874 without any distractions, not even those from the same hosts
875 (@xref{Relative Links}).
877 @cindex follow FTP links
879 Follow @sc{ftp} links from @sc{html} documents. Without this option,
880 Wget will ignore all the @sc{ftp} links.
884 Enable spanning across hosts when doing recursive retrieving (@xref{All
888 @itemx --include-directories=@var{list}
889 Specify a comma-separated list of directories you wish to follow when
890 downloading (@xref{Directory-Based Limits} for more details.) Elements
891 of @var{list} may contain wildcards.
894 @itemx --exclude-directories=@var{list}
895 Specify a comma-separated list of directories you wish to exclude from
896 download (@xref{Directory-Based Limits} for more details.) Elements of
897 @var{list} may contain wildcards.
900 @itemx --no-host-lookup
901 Disable the time-consuming @sc{dns} lookup of almost all hosts
902 (@xref{Host Checking}).
906 Do not ever ascend to the parent directory when retrieving recursively.
907 This is a useful option, since it guarantees that only the files
908 @emph{below} a certain hierarchy will be downloaded.
909 @xref{Directory-Based Limits} for more details.
912 @node Recursive Retrieval, Following Links, Invoking, Top
913 @chapter Recursive Retrieval
916 @cindex recursive retrieval
918 GNU Wget is capable of traversing parts of the Web (or a single
919 @sc{http} or @sc{ftp} server), depth-first following links and directory
920 structure. This is called @dfn{recursive} retrieving, or
923 With @sc{http} @sc{url}s, Wget retrieves and parses the @sc{html} from
924 the given @sc{url}, documents, retrieving the files the @sc{html}
925 document was referring to, through markups like @code{href}, or
926 @code{src}. If the freshly downloaded file is also of type
927 @code{text/html}, it will be parsed and followed further.
929 The maximum @dfn{depth} to which the retrieval may descend is specified
930 with the @samp{-l} option (the default maximum depth is five layers).
931 @xref{Recursive Retrieval}.
933 When retrieving an @sc{ftp} @sc{url} recursively, Wget will retrieve all
934 the data from the given directory tree (including the subdirectories up
935 to the specified depth) on the remote server, creating its mirror image
936 locally. @sc{ftp} retrieval is also limited by the @code{depth}
939 By default, Wget will create a local directory tree, corresponding to
940 the one found on the remote server.
942 Recursive retrieving can find a number of applications, the most
943 important of which is mirroring. It is also useful for @sc{www}
944 presentations, and any other opportunities where slow network
945 connections should be bypassed by storing the files locally.
947 You should be warned that invoking recursion may cause grave overloading
948 on your system, because of the fast exchange of data through the
949 network; all of this may hamper other users' work. The same stands for
950 the foreign server you are mirroring---the more requests it gets in a
951 rows, the greater is its load.
953 Careless retrieving can also fill your file system unctrollably, which
954 can grind the machine to a halt.
956 The load can be minimized by lowering the maximum recursion level
957 (@samp{-l}) and/or by lowering the number of retries (@samp{-t}). You
958 may also consider using the @samp{-w} option to slow down your requests
959 to the remote servers, as well as the numerous options to narrow the
960 number of followed links (@xref{Following Links}).
962 Recursive retrieval is a good thing when used properly. Please take all
963 precautions not to wreak havoc through carelessness.
965 @node Following Links, Time-Stamping, Recursive Retrieval, Top
966 @chapter Following Links
968 @cindex following links
970 When retrieving recursively, one does not wish to retrieve the loads of
971 unnecessary data. Most of the time the users bear in mind exactly what
972 they want to download, and want Wget to follow only specific links.
974 For example, if you wish to download the music archive from
975 @samp{fly.cc.fer.hr}, you will not want to download all the home pages
976 that happen to be referenced by an obscure part of the archive.
978 Wget possesses several mechanisms that allows you to fine-tune which
979 links it will follow.
982 * Relative Links:: Follow relative links only.
983 * Host Checking:: Follow links on the same host.
984 * Domain Acceptance:: Check on a list of domains.
985 * All Hosts:: No host restrictions.
986 * Types of Files:: Getting only certain files.
987 * Directory-Based Limits:: Getting only certain directories.
988 * FTP Links:: Following FTP links.
991 @node Relative Links, Host Checking, Following Links, Following Links
992 @section Relative Links
993 @cindex relative links
995 When only relative links are followed (option @samp{-L}), recursive
996 retrieving will never span hosts. No time-expensive @sc{dns}-lookups
997 will be performed, and the process will be very fast, with the minimum
998 strain of the network. This will suit your needs often, especially when
999 mirroring the output of various @code{x2html} converters, since they
1000 generally output relative links.
1002 @node Host Checking, Domain Acceptance, Relative Links, Following Links
1003 @section Host Checking
1006 @cindex host checking
1008 The drawback of following the relative links solely is that humans often
1009 tend to mix them with absolute links to the very same host, and the very
1010 same page. In this mode (which is the default mode for following links)
1011 all @sc{url}s the that refer to the same host will be retrieved.
1013 The problem with this option are the aliases of the hosts and domains.
1014 Thus there is no way for Wget to know that @samp{regoc.srce.hr} and
1015 @samp{www.srce.hr} are the same host, or that @samp{fly.cc.fer.hr} is
1016 the same as @samp{fly.cc.etf.hr}. Whenever an absolute link is
1017 encountered, the host is @sc{dns}-looked-up with @code{gethostbyname} to
1018 check whether we are maybe dealing with the same hosts. Although the
1019 results of @code{gethostbyname} are cached, it is still a great
1020 slowdown, e.g. when dealing with large indices of home pages on different
1021 hosts (because each of the hosts must be and @sc{dns}-resolved to see
1022 whether it just @emph{might} an alias of the starting host).
1024 To avoid the overhead you may use @samp{-nh}, which will turn off
1025 @sc{dns}-resolving and make Wget compare hosts literally. This will
1026 make things run much faster, but also much less reliable
1027 (e.g. @samp{www.srce.hr} and @samp{regoc.srce.hr} will be flagged as
1030 Note that modern @sc{http} servers allows one IP address to host several
1031 @dfn{virtual servers}, each having its own directory hieratchy. Such
1032 ``servers'' are distinguished by their hostnames (all of which point to
1033 the same IP address); for this to work, a client must send a @code{Host}
1034 header, which is what Wget does. However, in that case Wget @emph{must
1035 not} try to divine a host's ``real'' address, nor try to use the same
1036 hostname for each access, i.e. @samp{-nh} must be turned on.
1038 In other words, the @samp{-nh} option must be used to enabling the
1039 retrieval from virtual servers distinguished by their hostnames. As the
1040 number of such server setups grow, the behavior of @samp{-nh} may become
1041 the default in the future.
1043 @node Domain Acceptance, All Hosts, Host Checking, Following Links
1044 @section Domain Acceptance
1046 With the @samp{-D} option you may specify the domains that will be
1047 followed. The hosts the domain of which is not in this list will not be
1048 @sc{dns}-resolved. Thus you can specify @samp{-Dmit.edu} just to make
1049 sure that @strong{nothing outside of @sc{mit} gets looked up}. This is
1050 very important and useful. It also means that @samp{-D} does @emph{not}
1051 imply @samp{-H} (span all hosts), which must be specified explicitly.
1052 Feel free to use this options since it will speed things up, with almost
1053 all the reliability of checking for all hosts. Thus you could invoke
1056 wget -r -D.hr http://fly.cc.fer.hr/
1059 to make sure that only the hosts in @samp{.hr} domain get
1060 @sc{dns}-looked-up for being equal to @samp{fly.cc.fer.hr}. So
1061 @samp{fly.cc.etf.hr} will be checked (only once!) and found equal, but
1062 @samp{www.gnu.ai.mit.edu} will not even be checked.
1064 Of course, domain acceptance can be used to limit the retrieval to
1065 particular domains with spanning of hosts in them, but then you must
1066 specify @samp{-H} explicitly. E.g.:
1069 wget -r -H -Dmit.edu,stanford.edu http://www.mit.edu/
1072 will start with @samp{http://www.mit.edu/}, following links across
1073 @sc{mit} and Stanford.
1075 If there are domains you want to exclude specifically, you can do it
1076 with @samp{--exclude-domains}, which accepts the same type of arguments
1077 of @samp{-D}, but will @emph{exclude} all the listed domains. For
1078 example, if you want to download all the hosts from @samp{foo.edu}
1079 domain, with the exception of @samp{sunsite.foo.edu}, you can do it like
1083 wget -rH -Dfoo.edu --exclude-domains sunsite.foo.edu http://www.foo.edu/
1086 @node All Hosts, Types of Files, Domain Acceptance, Following Links
1091 When @samp{-H} is specified without @samp{-D}, all hosts are freely
1092 spanned. There are no restrictions whatsoever as to what part of the
1093 net Wget will go to fetch documents, other than maximum retrieval depth.
1094 If a page references @samp{www.yahoo.com}, so be it. Such an option is
1095 rarely useful for itself.
1097 @node Types of Files, Directory-Based Limits, All Hosts, Following Links
1098 @section Types of Files
1099 @cindex types of files
1101 When downloading material from the web, you will often want to restrict
1102 the retrieval to only certain file types. For example, if you are
1103 interested in downloading @sc{gifs}, you will not be overjoyed to get
1104 loads of Postscript documents, and vice versa.
1106 Wget offers two options to deal with this problem. Each option
1107 description lists a short name, a long name, and the equivalent command
1110 @cindex accept wildcards
1111 @cindex accept suffixes
1112 @cindex wildcards, accept
1113 @cindex suffixes, accept
1115 @item -A @var{acclist}
1116 @itemx --accept @var{acclist}
1117 @itemx accept = @var{acclist}
1118 The argument to @samp{--accept} option is a list of file suffixes or
1119 patterns that Wget will download during recursive retrieval. A suffix
1120 is the ending part of a file, and consists of ``normal'' letters,
1121 e.g. @samp{gif} or @samp{.jpg}. A matching pattern contains shell-like
1122 wildcards, e.g. @samp{books*} or @samp{zelazny*196[0-9]*}.
1124 So, specifying @samp{wget -A gif,jpg} will make Wget download only the
1125 files ending with @samp{gif} or @samp{jpg}, i.e. @sc{gif}s and
1126 @sc{jpeg}s. On the other hand, @samp{wget -A "zelazny*196[0-9]*"} will
1127 download only files beginning with @samp{zelazny} and containing numbers
1128 from 1960 to 1969 anywhere within. Look up the manual of your shell for
1129 a description of how pattern matching works.
1131 Of course, any number of suffixes and patterns can be combined into a
1132 comma-separated list, and given as an argument to @samp{-A}.
1134 @cindex reject wildcards
1135 @cindex reject suffixes
1136 @cindex wildcards, reject
1137 @cindex suffixes, reject
1138 @item -R @var{rejlist}
1139 @itemx --reject @var{rejlist}
1140 @itemx reject = @var{rejlist}
1141 The @samp{--reject} option works the same way as @samp{--accept}, only
1142 its logic is the reverse; Wget will download all files @emph{except} the
1143 ones matching the suffixes (or patterns) in the list.
1145 So, if you want to download a whole page except for the cumbersome
1146 @sc{mpeg}s and @sc{.au} files, you can use @samp{wget -R mpg,mpeg,au}.
1147 Analogously, to download all files except the ones beginning with
1148 @samp{bjork}, use @samp{wget -R "bjork*"}. The quotes are to prevent
1149 expansion by the shell.
1152 The @samp{-A} and @samp{-R} options may be combined to achieve even
1153 better fine-tuning of which files to retrieve. E.g. @samp{wget -A
1154 "*zelazny*" -R .ps} will download all the files having @samp{zelazny} as
1155 a part of their name, but @emph{not} the postscript files.
1157 Note that these two options do not affect the downloading of @sc{html}
1158 files; Wget must load all the @sc{html}s to know where to go at
1159 all---recursive retrieval would make no sense otherwise.
1161 @node Directory-Based Limits, FTP Links, Types of Files, Following Links
1162 @section Directory-Based Limits
1164 @cindex directory limits
1166 Regardless of other link-following facilities, it is often useful to
1167 place the restriction of what files to retrieve based on the directories
1168 those files are placed in. There can be many reasons for this---the
1169 home pages may be organized in a reasonable directory structure; or some
1170 directories may contain useless information, e.g. @file{/cgi-bin} or
1171 @file{/dev} directories.
1173 Wget offers three different options to deal with this requirement. Each
1174 option description lists a short name, a long name, and the equivalent
1175 command in @file{.wgetrc}.
1177 @cindex directories, include
1178 @cindex include directories
1179 @cindex accept directories
1182 @itemx --include @var{list}
1183 @itemx include_directories = @var{list}
1184 @samp{-I} option accepts a comma-separated list of directories included
1185 in the retrieval. Any other directories will simply be ignored. The
1186 directories are absolute paths.
1188 So, if you wish to download from @samp{http://host/people/bozo/}
1189 following only links to bozo's colleagues in the @file{/people}
1190 directory and the bogus scripts in @file{/cgi-bin}, you can specify:
1193 wget -I /people,/cgi-bin http://host/people/bozo/
1196 @cindex directories, exclude
1197 @cindex exclude directories
1198 @cindex reject directories
1200 @itemx --exclude @var{list}
1201 @itemx exclude_directories = @var{list}
1202 @samp{-X} option is exactly the reverse of @samp{-I}---this is a list of
1203 directories @emph{excluded} from the download. E.g. if you do not want
1204 Wget to download things from @file{/cgi-bin} directory, specify @samp{-X
1205 /cgi-bin} on the command line.
1207 The same as with @samp{-A}/@samp{-R}, these two options can be combined
1208 to get a better fine-tuning of downloading subdirectories. E.g. if you
1209 want to load all the files from @file{/pub} hierarchy except for
1210 @file{/pub/worthless}, specify @samp{-I/pub -X/pub/worthless}.
1215 @itemx no_parent = on
1216 The simplest, and often very useful way of limiting directories is
1217 disallowing retrieval of the links that refer to the hierarchy
1218 @dfn{upper} than the beginning directory, i.e. disallowing ascent to the
1219 parent directory/directories.
1221 The @samp{--no-parent} option (short @samp{-np}) is useful in this case.
1222 Using it guarantees that you will never leave the existing hierarchy.
1223 Supposing you issue Wget with:
1226 wget -r --no-parent http://somehost/~luzer/my-archive/
1229 You may rest assured that none of the references to
1230 @file{/~his-girls-homepage/} or @file{/~luzer/all-my-mpegs/} will be
1231 followed. Only the archive you are interested in will be downloaded.
1232 Essentially, @samp{--no-parent} is similar to
1233 @samp{-I/~luzer/my-archive}, only it handles redirections in a more
1234 intelligent fashion.
1237 @node FTP Links, , Directory-Based Limits, Following Links
1238 @section Following FTP Links
1239 @cindex following ftp links
1241 The rules for @sc{ftp} are somewhat specific, as it is necessary for
1242 them to be. @sc{ftp} links in @sc{html} documents are often included
1243 for purposes of reference, and it is often inconvenient to download them
1246 To have @sc{ftp} links followed from @sc{html} documents, you need to
1247 specify the @samp{--follow-ftp} option. Having done that, @sc{ftp}
1248 links will span hosts regardless of @samp{-H} setting. This is logical,
1249 as @sc{ftp} links rarely point to the same host where the @sc{http}
1250 server resides. For similar reasons, the @samp{-L} options has no
1251 effect on such downloads. On the other hand, domain acceptance
1252 (@samp{-D}) and suffix rules (@samp{-A} and @samp{-R}) apply normally.
1254 Also note that followed links to @sc{ftp} directories will not be
1255 retrieved recursively further.
1257 @node Time-Stamping, Startup File, Following Links, Top
1258 @chapter Time-Stamping
1259 @cindex time-stamping
1260 @cindex timestamping
1261 @cindex updating the archives
1262 @cindex incremental updating
1264 One of the most important aspects of mirroring information from the
1265 Internet is updating your archives.
1267 Downloading the whole archive again and again, just to replace a few
1268 changed files is expensive, both in terms of wasted bandwidth and money,
1269 and the time to do the update. This is why all the mirroring tools
1270 offer the option of incremental updating.
1272 Such an updating mechanism means that the remote server is scanned in
1273 search of @dfn{new} files. Only those new files will be downloaded in
1274 the place of the old ones.
1276 A file is considered new if one of these two conditions are met:
1280 A file of that name does not already exist locally.
1283 A file of that name does exist, but the remote file was modified more
1284 recently than the local file.
1287 To implement this, the program needs to be aware of the time of last
1288 modification of both remote and local files. Such information are
1289 called the @dfn{time-stamps}.
1291 The time-stamping in GNU Wget is turned on using @samp{--timestamping}
1292 (@samp{-N}) option, or through @code{timestamping = on} directive in
1293 @file{.wgetrc}. With this option, for each file it intends to download,
1294 Wget will check whether a local file of the same name exists. If it
1295 does, and the remote file is older, Wget will not download it.
1297 If the local file does not exist, or the sizes of the files do not
1298 match, Wget will download the remote file no matter what the time-stamps
1302 * Time-Stamping Usage::
1303 * HTTP Time-Stamping Internals::
1304 * FTP Time-Stamping Internals::
1307 @node Time-Stamping Usage, HTTP Time-Stamping Internals, Time-Stamping, Time-Stamping
1308 @section Time-Stamping Usage
1309 @cindex time-stamping usage
1310 @cindex usage, time-stamping
1312 The usage of time-stamping is simple. Say you would like to download a
1313 file so that it keeps its date of modification.
1316 wget -S http://www.gnu.ai.mit.edu/
1319 A simple @code{ls -l} shows that the time stamp on the local file equals
1320 the state of the @code{Last-Modified} header, as returned by the server.
1321 As you can see, the time-stamping info is preserved locally, even
1324 Several days later, you would like Wget to check if the remote file has
1325 changed, and download it if it has.
1328 wget -N http://www.gnu.ai.mit.edu/
1331 Wget will ask the server for the last-modified date. If the local file
1332 is newer, the remote file will not be re-fetched. However, if the remote
1333 file is more recent, Wget will proceed fetching it normally.
1335 The same goes for @sc{ftp}. For example:
1338 wget ftp://ftp.ifi.uio.no/pub/emacs/gnus/*
1341 @code{ls} will show that the timestamps are set according to the state
1342 on the remote server. Reissuing the command with @samp{-N} will make
1343 Wget re-fetch @emph{only} the files that have been modified.
1345 In both @sc{http} and @sc{ftp} retrieval Wget will time-stamp the local
1346 file correctly (with or without @samp{-N}) if it gets the stamps,
1347 i.e. gets the directory listing for @sc{ftp} or the @code{Last-Modified}
1348 header for @sc{http}.
1350 If you wished to mirror the GNU archive every week, you would use the
1351 following command every week:
1354 wget --timestamping -r ftp://prep.ai.mit.edu/pub/gnu/
1357 @node HTTP Time-Stamping Internals, FTP Time-Stamping Internals, Time-Stamping Usage, Time-Stamping
1358 @section HTTP Time-Stamping Internals
1359 @cindex http time-stamping
1361 Time-stamping in @sc{http} is implemented by checking of the
1362 @code{Last-Modified} header. If you wish to retrieve the file
1363 @file{foo.html} through @sc{http}, Wget will check whether
1364 @file{foo.html} exists locally. If it doesn't, @file{foo.html} will be
1365 retrieved unconditionally.
1367 If the file does exist locally, Wget will first check its local
1368 time-stamp (similar to the way @code{ls -l} checks it), and then send a
1369 @code{HEAD} request to the remote server, demanding the information on
1372 The @code{Last-Modified} header is examined to find which file was
1373 modified more recently (which makes it ``newer''). If the remote file
1374 is newer, it will be downloaded; if it is older, Wget will give
1375 up.@footnote{As an additional check, Wget will look at the
1376 @code{Content-Length} header, and compare the sizes; if they are not the
1377 same, the remote file will be downloaded no matter what the time-stamp
1380 Arguably, @sc{http} time-stamping should be implemented using the
1381 @code{If-Modified-Since} request.
1383 @node FTP Time-Stamping Internals, , HTTP Time-Stamping Internals, Time-Stamping
1384 @section FTP Time-Stamping Internals
1385 @cindex ftp time-stamping
1387 In theory, @sc{ftp} time-stamping works much the same as @sc{http}, only
1388 @sc{ftp} has no headers---time-stamps must be received from the
1391 For each directory files must be retrieved from, Wget will use the
1392 @code{LIST} command to get the listing. It will try to analyze the
1393 listing, assuming that it is a Unix @code{ls -l} listing, and extract
1394 the time-stamps. The rest is exactly the same as for @sc{http}.
1396 Assumption that every directory listing is a Unix-style listing may
1397 sound extremely constraining, but in practice it is not, as many
1398 non-Unix @sc{ftp} servers use the Unixoid listing format because most
1399 (all?) of the clients understand it. Bear in mind that @sc{rfc959}
1400 defines no standard way to get a file list, let alone the time-stamps.
1401 We can only hope that a future standard will define this.
1403 Another non-standard solution includes the use of @code{MDTM} command
1404 that is supported by some @sc{ftp} servers (including the popular
1405 @code{wu-ftpd}), which returns the exact time of the specified file.
1406 Wget may support this command in the future.
1408 @node Startup File, Examples, Time-Stamping, Top
1409 @chapter Startup File
1410 @cindex startup file
1416 Once you know how to change default settings of Wget through command
1417 line arguments, you may wish to make some of those settings permanent.
1418 You can do that in a convenient way by creating the Wget startup
1419 file---@file{.wgetrc}.
1421 Besides @file{.wgetrc} is the ``main'' initialization file, it is
1422 convenient to have a special facility for storing passwords. Thus Wget
1423 reads and interprets the contents of @file{$HOME/.netrc}, if it finds
1424 it. You can find @file{.netrc} format in your system manuals.
1426 Wget reads @file{.wgetrc} upon startup, recognizing a limited set of
1430 * Wgetrc Location:: Location of various wgetrc files.
1431 * Wgetrc Syntax:: Syntax of wgetrc.
1432 * Wgetrc Commands:: List of available commands.
1433 * Sample Wgetrc:: A wgetrc example.
1436 @node Wgetrc Location, Wgetrc Syntax, Startup File, Startup File
1437 @section Wgetrc Location
1438 @cindex wgetrc location
1439 @cindex location of wgetrc
1441 When initializing, Wget will look for a @dfn{global} startup file,
1442 @file{/usr/local/etc/wgetrc} by default (or some prefix other than
1443 @file{/usr/local}, if Wget was not installed there) and read commands
1444 from there, if it exists.
1446 Then it will look for the user's file. If the environmental variable
1447 @code{WGETRC} is set, Wget will try to load that file. Failing that, no
1448 further attempts will be made.
1450 If @code{WGETRC} is not set, Wget will try to load @file{$HOME/.wgetrc}.
1452 The fact that user's settings are loaded after the system-wide ones
1453 means that in case of collision user's wgetrc @emph{overrides} the
1454 system-wide wgetrc (in @file{/usr/local/etc/wgetrc} by default).
1455 Fascist admins, away!
1457 @node Wgetrc Syntax, Wgetrc Commands, Wgetrc Location, Startup File
1458 @section Wgetrc Syntax
1459 @cindex wgetrc syntax
1460 @cindex syntax of wgetrc
1462 The syntax of a wgetrc command is simple:
1468 The @dfn{variable} will also be called @dfn{command}. Valid
1469 @dfn{values} are different for different commands.
1471 The commands are case-insensitive and underscore-insensitive. Thus
1472 @samp{DIr__PrefiX} is the same as @samp{dirprefix}. Empty lines, lines
1473 beginning with @samp{#} and lines containing white-space only are
1476 Commands that expect a comma-separated list will clear the list on an
1477 empty command. So, if you wish to reset the rejection list specified in
1478 global @file{wgetrc}, you can do it with:
1484 @node Wgetrc Commands, Sample Wgetrc, Wgetrc Syntax, Startup File
1485 @section Wgetrc Commands
1486 @cindex wgetrc commands
1488 The complete set of commands is listed below, the letter after @samp{=}
1489 denoting the value the command takes. It is @samp{on/off} for @samp{on}
1490 or @samp{off} (which can also be @samp{1} or @samp{0}), @var{string} for
1491 any non-empty string or @var{n} for a positive integer. For example,
1492 you may specify @samp{use_proxy = off} to disable use of proxy servers
1493 by default. You may use @samp{inf} for infinite values, where
1496 Most of the commands have their equivalent command-line option
1497 (@xref{Invoking}), except some more obscure or rarely used ones.
1500 @item accept/reject = @var{string}
1501 Same as @samp{-A}/@samp{-R} (@xref{Types of Files}).
1503 @item add_hostdir = on/off
1504 Enable/disable host-prefixed file names. @samp{-nH} disables it.
1506 @item continue = on/off
1507 Enable/disable continuation of the retrieval, the same as @samp{-c}
1510 @item background = on/off
1511 Enable/disable going to background, the same as @samp{-b} (which enables
1514 @c @item backups = @var{number}
1515 @c #### Document me!
1516 @item base = @var{string}
1517 Set base for relative @sc{url}s, the same as @samp{-B}.
1519 @item cache = on/off
1520 When set to off, disallow server-caching. See the @samp{-C} option.
1522 @item convert links = on/off
1523 Convert non-relative links locally. The same as @samp{-k}.
1525 @item cut_dirs = @var{n}
1526 Ignore @var{n} remote directory components.
1528 @item debug = on/off
1529 Debug mode, same as @samp{-d}.
1531 @item delete_after = on/off
1532 Delete after download, the same as @samp{--delete-after}.
1534 @item dir_prefix = @var{string}
1535 Top of directory tree, the same as @samp{-P}.
1537 @item dirstruct = on/off
1538 Turning dirstruct on or off, the same as @samp{-x} or @samp{-nd},
1541 @item domains = @var{string}
1542 Same as @samp{-D} (@xref{Domain Acceptance}).
1544 @item dot_bytes = @var{n}
1545 Specify the number of bytes ``contained'' in a dot, as seen throughout
1546 the retrieval (1024 by default). You can postfix the value with
1547 @samp{k} or @samp{m}, representing kilobytes and megabytes,
1548 respectively. With dot settings you can tailor the dot retrieval to
1549 suit your needs, or you can use the predefined @dfn{styles}
1550 (@xref{Download Options}).
1552 @item dots_in_line = @var{n}
1553 Specify the number of dots that will be printed in each line throughout
1554 the retrieval (50 by default).
1556 @item dot_spacing = @var{n}
1557 Specify the number of dots in a single cluster (10 by default).
1559 @item dot_style = @var{string}
1560 Specify the dot retrieval @dfn{style}, as with @samp{--dot-style}.
1562 @item exclude_directories = @var{string}
1563 Specify a comma-separated list of directories you wish to exclude from
1564 download, the same as @samp{-X} (@xref{Directory-Based Limits}).
1566 @item exclude_domains = @var{string}
1567 Same as @samp{--exclude-domains} (@xref{Domain Acceptance}).
1569 @item follow_ftp = on/off
1570 Follow @sc{ftp} links from @sc{html} documents, the same as @samp{-f}.
1572 @item force_html = on/off
1573 If set to on, force the input filename to be regarded as an @sc{html}
1574 document, the same as @samp{-F}.
1576 @item ftp_proxy = @var{string}
1577 Use @var{string} as @sc{ftp} proxy, instead of the one specified in
1581 Turn globbing on/off, the same as @samp{-g}.
1583 @item header = @var{string}
1584 Define an additional header, like @samp{--header}.
1586 @item http_passwd = @var{string}
1587 Set @sc{http} password.
1589 @item http_proxy = @var{string}
1590 Use @var{string} as @sc{http} proxy, instead of the one specified in
1593 @item http_user = @var{string}
1594 Set @sc{http} user to @var{string}.
1596 @item ignore_length = on/off
1597 When set to on, ignore @code{Content-Length} header; the same as
1598 @samp{--ignore-length}.
1600 @item include_directories = @var{string}
1601 Specify a comma-separated list of directories you wish to follow when
1602 downloading, the same as @samp{-I}.
1604 @item input = @var{string}
1605 Read the @sc{url}s from @var{string}, like @samp{-i}.
1607 @item kill_longer = on/off
1608 Consider data longer than specified in content-length header
1609 as invalid (and retry getting it). The default behaviour is to save
1610 as much data as there is, provided there is more than or equal
1611 to the value in @code{Content-Length}.
1613 @item logfile = @var{string}
1614 Set logfile, the same as @samp{-o}.
1616 @item login = @var{string}
1617 Your user name on the remote machine, for @sc{ftp}. Defaults to
1620 @item mirror = on/off
1621 Turn mirroring on/off. The same as @samp{-m}.
1623 @item netrc = on/off
1624 Turn reading netrc on or off.
1626 @item noclobber = on/off
1629 @item no_parent = on/off
1630 Disallow retrieving outside the directory hierarchy, like
1631 @samp{--no-parent} (@xref{Directory-Based Limits}).
1633 @item no_proxy = @var{string}
1634 Use @var{string} as the comma-separated list of domains to avoid in
1635 proxy loading, instead of the one specified in environment.
1637 @item output_document = @var{string}
1638 Set the output filename, the same as @samp{-O}.
1640 @item passive_ftp = on/off
1641 Set passive @sc{ftp}, the same as @samp{--passive-ftp}.
1643 @item passwd = @var{string}
1644 Set your @sc{ftp} password to @var{password}. Without this setting, the
1645 password defaults to @samp{username@@hostname.domainname}.
1647 @item proxy_user = @var{string}
1648 Set proxy authentication user name to @var{string}, like
1649 @samp{--proxy-user}.
1651 @item proxy_passwd = @var{string}
1652 Set proxy authentication password to @var{string}, like
1653 @samp{--proxy-passwd}.
1655 @item quiet = on/off
1656 Quiet mode, the same as @samp{-q}.
1658 @item quota = @var{quota}
1659 Specify the download quota, which is useful to put in global
1660 wgetrc. When download quota is specified, Wget will stop retrieving
1661 after the download sum has become greater than quota. The quota can be
1662 specified in bytes (default), kbytes @samp{k} appended) or mbytes
1663 (@samp{m} appended). Thus @samp{quota = 5m} will set the quota to 5
1664 mbytes. Note that the user's startup file overrides system settings.
1666 @item reclevel = @var{n}
1667 Recursion level, the same as @samp{-l}.
1669 @item recursive = on/off
1670 Recursive on/off, the same as @samp{-r}.
1672 @item relative_only = on/off
1673 Follow only relative links, the same as @samp{-L} (@xref{Relative
1676 @item remove_listing = on/off
1677 If set to on, remove @sc{ftp} listings downloaded by Wget. Setting it
1678 to off is the same as @samp{-nr}.
1680 @item retr_symlinks = on/off
1681 When set to on, retrieve symbolic links as if they were plain files; the
1682 same as @samp{--retr-symlinks}.
1684 @item robots = on/off
1685 Use (or not) @file{/robots.txt} file (@xref{Robots}). Be sure to know
1686 what you are doing before changing the default (which is @samp{on}).
1688 @item server_response = on/off
1689 Choose whether or not to print the @sc{http} and @sc{ftp} server
1690 responses, the same as @samp{-S}.
1692 @item simple_host_check = on/off
1693 Same as @samp{-nh} (@xref{Host Checking}).
1695 @item span_hosts = on/off
1698 @item timeout = @var{n}
1699 Set timeout value, the same as @samp{-T}.
1701 @item timestamping = on/off
1702 Turn timestamping on/off. The same as @samp{-N} (@xref{Time-Stamping}).
1704 @item tries = @var{n}
1705 Set number of retries per @sc{url}, the same as @samp{-t}.
1707 @item use_proxy = on/off
1708 Turn proxy support on/off. The same as @samp{-Y}.
1710 @item verbose = on/off
1711 Turn verbose on/off, the same as @samp{-v}/@samp{-nv}.
1713 @item wait = @var{n}
1714 Wait @var{n} seconds between retrievals, the same as @samp{-w}.
1717 @node Sample Wgetrc, , Wgetrc Commands, Startup File
1718 @section Sample Wgetrc
1719 @cindex sample wgetrc
1721 This is the sample initialization file, as given in the distribution.
1722 It is divided in two section---one for global usage (suitable for global
1723 startup file), and one for local usage (suitable for
1724 @file{$HOME/.wgetrc}). Be careful about the things you change.
1726 Note that all the lines are commented out. For any line to have effect,
1727 you must remove the @samp{#} prefix at the beginning of line.
1731 ### Sample Wget initialization file .wgetrc
1734 ## You can use this file to change the default behaviour of wget or to
1735 ## avoid having to type many many command-line options. This file does
1736 ## not contain a comprehensive list of commands -- look at the manual
1737 ## to find out what you can put into this file.
1739 ## Wget initialization file can reside in /usr/local/etc/wgetrc
1740 ## (global, for all users) or $HOME/.wgetrc (for a single user).
1742 ## To use any of the settings in this file, you will have to uncomment
1743 ## them (and probably change them).
1747 ## Global settings (useful for setting up in /usr/local/etc/wgetrc).
1748 ## Think well before you change them, since they may reduce wget's
1749 ## functionality, and make it behave contrary to the documentation:
1752 # You can set retrieve quota for beginners by specifying a value
1753 # optionally followed by 'K' (kilobytes) or 'M' (megabytes). The
1754 # default quota is unlimited.
1757 # You can lower (or raise) the default number of retries when
1758 # downloading a file (default is 20).
1761 # Lowering the maximum depth of the recursive retrieval is handy to
1762 # prevent newbies from going too "deep" when they unwittingly start
1763 # the recursive retrieval. The default is 5.
1766 # Many sites are behind firewalls that do not allow initiation of
1767 # connections from the outside. On these sites you have to use the
1768 # `passive' feature of FTP. If you are behind such a firewall, you
1769 # can turn this on to make Wget use passive FTP by default.
1774 ## Local settings (for a user to set in his $HOME/.wgetrc). It is
1775 ## *highly* undesirable to put these settings in the global file, since
1776 ## they are potentially dangerous to "normal" users.
1778 ## Even when setting up your own ~/.wgetrc, you should know what you
1779 ## are doing before doing so.
1782 # Set this to on to use timestamping by default:
1785 # It is a good idea to make Wget send your email address in a `From:'
1786 # header with your request (so that server administrators can contact
1787 # you in case of errors). Wget does *not* send `From:' by default.
1788 #header = From: Your Name <username@@site.domain>
1790 # You can set up other headers, like Accept-Language. Accept-Language
1791 # is *not* sent by default.
1792 #header = Accept-Language: en
1794 # You can set the default proxy for Wget to use. It will override the
1795 # value in the environment.
1796 #http_proxy = http://proxy.yoyodyne.com:18023/
1798 # If you do not want to use proxy at all, set this to off.
1801 # You can customize the retrieval outlook. Valid options are default,
1802 # binary, mega and micro.
1803 #dot_style = default
1805 # Setting this to off makes Wget not download /robots.txt. Be sure to
1806 # know *exactly* what /robots.txt is and how it is used before changing
1810 # It can be useful to make Wget wait between connections. Set this to
1811 # the number of seconds you want Wget to wait.
1814 # You can force creating directory structure, even if a single is being
1815 # retrieved, by setting this to on.
1818 # You can turn on recursive retrieving by default (don't do this if
1819 # you are not sure you know what it means) by setting this to on.
1822 # To have Wget follow FTP links from HTML files by default, set this
1827 @node Examples, Various, Startup File, Top
1831 The examples are classified into three sections, because of clarity.
1832 The first section is a tutorial for beginners. The second section
1833 explains some of the more complex program features. The third section
1834 contains advice for mirror administrators, as well as even more complex
1835 features (that some would call perverted).
1838 * Simple Usage:: Simple, basic usage of the program.
1839 * Advanced Usage:: Advanced techniques of usage.
1840 * Guru Usage:: Mirroring and the hairy stuff.
1843 @node Simple Usage, Advanced Usage, Examples, Examples
1844 @section Simple Usage
1848 Say you want to download a @sc{url}. Just type:
1851 wget http://fly.cc.fer.hr/
1854 The response will be something like:
1858 --13:30:45-- http://fly.cc.fer.hr:80/en/
1860 Connecting to fly.cc.fer.hr:80... connected!
1861 HTTP request sent, awaiting response... 200 OK
1862 Length: 4,694 [text/html]
1866 13:30:46 (23.75 KB/s) - `index.html' saved [4694/4694]
1871 But what will happen if the connection is slow, and the file is lengthy?
1872 The connection will probably fail before the whole file is retrieved,
1873 more than once. In this case, Wget will try getting the file until it
1874 either gets the whole of it, or exceeds the default number of retries
1875 (this being 20). It is easy to change the number of tries to 45, to
1876 insure that the whole file will arrive safely:
1879 wget --tries=45 http://fly.cc.fer.hr/jpg/flyweb.jpg
1883 Now let's leave Wget to work in the background, and write its progress
1884 to log file @file{log}. It is tiring to type @samp{--tries}, so we
1885 shall use @samp{-t}.
1888 wget -t 45 -o log http://fly.cc.fer.hr/jpg/flyweb.jpg &
1891 The ampersand at the end of the line makes sure that Wget works in the
1892 background. To unlimit the number of retries, use @samp{-t inf}.
1895 The usage of @sc{ftp} is as simple. Wget will take care of login and
1900 $ wget ftp://gnjilux.cc.fer.hr/welcome.msg
1901 --10:08:47-- ftp://gnjilux.cc.fer.hr:21/welcome.msg
1903 Connecting to gnjilux.cc.fer.hr:21... connected!
1904 Logging in as anonymous ... Logged in!
1905 ==> TYPE I ... done. ==> CWD not needed.
1906 ==> PORT ... done. ==> RETR welcome.msg ... done.
1907 Length: 1,340 (unauthoritative)
1911 10:08:48 (1.28 MB/s) - `welcome.msg' saved [1340]
1916 If you specify a directory, Wget will retrieve the directory listing,
1917 parse it and convert it to @sc{html}. Try:
1920 wget ftp://prep.ai.mit.edu/pub/gnu/
1925 @node Advanced Usage, Guru Usage, Simple Usage, Examples
1926 @section Advanced Usage
1930 You would like to read the list of @sc{url}s from a file? Not a problem
1937 If you specify @samp{-} as file name, the @sc{url}s will be read from
1941 Create a mirror image of GNU @sc{www} site (with the same directory structure
1942 the original has) with only one try per document, saving the log of the
1943 activities to @file{gnulog}:
1946 wget -r -t1 http://www.gnu.ai.mit.edu/ -o gnulog
1950 Retrieve the first layer of yahoo links:
1953 wget -r -l1 http://www.yahoo.com/
1957 Retrieve the index.html of @samp{www.lycos.com}, showing the original
1961 wget -S http://www.lycos.com/
1965 Save the server headers with the file:
1967 wget -s http://www.lycos.com/
1972 Retrieve the first two levels of @samp{wuarchive.wustl.edu}, saving them
1976 wget -P/tmp -l2 ftp://wuarchive.wustl.edu/
1980 You want to download all the @sc{gif}s from an @sc{http} directory.
1981 @samp{wget http://host/dir/*.gif} doesn't work, since @sc{http}
1982 retrieval does not support globbing. In that case, use:
1985 wget -r -l1 --no-parent -A.gif http://host/dir/
1988 It is a bit of a kludge, but it works. @samp{-r -l1} means to retrieve
1989 recursively (@xref{Recursive Retrieval}), with maximum depth of 1.
1990 @samp{--no-parent} means that references to the parent directory are
1991 ignored (@xref{Directory-Based Limits}), and @samp{-A.gif} means to
1992 download only the @sc{gif} files. @samp{-A "*.gif"} would have worked
1996 Suppose you were in the middle of downloading, when Wget was
1997 interrupted. Now you do not want to clobber the files already present.
2001 wget -nc -r http://www.gnu.ai.mit.edu/
2005 If you want to encode your own username and password to @sc{http} or
2006 @sc{ftp}, use the appropriate @sc{url} syntax (@xref{URL Format}).
2009 wget ftp://hniksic:mypassword@@jagor.srce.hr/.emacs
2013 If you do not like the default retrieval visualization (1K dots with 10
2014 dots per cluster and 50 dots per line), you can customize it through dot
2015 settings (@xref{Wgetrc Commands}). For example, many people like the
2016 ``binary'' style of retrieval, with 8K dots and 512K lines:
2019 wget --dot-style=binary ftp://prep.ai.mit.edu/pub/gnu/README
2022 You can experiment with other styles, like:
2025 wget --dot-style=mega ftp://ftp.xemacs.org/pub/xemacs/xemacs-20.4/xemacs-20.4.tar.gz
2026 wget --dot-style=micro http://fly.cc.fer.hr/
2029 To make these settings permanent, put them in your @file{.wgetrc}, as
2030 described before (@xref{Sample Wgetrc}).
2033 @node Guru Usage, , Advanced Usage, Examples
2039 If you wish Wget to keep a mirror of a page (or @sc{ftp}
2040 subdirectories), use @samp{--mirror} (@samp{-m}), which is the shorthand
2041 for @samp{-r -N}. You can put Wget in the crontab file asking it to
2042 recheck a site each Sunday:
2046 0 0 * * 0 wget --mirror ftp://ftp.xemacs.org/pub/xemacs/ -o /home/me/weeklog
2050 You may wish to do the same with someone's home page. But you do not
2051 want to download all those images---you're only interested in @sc{html}.
2054 wget --mirror -A.html http://www.w3.org/
2058 But what about mirroring the hosts networkologically close to you? It
2059 seems so awfully slow because of all that @sc{dns} resolving. Just use
2060 @samp{-D} (@xref{Domain Acceptance}).
2063 wget -rN -Dsrce.hr http://www.srce.hr/
2066 Now Wget will correctly find out that @samp{regoc.srce.hr} is the same
2067 as @samp{www.srce.hr}, but will not even take into consideration the
2068 link to @samp{www.mit.edu}.
2071 You have a presentation and would like the dumb absolute links to be
2072 converted to relative? Use @samp{-k}:
2075 wget -k -r @var{URL}
2078 @cindex redirecting output
2080 You would like the output documents to go to standard output instead of
2081 to files? OK, but Wget will automatically shut up (turn on
2082 @samp{--quiet}) to prevent mixing of Wget output and the retrieved
2086 wget -O - http://jagor.srce.hr/ http://www.srce.hr/
2089 You can also combine the two options and make weird pipelines to
2090 retrieve the documents from remote hotlists:
2093 wget -O - http://cool.list.com/ | wget --force-html -i -
2097 @node Various, Appendices, Examples, Top
2101 This chapter contains all the stuff that could not fit anywhere else.
2104 * Proxies:: Support for proxy servers
2105 * Distribution:: Getting the latest version.
2106 * Mailing List:: Wget mailing list for announcements and discussion.
2107 * Reporting Bugs:: How and where to report bugs.
2108 * Portability:: The systems Wget works on.
2109 * Signals:: Signal-handling performed by Wget.
2112 @node Proxies, Distribution, Various, Various
2116 @dfn{Proxies} are special-purpose @sc{http} servers designed to transfer
2117 data from remote servers to local clients. One typical use of proxies
2118 is lightening network load for users behind a slow connection. This is
2119 achieved by channeling all @sc{http} and @sc{ftp} requests through the
2120 proxy which caches the transferred data. When a cached resource is
2121 requested again, proxy will return the data from cache. Another use for
2122 proxies is for companies that separate (for security reasons) their
2123 internal networks from the rest of Internet. In order to obtain
2124 information from the Web, their users connect and retrieve remote data
2125 using an authorized proxy.
2127 Wget supports proxies for both @sc{http} and @sc{ftp} retrievals. The
2128 standard way to specify proxy location, which Wget recognizes, is using
2129 the following environment variables:
2133 This variable should contain the @sc{url} of the proxy for @sc{http}
2137 This variable should contain the @sc{url} of the proxy for @sc{http}
2138 connections. It is quite common that @sc{http_proxy} and @sc{ftp_proxy}
2139 are set to the same @sc{url}.
2142 This variable should contain a comma-separated list of domain extensions
2143 proxy should @emph{not} be used for. For instance, if the value of
2144 @code{no_proxy} is @samp{.mit.edu}, proxy will not be used to retrieve
2148 In addition to the environment variables, proxy location and settings
2149 may be specified from within Wget itself.
2153 @itemx --proxy=on/off
2154 @itemx proxy = on/off
2155 This option may be used to turn the proxy support on or off. Proxy
2156 support is on by default, provided that the appropriate environment
2159 @item http_proxy = @var{URL}
2160 @itemx ftp_proxy = @var{URL}
2161 @itemx no_proxy = @var{string}
2162 These startup file variables allow you to override the proxy settings
2163 specified by the environment.
2166 Some proxy servers require authorization to enable you to use them. The
2167 authorization consists of @dfn{username} and @dfn{password}, which must
2168 be sent by Wget. As with @sc{http} authorization, several
2169 authentication schemes exist. For proxy authorization only the
2170 @code{Basic} authentication scheme is currently implemented.
2172 You may specify your username and password either through the proxy
2173 @sc{url} or through the command-line options. Assuming that the
2174 company's proxy is located at @samp{proxy.srce.hr} at port 8001, a proxy
2175 @sc{url} location containing authorization data might look like this:
2178 http://hniksic:mypassword@@proxy.company.com:8001/
2181 Alternatively, you may use the @samp{proxy-user} and
2182 @samp{proxy-password} options, and the equivalent @file{.wgetrc}
2183 settings @code{proxy_user} and @code{proxy_passwd} to set the proxy
2184 username and password.
2186 @node Distribution, Mailing List, Proxies, Various
2187 @section Distribution
2188 @cindex latest version
2190 Like all GNU utilities, the latest version of Wget can be found at the
2191 master GNU archive site prep.ai.mit.edu, and its mirrors. For example,
2192 Wget @value{VERSION} can be found at
2193 @url{ftp://prep.ai.mit.edu/pub/gnu/wget-@value{VERSION}.tar.gz}
2195 @node Mailing List, Reporting Bugs, Distribution, Various
2196 @section Mailing List
2197 @cindex mailing list
2200 Wget has its own mailing list at @email{wget@@sunsite.auc.dk}, thanks
2201 to Karsten Thygesen. The mailing list is for discussion of Wget
2202 features and web, reporting Wget bugs (those that you think may be of
2203 interest to the public) and mailing announcements. You are welcome to
2204 subscribe. The more people on the list, the better!
2206 To subscribe, send mail to @email{wget-subscribe@@sunsite.auc.dk}.
2207 the magic word @samp{subscribe} in the subject line. Unsubscribe by
2208 mailing to @email{wget-unsubscribe@@sunsite.auc.dk}.
2210 The mailing list is archived at @url{http://fly.cc.fer.hr/archive/wget}.
2212 @node Reporting Bugs, Portability, Mailing List, Various
2213 @section Reporting Bugs
2215 @cindex reporting bugs
2218 You are welcome to send bug reports about GNU Wget to
2219 @email{bug-wget@@gnu.org}. The bugs that you think are of the
2220 interest to the public (i.e. more people should be informed about them)
2221 can be Cc-ed to the mailing list at @email{wget@@sunsite.auc.dk}.
2223 Before actually submitting a bug report, please try to follow a few
2228 Please try to ascertain that the behaviour you see really is a bug. If
2229 Wget crashes, it's a bug. If Wget does not behave as documented,
2230 it's a bug. If things work strange, but you are not sure about the way
2231 they are supposed to work, it might well be a bug.
2234 Try to repeat the bug in as simple circumstances as possible. E.g. if
2235 Wget crashes on @samp{wget -rLl0 -t5 -Y0 http://yoyodyne.com -o
2236 /tmp/log}, you should try to see if it will crash with a simpler set of
2239 Also, while I will probably be interested to know the contents of your
2240 @file{.wgetrc} file, just dumping it into the debug message is probably
2241 a bad idea. Instead, you should first try to see if the bug repeats
2242 with @file{.wgetrc} moved out of the way. Only if it turns out that
2243 @file{.wgetrc} settings affect the bug, should you mail me the relevant
2247 Please start Wget with @samp{-d} option and send the log (or the
2248 relevant parts of it). If Wget was compiled without debug support,
2249 recompile it. It is @emph{much} easier to trace bugs with debug support
2253 If Wget has crashed, try to run it in a debugger, e.g. @code{gdb `which
2254 wget` core} and type @code{where} to get the backtrace.
2257 Find where the bug is, fix it and send me the patches. :-)
2260 @node Portability, Signals, Reporting Bugs, Various
2261 @section Portability
2263 @cindex operating systems
2265 Since Wget uses GNU Autoconf for building and configuring, and avoids
2266 using ``special'' ultra--mega--cool features of any particular Unix, it
2267 should compile (and work) on all common Unix flavors.
2269 Various Wget versions have been compiled and tested under many kinds of
2270 Unix systems, including Solaris, Linux, SunOS, OSF (aka Digital Unix),
2271 Ultrix, *BSD, IRIX, and others; refer to the file @file{MACHINES} in the
2272 distribution directory for a comprehensive list. If you compile it on
2273 an architecture not listed there, please let me know so I can update it.
2275 Wget should also compile on the other Unix systems, not listed in
2276 @file{MACHINES}. If it doesn't, please let me know.
2278 Thanks to kind contributors, this version of Wget compiles and works on
2279 Microsoft Windows 95 and Windows NT platforms. It has been compiled
2280 successfully using MS Visual C++ 4.0, Watcom, and Borland C compilers,
2281 with Winsock as networking software. Naturally, it is crippled of some
2282 features available on Unix, but it should work as a substitute for
2283 people stuck with Windows. Note that the Windows port is
2284 @strong{neither tested nor maintained} by me---all questions and
2285 problems should be reported to Wget mailing list at
2286 @email{wget@@sunsite.auc.dk} where the maintainers will look at them.
2288 @node Signals, , Portability, Various
2290 @cindex signal handling
2293 Since the purpose of Wget is background work, it catches the hangup
2294 signal (@code{SIGHUP}) and ignores it. If the output was on standard
2295 output, it will be redirected to a file named @file{wget-log}.
2296 Otherwise, @code{SIGHUP} is ignored. This is convenient when you wish
2297 to redirect the output of Wget after having started it.
2300 $ wget http://www.ifi.uio.no/~larsi/gnus.tar.gz &
2301 $ kill -HUP %% # Redirect the output to wget-log
2304 Other than that, Wget will not try to interfere with signals in any
2305 way. @kbd{C-c}, @code{kill -TERM} and @code{kill -KILL} should kill it
2308 @node Appendices, Copying, Various, Top
2311 This chapter contains some references I consider useful, like the Robots
2312 Exclusion Standard specification, as well as a list of contributors to
2316 * Robots:: Wget as a WWW robot.
2317 * Security Considerations:: Security with Wget.
2318 * Contributors:: People who helped.
2321 @node Robots, Security Considerations, Appendices, Appendices
2325 @cindex server maintenance
2327 Since Wget is able to traverse the web, it counts as one of the Web
2328 @dfn{robots}. Thus Wget understands @dfn{Robots Exclusion Standard}
2329 (@sc{res})---contents of @file{/robots.txt}, used by server
2330 administrators to shield parts of their systems from wanderings of Wget.
2332 Norobots support is turned on only when retrieving recursively, and
2333 @emph{never} for the first page. Thus, you may issue:
2336 wget -r http://fly.cc.fer.hr/
2339 First the index of fly.cc.fer.hr will be downloaded. If Wget finds
2340 anything worth downloading on the same host, only @emph{then} will it
2341 load the robots, and decide whether or not to load the links after all.
2342 @file{/robots.txt} is loaded only once per host. Wget does not support
2343 the robots @code{META} tag.
2345 The description of the norobots standard was written, and is maintained
2346 by Martijn Koster @email{m.koster@@webcrawler.com}. With his
2347 permission, I contribute a (slightly modified) texified version of the
2351 * Introduction to RES::
2353 * User-Agent Field::
2355 * Norobots Examples::
2358 @node Introduction to RES, RES Format, Robots, Robots
2359 @subsection Introduction to RES
2360 @cindex norobots introduction
2362 @dfn{WWW Robots} (also called @dfn{wanderers} or @dfn{spiders}) are
2363 programs that traverse many pages in the World Wide Web by recursively
2364 retrieving linked pages. For more information see the robots page.
2366 In 1993 and 1994 there have been occasions where robots have visited
2367 @sc{www} servers where they weren't welcome for various
2368 reasons. Sometimes these reasons were robot specific, e.g. certain
2369 robots swamped servers with rapid-fire requests, or retrieved the same
2370 files repeatedly. In other situations robots traversed parts of @sc{www}
2371 servers that weren't suitable, e.g. very deep virtual trees, duplicated
2372 information, temporary information, or cgi-scripts with side-effects
2375 These incidents indicated the need for established mechanisms for
2376 @sc{www} servers to indicate to robots which parts of their server
2377 should not be accessed. This standard addresses this need with an
2378 operational solution.
2380 This document represents a consensus on 30 June 1994 on the robots
2381 mailing list (@code{robots@@webcrawler.com}), between the majority of
2382 robot authors and other people with an interest in robots. It has also
2383 been open for discussion on the Technical World Wide Web mailing list
2384 (@code{www-talk@@info.cern.ch}). This document is based on a previous
2385 working draft under the same title.
2387 It is not an official standard backed by a standards body, or owned by
2388 any commercial organization. It is not enforced by anybody, and there
2389 no guarantee that all current and future robots will use it. Consider
2390 it a common facility the majority of robot authors offer the @sc{www}
2391 community to protect @sc{www} server against unwanted accesses by their
2394 The latest version of this document can be found at
2395 @url{http://info.webcrawler.com/mak/projects/robots/norobots.html}.
2397 @node RES Format, User-Agent Field, Introduction to RES, Robots
2398 @subsection RES Format
2399 @cindex norobots format
2401 The format and semantics of the @file{/robots.txt} file are as follows:
2403 The file consists of one or more records separated by one or more blank
2404 lines (terminated by @code{CR}, @code{CR/NL}, or @code{NL}). Each
2405 record contains lines of the form:
2408 <field>:<optionalspace><value><optionalspace>
2411 The field name is case insensitive.
2413 Comments can be included in file using UNIX bourne shell conventions:
2414 the @samp{#} character is used to indicate that preceding space (if any)
2415 and the remainder of the line up to the line termination is discarded.
2416 Lines containing only a comment are discarded completely, and therefore
2417 do not indicate a record boundary.
2419 The record starts with one or more User-agent lines, followed by one or
2420 more Disallow lines, as detailed below. Unrecognized headers are
2423 The presence of an empty @file{/robots.txt} file has no explicit
2424 associated semantics, it will be treated as if it was not present,
2425 i.e. all robots will consider themselves welcome.
2427 @node User-Agent Field, Disallow Field, RES Format, Robots
2428 @subsection User-Agent Field
2429 @cindex norobots user-agent
2431 The value of this field is the name of the robot the record is
2432 describing access policy for.
2434 If more than one User-agent field is present the record describes an
2435 identical access policy for more than one robot. At least one field
2436 needs to be present per record.
2438 The robot should be liberal in interpreting this field. A case
2439 insensitive substring match of the name without version information is
2442 If the value is @samp{*}, the record describes the default access policy
2443 for any robot that has not matched any of the other records. It is not
2444 allowed to have multiple such records in the @file{/robots.txt} file.
2446 @node Disallow Field, Norobots Examples, User-Agent Field, Robots
2447 @subsection Disallow Field
2448 @cindex norobots disallow
2450 The value of this field specifies a partial @sc{url} that is not to be
2451 visited. This can be a full path, or a partial path; any @sc{url} that
2452 starts with this value will not be retrieved. For example,
2453 @w{@samp{Disallow: /help}} disallows both @samp{/help.html} and
2454 @samp{/help/index.html}, whereas @w{@samp{Disallow: /help/}} would
2455 disallow @samp{/help/index.html} but allow @samp{/help.html}.
2457 Any empty value, indicates that all @sc{url}s can be retrieved. At least
2458 one Disallow field needs to be present in a record.
2460 @node Norobots Examples, , Disallow Field, Robots
2461 @subsection Norobots Examples
2462 @cindex norobots examples
2464 The following example @samp{/robots.txt} file specifies that no robots
2465 should visit any @sc{url} starting with @samp{/cyberworld/map/} or
2469 # robots.txt for http://www.site.com/
2472 Disallow: /cyberworld/map/ # This is an infinite virtual URL space
2473 Disallow: /tmp/ # these will soon disappear
2476 This example @samp{/robots.txt} file specifies that no robots should
2477 visit any @sc{url} starting with @samp{/cyberworld/map/}, except the
2478 robot called @samp{cybermapper}:
2481 # robots.txt for http://www.site.com/
2484 Disallow: /cyberworld/map/ # This is an infinite virtual URL space
2486 # Cybermapper knows where to go.
2487 User-agent: cybermapper
2491 This example indicates that no robots should visit this site further:
2499 @node Security Considerations, Contributors, Robots, Appendices
2500 @section Security Considerations
2503 When using Wget, you must be aware that it sends unencrypted passwords
2504 through the network, which may present a security problem. Here are the
2505 main issues, and some solutions.
2509 The passwords on the command line are visible using @code{ps}. If this
2510 is a problem, avoid putting passwords from the command line---e.g. you
2511 can use @file{.netrc} for this.
2514 Using the insecure @dfn{basic} authentication scheme, unencrypted
2515 passwords are transmitted through the network routers and gateways.
2518 The @sc{ftp} passwords are also in no way encrypted. There is no good
2519 solution for this at the moment.
2522 Although the ``normal'' output of Wget tries to hide the passwords,
2523 debugging logs show them, in all forms. This problem is avoided by
2524 being careful when you send debug logs (yes, even when you send them to
2528 @node Contributors, , Security Considerations, Appendices
2529 @section Contributors
2530 @cindex contributors
2533 GNU Wget was written by Hrvoje Nik@v{s}i@'{c} @email{hniksic@@srce.hr}.
2536 GNU Wget was written by Hrvoje Niksic @email{hniksic@@srce.hr}.
2538 However, its development could never have gone as far as it has, were it
2539 not for the help of many people, either with bug reports, feature
2540 proposals, patches, or letters saying ``Thanks!''.
2542 Special thanks goes to the following people (no particular order):
2546 Karsten Thygesen---donated the mailing list and the initial @sc{ftp}
2550 Shawn McHorse---bug reports and patches.
2553 Kaveh R. Ghazi---on-the-fly @code{ansi2knr}-ization.
2556 Gordon Matzigkeit---@file{.netrc} support.
2560 Zlatko @v{C}alu@v{s}i@'{c}, Tomislav Vujec and Dra@v{z}en
2561 Ka@v{c}ar---feature suggestions and ``philosophical'' discussions.
2564 Zlatko Calusic, Tomislav Vujec and Drazen Kacar---feature suggestions
2565 and ``philosophical'' discussions.
2569 Darko Budor---initial port to Windows.
2572 Antonio Rosella---help and suggestions, plust the Italian translation.
2576 Tomislav Petrovi@'{c}, Mario Miko@v{c}evi@'{c}---many bug reports and
2580 Tomislav Petrovic, Mario Mikocevic---many bug reports and suggestions.
2585 Fran@,{c}ois Pinard---many thorough bug reports and discussions.
2588 Francois Pinard---many thorough bug reports and discussions.
2592 Karl Eichwalder---lots of help with internationalization and other
2596 Junio Hamano---donated support for Opie and @sc{http} @code{Digest}
2600 Brian Gough---a generous donation.
2603 The following people have provided patches, bug/build reports, useful
2604 suggestions, beta testing services, fan mail and all the other things
2605 that make maintenance so much fun:
2610 Roger Beeman and the Gurus at Cisco,
2618 Kristijan @v{C}onka@v{s},
2633 Aleksandar Erkalovi@'{c},
2636 Aleksandar Erkalovic,
2646 Erik Magnus Hulthen,
2656 Goran Kezunovi@'{c},
2666 $\Sigma\acute{\iota}\mu o\varsigma\;
2667 \Xi\varepsilon\nu\iota\tau\acute{\epsilon}\lambda\lambda\eta\varsigma$
2668 (Simos KSenitellis),
2685 @c Texinfo doesn't grok @'{@i}, so we have to use TeX itself.
2687 Juan Jos\'{e} Rodr\'{\i}gues,
2690 Juan Jose Rodrigues,
2697 Szakacsits Szabolcs,
2700 Douglas E. Wegscheid,
2710 Apologies to all who I accidentally left out, and many thanks to all the
2711 subscribers of the Wget mailing list.
2713 @node Copying, Concept Index, Appendices, Top
2714 @unnumbered GNU GENERAL PUBLIC LICENSE
2717 @center Version 2, June 1991
2720 Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
2721 675 Mass Ave, Cambridge, MA 02139, USA
2723 Everyone is permitted to copy and distribute verbatim copies
2724 of this license document, but changing it is not allowed.
2727 @unnumberedsec Preamble
2729 The licenses for most software are designed to take away your
2730 freedom to share and change it. By contrast, the GNU General Public
2731 License is intended to guarantee your freedom to share and change free
2732 software---to make sure the software is free for all its users. This
2733 General Public License applies to most of the Free Software
2734 Foundation's software and to any other program whose authors commit to
2735 using it. (Some other Free Software Foundation software is covered by
2736 the GNU Library General Public License instead.) You can apply it to
2739 When we speak of free software, we are referring to freedom, not
2740 price. Our General Public Licenses are designed to make sure that you
2741 have the freedom to distribute copies of free software (and charge for
2742 this service if you wish), that you receive source code or can get it
2743 if you want it, that you can change the software or use pieces of it
2744 in new free programs; and that you know you can do these things.
2746 To protect your rights, we need to make restrictions that forbid
2747 anyone to deny you these rights or to ask you to surrender the rights.
2748 These restrictions translate to certain responsibilities for you if you
2749 distribute copies of the software, or if you modify it.
2751 For example, if you distribute copies of such a program, whether
2752 gratis or for a fee, you must give the recipients all the rights that
2753 you have. You must make sure that they, too, receive or can get the
2754 source code. And you must show them these terms so they know their
2757 We protect your rights with two steps: (1) copyright the software, and
2758 (2) offer you this license which gives you legal permission to copy,
2759 distribute and/or modify the software.
2761 Also, for each author's protection and ours, we want to make certain
2762 that everyone understands that there is no warranty for this free
2763 software. If the software is modified by someone else and passed on, we
2764 want its recipients to know that what they have is not the original, so
2765 that any problems introduced by others will not reflect on the original
2766 authors' reputations.
2768 Finally, any free program is threatened constantly by software
2769 patents. We wish to avoid the danger that redistributors of a free
2770 program will individually obtain patent licenses, in effect making the
2771 program proprietary. To prevent this, we have made it clear that any
2772 patent must be licensed for everyone's free use or not licensed at all.
2774 The precise terms and conditions for copying, distribution and
2775 modification follow.
2778 @unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2781 @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2786 This License applies to any program or other work which contains
2787 a notice placed by the copyright holder saying it may be distributed
2788 under the terms of this General Public License. The ``Program'', below,
2789 refers to any such program or work, and a ``work based on the Program''
2790 means either the Program or any derivative work under copyright law:
2791 that is to say, a work containing the Program or a portion of it,
2792 either verbatim or with modifications and/or translated into another
2793 language. (Hereinafter, translation is included without limitation in
2794 the term ``modification''.) Each licensee is addressed as ``you''.
2796 Activities other than copying, distribution and modification are not
2797 covered by this License; they are outside its scope. The act of
2798 running the Program is not restricted, and the output from the Program
2799 is covered only if its contents constitute a work based on the
2800 Program (independent of having been made by running the Program).
2801 Whether that is true depends on what the Program does.
2804 You may copy and distribute verbatim copies of the Program's
2805 source code as you receive it, in any medium, provided that you
2806 conspicuously and appropriately publish on each copy an appropriate
2807 copyright notice and disclaimer of warranty; keep intact all the
2808 notices that refer to this License and to the absence of any warranty;
2809 and give any other recipients of the Program a copy of this License
2810 along with the Program.
2812 You may charge a fee for the physical act of transferring a copy, and
2813 you may at your option offer warranty protection in exchange for a fee.
2816 You may modify your copy or copies of the Program or any portion
2817 of it, thus forming a work based on the Program, and copy and
2818 distribute such modifications or work under the terms of Section 1
2819 above, provided that you also meet all of these conditions:
2823 You must cause the modified files to carry prominent notices
2824 stating that you changed the files and the date of any change.
2827 You must cause any work that you distribute or publish, that in
2828 whole or in part contains or is derived from the Program or any
2829 part thereof, to be licensed as a whole at no charge to all third
2830 parties under the terms of this License.
2833 If the modified program normally reads commands interactively
2834 when run, you must cause it, when started running for such
2835 interactive use in the most ordinary way, to print or display an
2836 announcement including an appropriate copyright notice and a
2837 notice that there is no warranty (or else, saying that you provide
2838 a warranty) and that users may redistribute the program under
2839 these conditions, and telling the user how to view a copy of this
2840 License. (Exception: if the Program itself is interactive but
2841 does not normally print such an announcement, your work based on
2842 the Program is not required to print an announcement.)
2845 These requirements apply to the modified work as a whole. If
2846 identifiable sections of that work are not derived from the Program,
2847 and can be reasonably considered independent and separate works in
2848 themselves, then this License, and its terms, do not apply to those
2849 sections when you distribute them as separate works. But when you
2850 distribute the same sections as part of a whole which is a work based
2851 on the Program, the distribution of the whole must be on the terms of
2852 this License, whose permissions for other licensees extend to the
2853 entire whole, and thus to each and every part regardless of who wrote it.
2855 Thus, it is not the intent of this section to claim rights or contest
2856 your rights to work written entirely by you; rather, the intent is to
2857 exercise the right to control the distribution of derivative or
2858 collective works based on the Program.
2860 In addition, mere aggregation of another work not based on the Program
2861 with the Program (or with a work based on the Program) on a volume of
2862 a storage or distribution medium does not bring the other work under
2863 the scope of this License.
2866 You may copy and distribute the Program (or a work based on it,
2867 under Section 2) in object code or executable form under the terms of
2868 Sections 1 and 2 above provided that you also do one of the following:
2872 Accompany it with the complete corresponding machine-readable
2873 source code, which must be distributed under the terms of Sections
2874 1 and 2 above on a medium customarily used for software interchange; or,
2877 Accompany it with a written offer, valid for at least three
2878 years, to give any third party, for a charge no more than your
2879 cost of physically performing source distribution, a complete
2880 machine-readable copy of the corresponding source code, to be
2881 distributed under the terms of Sections 1 and 2 above on a medium
2882 customarily used for software interchange; or,
2885 Accompany it with the information you received as to the offer
2886 to distribute corresponding source code. (This alternative is
2887 allowed only for noncommercial distribution and only if you
2888 received the program in object code or executable form with such
2889 an offer, in accord with Subsection b above.)
2892 The source code for a work means the preferred form of the work for
2893 making modifications to it. For an executable work, complete source
2894 code means all the source code for all modules it contains, plus any
2895 associated interface definition files, plus the scripts used to
2896 control compilation and installation of the executable. However, as a
2897 special exception, the source code distributed need not include
2898 anything that is normally distributed (in either source or binary
2899 form) with the major components (compiler, kernel, and so on) of the
2900 operating system on which the executable runs, unless that component
2901 itself accompanies the executable.
2903 If distribution of executable or object code is made by offering
2904 access to copy from a designated place, then offering equivalent
2905 access to copy the source code from the same place counts as
2906 distribution of the source code, even though third parties are not
2907 compelled to copy the source along with the object code.
2910 You may not copy, modify, sublicense, or distribute the Program
2911 except as expressly provided under this License. Any attempt
2912 otherwise to copy, modify, sublicense or distribute the Program is
2913 void, and will automatically terminate your rights under this License.
2914 However, parties who have received copies, or rights, from you under
2915 this License will not have their licenses terminated so long as such
2916 parties remain in full compliance.
2919 You are not required to accept this License, since you have not
2920 signed it. However, nothing else grants you permission to modify or
2921 distribute the Program or its derivative works. These actions are
2922 prohibited by law if you do not accept this License. Therefore, by
2923 modifying or distributing the Program (or any work based on the
2924 Program), you indicate your acceptance of this License to do so, and
2925 all its terms and conditions for copying, distributing or modifying
2926 the Program or works based on it.
2929 Each time you redistribute the Program (or any work based on the
2930 Program), the recipient automatically receives a license from the
2931 original licensor to copy, distribute or modify the Program subject to
2932 these terms and conditions. You may not impose any further
2933 restrictions on the recipients' exercise of the rights granted herein.
2934 You are not responsible for enforcing compliance by third parties to
2938 If, as a consequence of a court judgment or allegation of patent
2939 infringement or for any other reason (not limited to patent issues),
2940 conditions are imposed on you (whether by court order, agreement or
2941 otherwise) that contradict the conditions of this License, they do not
2942 excuse you from the conditions of this License. If you cannot
2943 distribute so as to satisfy simultaneously your obligations under this
2944 License and any other pertinent obligations, then as a consequence you
2945 may not distribute the Program at all. For example, if a patent
2946 license would not permit royalty-free redistribution of the Program by
2947 all those who receive copies directly or indirectly through you, then
2948 the only way you could satisfy both it and this License would be to
2949 refrain entirely from distribution of the Program.
2951 If any portion of this section is held invalid or unenforceable under
2952 any particular circumstance, the balance of the section is intended to
2953 apply and the section as a whole is intended to apply in other
2956 It is not the purpose of this section to induce you to infringe any
2957 patents or other property right claims or to contest validity of any
2958 such claims; this section has the sole purpose of protecting the
2959 integrity of the free software distribution system, which is
2960 implemented by public license practices. Many people have made
2961 generous contributions to the wide range of software distributed
2962 through that system in reliance on consistent application of that
2963 system; it is up to the author/donor to decide if he or she is willing
2964 to distribute software through any other system and a licensee cannot
2967 This section is intended to make thoroughly clear what is believed to
2968 be a consequence of the rest of this License.
2971 If the distribution and/or use of the Program is restricted in
2972 certain countries either by patents or by copyrighted interfaces, the
2973 original copyright holder who places the Program under this License
2974 may add an explicit geographical distribution limitation excluding
2975 those countries, so that distribution is permitted only in or among
2976 countries not thus excluded. In such case, this License incorporates
2977 the limitation as if written in the body of this License.
2980 The Free Software Foundation may publish revised and/or new versions
2981 of the General Public License from time to time. Such new versions will
2982 be similar in spirit to the present version, but may differ in detail to
2983 address new problems or concerns.
2985 Each version is given a distinguishing version number. If the Program
2986 specifies a version number of this License which applies to it and ``any
2987 later version'', you have the option of following the terms and conditions
2988 either of that version or of any later version published by the Free
2989 Software Foundation. If the Program does not specify a version number of
2990 this License, you may choose any version ever published by the Free Software
2994 If you wish to incorporate parts of the Program into other free
2995 programs whose distribution conditions are different, write to the author
2996 to ask for permission. For software which is copyrighted by the Free
2997 Software Foundation, write to the Free Software Foundation; we sometimes
2998 make exceptions for this. Our decision will be guided by the two goals
2999 of preserving the free status of all derivatives of our free software and
3000 of promoting the sharing and reuse of software generally.
3003 @heading NO WARRANTY
3011 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
3012 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
3013 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
3014 PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
3015 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3016 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
3017 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
3018 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
3019 REPAIR OR CORRECTION.
3022 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
3023 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
3024 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
3025 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
3026 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
3027 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
3028 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
3029 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
3030 POSSIBILITY OF SUCH DAMAGES.
3034 @heading END OF TERMS AND CONDITIONS
3037 @center END OF TERMS AND CONDITIONS
3041 @unnumberedsec How to Apply These Terms to Your New Programs
3043 If you develop a new program, and you want it to be of the greatest
3044 possible use to the public, the best way to achieve this is to make it
3045 free software which everyone can redistribute and change under these terms.
3047 To do so, attach the following notices to the program. It is safest
3048 to attach them to the start of each source file to most effectively
3049 convey the exclusion of warranty; and each file should have at least
3050 the ``copyright'' line and a pointer to where the full notice is found.
3053 @var{one line to give the program's name and an idea of what it does.}
3054 Copyright (C) 19@var{yy} @var{name of author}
3056 This program is free software; you can redistribute it and/or
3057 modify it under the terms of the GNU General Public License
3058 as published by the Free Software Foundation; either version 2
3059 of the License, or (at your option) any later version.
3061 This program is distributed in the hope that it will be useful,
3062 but WITHOUT ANY WARRANTY; without even the implied warranty of
3063 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3064 GNU General Public License for more details.
3066 You should have received a copy of the GNU General Public License
3067 along with this program; if not, write to the Free Software
3068 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3071 Also add information on how to contact you by electronic and paper mail.
3073 If the program is interactive, make it output a short notice like this
3074 when it starts in an interactive mode:
3077 Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
3078 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
3079 type `show w'. This is free software, and you are welcome
3080 to redistribute it under certain conditions; type `show c'
3084 The hypothetical commands @samp{show w} and @samp{show c} should show
3085 the appropriate parts of the General Public License. Of course, the
3086 commands you use may be called something other than @samp{show w} and
3087 @samp{show c}; they could even be mouse-clicks or menu items---whatever
3090 You should also get your employer (if you work as a programmer) or your
3091 school, if any, to sign a ``copyright disclaimer'' for the program, if
3092 necessary. Here is a sample; alter the names:
3096 Yoyodyne, Inc., hereby disclaims all copyright
3097 interest in the program `Gnomovision'
3098 (which makes passes at compilers) written
3101 @var{signature of Ty Coon}, 1 April 1989
3102 Ty Coon, President of Vice
3106 This General Public License does not permit incorporating your program into
3107 proprietary programs. If your program is a subroutine library, you may
3108 consider it more useful to permit linking proprietary applications with the
3109 library. If this is what you want to do, use the GNU Library General
3110 Public License instead of this License.
3112 @node Concept Index, , Copying, Top
3113 @unnumbered Concept Index