]> sjero.net Git - wget/blob - doc/wget.texi
[svn] * sample.wgetrc: Added entries for backup_converted and waitretry.
[wget] / doc / wget.texi
1 \input texinfo   @c -*-texinfo-*-
2
3 @c %**start of header
4 @setfilename wget.info
5 @settitle GNU Wget Manual
6 @c Disable the monstrous rectangles beside overfull hbox-es.
7 @finalout
8 @c Use `odd' to print double-sided.
9 @setchapternewpage on
10 @c %**end of header
11
12 @iftex
13 @c Remove this if you don't use A4 paper.
14 @afourpaper
15 @end iftex
16
17 @c This should really be auto-generated!
18 @set VERSION 1.5.3+dev
19 @set UPDATED Feb 2000
20
21 @dircategory Net Utilities
22 @dircategory World Wide Web
23 @direntry
24 * Wget: (wget).         The non-interactive network downloader.
25 @end direntry
26
27 @ifinfo
28 This file documents the the GNU Wget utility for downloading network
29 data.
30
31 Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
32
33 Permission is granted to make and distribute verbatim copies of
34 this manual provided the copyright notice and this permission notice
35 are preserved on all copies.
36
37 @ignore
38 Permission is granted to process this file through TeX and print the
39 results, provided the printed document carries a copying permission
40 notice identical to this one except for the removal of this paragraph
41 (this paragraph not being relevant to the printed manual).
42 @end ignore
43 Permission is granted to copy and distribute modified versions of this
44 manual under the conditions for verbatim copying, provided also that the
45 sections entitled ``Copying'' and ``GNU General Public License'' are
46 included exactly as in the original, and provided that the entire
47 resulting derived work is distributed under the terms of a permission
48 notice identical to this one.
49 @end ifinfo
50
51 @titlepage
52 @title GNU Wget
53 @subtitle The noninteractive downloading utility
54 @subtitle Updated for Wget @value{VERSION}, @value{UPDATED}
55 @author by Hrvoje Nik@v{s}i@'{c} and the developers
56
57 @page
58 @vskip 0pt plus 1filll
59 Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc.
60
61 Permission is granted to make and distribute verbatim copies of this
62 manual provided the copyright notice and this permission notice are
63 preserved on all copies.
64
65 Permission is granted to copy and distribute modified versions of this
66 manual under the conditions for verbatim copying, provided also that the
67 sections entitled ``Copying'' and ``GNU General Public License'' are
68 included exactly as in the original, and provided that the entire
69 resulting derived work is distributed under the terms of a permission
70 notice identical to this one.
71
72 Permission is granted to copy and distribute translations of this manual
73 into another language, under the above conditions for modified versions,
74 except that this permission notice may be stated in a translation
75 approved by the Free Software Foundation.
76 @end titlepage
77
78 @ifinfo
79 @node Top, Overview, (dir), (dir)
80 @top Wget @value{VERSION}
81
82 This manual documents version @value{VERSION} of GNU Wget, the freely
83 available utility for network download.
84
85 Copyright @copyright{} 1996, 1997, 1998 Free Software Foundation, Inc.
86
87 @menu
88 * Overview::            Features of Wget.
89 * Invoking::            Wget command-line arguments.
90 * Recursive Retrieval:: Description of recursive retrieval.
91 * Following Links::     The available methods of chasing links.
92 * Time-Stamping::       Mirroring according to time-stamps.
93 * Startup File::        Wget's initialization file.
94 * Examples::            Examples of usage.
95 * Various::             The stuff that doesn't fit anywhere else.
96 * Appendices::          Some useful references.
97 * Copying::             You may give out copies of Wget.
98 * Concept Index::       Topics covered by this manual.
99 @end menu
100 @end ifinfo
101
102 @node Overview, Invoking, Top, Top
103 @chapter Overview
104 @cindex overview
105 @cindex features
106
107 GNU Wget is a freely available network utility to retrieve files from
108 the World Wide Web, using @sc{http} (Hyper Text Transfer Protocol) and
109 @sc{ftp} (File Transfer Protocol), the two most widely used Internet
110 protocols.  It has many useful features to make downloading easier, some
111 of them being:
112
113 @itemize @bullet
114 @item
115 Wget is non-interactive, meaning that it can work in the background,
116 while the user is not logged on.  This allows you to start a retrieval
117 and disconnect from the system, letting Wget finish the work.  By
118 contrast, most of the Web browsers require constant user's presence,
119 which can be a great hindrance when transferring a lot of data.
120
121 @sp 1
122 @item
123 Wget is capable of descending recursively through the structure of
124 @sc{html} documents and @sc{ftp} directory trees, making a local copy of
125 the directory hierarchy similar to the one on the remote server.  This
126 feature can be used to mirror archives and home pages, or traverse the
127 web in search of data, like a @sc{www} robot (@xref{Robots}).  In that
128 spirit, Wget understands the @code{norobots} convention.
129
130 @sp 1
131 @item
132 File name wildcard matching and recursive mirroring of directories are
133 available when retrieving via @sc{ftp}.  Wget can read the time-stamp
134 information given by both @sc{http} and @sc{ftp} servers, and store it
135 locally.  Thus Wget can see if the remote file has changed since last
136 retrieval, and automatically retrieve the new version if it has.  This
137 makes Wget suitable for mirroring of @sc{ftp} sites, as well as home
138 pages.
139
140 @sp 1
141 @item
142 Wget works exceedingly well on slow or unstable connections,
143 retrying the document until it is fully retrieved, or until a
144 user-specified retry count is surpassed.  It will try to resume the
145 download from the point of interruption, using @code{REST} with @sc{ftp}
146 and @code{Range} with @sc{http} servers that support them.
147
148 @sp 1
149 @item
150 By default, Wget supports proxy servers, which can lighten the network
151 load, speed up retrieval and provide access behind firewalls.  However,
152 if you are behind a firewall that requires that you use a socks style
153 gateway, you can get the socks library and build wget with support for
154 socks.  Wget also supports the passive @sc{ftp} downloading as an
155 option.
156
157 @sp 1
158 @item
159 Builtin features offer mechanisms to tune which links you wish to follow
160 (@xref{Following Links}).
161
162 @sp 1
163 @item
164 The retrieval is conveniently traced with printing dots, each dot
165 representing a fixed amount of data received (1KB by default).  These
166 representations can be customized to your preferences.
167
168 @sp 1
169 @item
170 Most of the features are fully configurable, either through command line
171 options, or via the initialization file @file{.wgetrc} (@xref{Startup
172 File}).  Wget allows you to define @dfn{global} startup files
173 (@file{/usr/local/etc/wgetrc} by default) for site settings.
174
175 @sp 1
176 @item
177 Finally, GNU Wget is free software.  This means that everyone may use
178 it, redistribute it and/or modify it under the terms of the GNU General
179 Public License, as published by the Free Software Foundation
180 (@xref{Copying}).
181 @end itemize
182
183 @node Invoking, Recursive Retrieval, Overview, Top
184 @chapter Invoking
185 @cindex invoking
186 @cindex command line
187 @cindex arguments
188 @cindex nohup
189
190 By default, Wget is very simple to invoke.  The basic syntax is:
191
192 @example
193 wget [@var{option}]@dots{} [@var{URL}]@dots{}
194 @end example
195
196 Wget will simply download all the @sc{url}s specified on the command
197 line.  @var{URL} is a @dfn{Uniform Resource Locator}, as defined below.
198
199 However, you may wish to change some of the default parameters of
200 Wget.  You can do it two ways: permanently, adding the appropriate
201 command to @file{.wgetrc} (@xref{Startup File}), or specifying it on
202 the command line.
203
204 @menu
205 * URL Format::
206 * Option Syntax::
207 * Basic Startup Options::
208 * Logging and Input File Options::
209 * Download Options::
210 * Directory Options::
211 * HTTP Options::
212 * FTP Options::
213 * Recursive Retrieval Options::
214 * Recursive Accept/Reject Options::
215 @end menu
216
217 @node URL Format, Option Syntax, Invoking, Invoking
218 @section URL Format
219 @cindex URL
220 @cindex URL syntax
221
222 @dfn{URL} is an acronym for Uniform Resource Locator.  A uniform
223 resource locator is a compact string representation for a resource
224 available via the Internet.  Wget recognizes the @sc{url} syntax as per
225 @sc{rfc1738}.  This is the most widely used form (square brackets denote
226 optional parts):
227
228 @example
229 http://host[:port]/directory/file
230 ftp://host[:port]/directory/file
231 @end example
232
233 You can also encode your username and password within a @sc{url}:
234
235 @example
236 ftp://user:password@@host/path
237 http://user:password@@host/path
238 @end example
239
240 Either @var{user} or @var{password}, or both, may be left out.  If you
241 leave out either the @sc{http} username or password, no authentication
242 will be sent.  If you leave out the @sc{ftp} username, @samp{anonymous}
243 will be used.  If you leave out the @sc{ftp} password, your email
244 address will be supplied as a default password.@footnote{If you have a
245 @file{.netrc} file in your home directory, password will also be
246 searched for there.}
247
248 You can encode unsafe characters in a @sc{url} as @samp{%xy}, @code{xy}
249 being the hexadecimal representation of the character's @sc{ascii}
250 value.  Some common unsafe characters include @samp{%} (quoted as
251 @samp{%25}), @samp{:} (quoted as @samp{%3A}), and @samp{@@} (quoted as
252 @samp{%40}).  Refer to @sc{rfc1738} for a comprehensive list of unsafe
253 characters.
254
255 Wget also supports the @code{type} feature for @sc{ftp} @sc{url}s.  By
256 default, @sc{ftp} documents are retrieved in the binary mode (type
257 @samp{i}), which means that they are downloaded unchanged.  Another
258 useful mode is the @samp{a} (@dfn{ASCII}) mode, which converts the line
259 delimiters between the different operating systems, and is thus useful
260 for text files.  Here is an example:
261
262 @example
263 ftp://host/directory/file;type=a
264 @end example
265
266 Two alternative variants of @sc{url} specification are also supported,
267 because of historical (hysterical?) reasons and their widespreaded use.
268
269 @sc{ftp}-only syntax (supported by @code{NcFTP}):
270 @example
271 host:/dir/file
272 @end example
273
274 @sc{http}-only syntax (introduced by @code{Netscape}):
275 @example
276 host[:port]/dir/file
277 @end example
278
279 These two alternative forms are deprecated, and may cease being
280 supported in the future.
281
282 If you do not understand the difference between these notations, or do
283 not know which one to use, just use the plain ordinary format you use
284 with your favorite browser, like @code{Lynx} or @code{Netscape}.
285
286 @node Option Syntax, Basic Startup Options, URL Format, Invoking
287 @section Option Syntax
288 @cindex option syntax
289 @cindex syntax of options
290
291 Since Wget uses GNU getopts to process its arguments, every option has a
292 short form and a long form.  Long options are more convenient to
293 remember, but take time to type.  You may freely mix different option
294 styles, or specify options after the command-line arguments. Thus you
295 may write:
296
297 @example
298 wget -r --tries=10 http://fly.cc.fer.hr/ -o log
299 @end example
300
301 The space between the option accepting an argument and the argument may
302 be omitted.  Instead @samp{-o log} you can write @samp{-olog}.
303
304 You may put several options that do not require arguments together,
305 like:
306
307 @example
308 wget -drc @var{URL}
309 @end example
310
311 This is a complete equivalent of:
312
313 @example
314 wget -d -r -c @var{URL}
315 @end example
316
317 Since the options can be specified after the arguments, you may
318 terminate them with @samp{--}.  So the following will try to download
319 @sc{url} @samp{-x}, reporting failure to @file{log}:
320
321 @example
322 wget -o log -- -x
323 @end example
324
325 The options that accept comma-separated lists all respect the convention
326 that specifying an empty list clears its value.  This can be useful to
327 clear the @file{.wgetrc} settings.  For instance, if your @file{.wgetrc}
328 sets @code{exclude_directories} to @file{/cgi-bin}, the following
329 example will first reset it, and then set it to exclude @file{/~nobody}
330 and @file{/~somebody}.  You can also clear the lists in @file{.wgetrc}
331 (@xref{Wgetrc Syntax}).
332
333 @example
334 wget -X '' -X /~nobody,/~somebody
335 @end example
336
337 @node Basic Startup Options, Logging and Input File Options, Option Syntax, Invoking
338 @section Basic Startup Options
339
340 @table @samp
341 @item -V
342 @itemx --version
343 Display the version of Wget.
344
345 @item -h
346 @itemx --help
347 Print a help message describing all of Wget's command-line options.
348
349 @item -b
350 @itemx --background
351 Go to background immediately after startup.  If no output file is
352 specified via the @samp{-o}, output is redirected to @file{wget-log}.
353
354 @cindex execute wgetrc command
355 @item -e @var{command}
356 @itemx --execute @var{command}
357 Execute @var{command} as if it were a part of @file{.wgetrc}
358 (@xref{Startup File}).  A command thus invoked will be executed
359 @emph{after} the commands in @file{.wgetrc}, thus taking precedence over
360 them.
361 @end table
362
363 @node Logging and Input File Options, Download Options, Basic Startup Options, Invoking
364 @section Logging and Input File Options
365
366 @table @samp
367 @cindex output file
368 @cindex log file
369 @item -o @var{logfile}
370 @itemx --output-file=@var{logfile}
371 Log all messages to @var{logfile}.  The messages are normally reported
372 to standard error.
373
374 @cindex append to log
375 @item -a @var{logfile}
376 @itemx --append-output=@var{logfile}
377 Append to @var{logfile}.  This is the same as @samp{-o}, only it appends
378 to @var{logfile} instead of overwriting the old log file.  If
379 @var{logfile} does not exist, a new file is created.
380
381 @cindex debug
382 @item -d
383 @itemx --debug
384 Turn on debug output, meaning various information important to the
385 developers of Wget if it does not work properly.  Your system
386 administrator may have chosen to compile Wget without debug support, in
387 which case @samp{-d} will not work.  Please note that compiling with
388 debug support is always safe---Wget compiled with the debug support will
389 @emph{not} print any debug info unless requested with @samp{-d}.
390 @xref{Reporting Bugs} for more information on how to use @samp{-d} for
391 sending bug reports.
392
393 @cindex quiet
394 @item -q
395 @itemx --quiet
396 Turn off Wget's output.
397
398 @cindex verbose
399 @item -v
400 @itemx --verbose
401 Turn on verbose output, with all the available data.  The default output
402 is verbose.
403
404 @item -nv
405 @itemx --non-verbose
406 Non-verbose output---turn off verbose without being completely quiet
407 (use @samp{-q} for that), which means that error messages and basic
408 information still get printed.
409
410 @cindex input-file
411 @item -i @var{file}
412 @itemx --input-file=@var{file}
413 Read @sc{url}s from @var{file}, in which case no @sc{url}s need to be on
414 the command line.  If there are @sc{url}s both on the command line and
415 in an input file, those on the command lines will be the first ones to
416 be retrieved.  The @var{file} need not be an @sc{html} document (but no
417 harm if it is)---it is enough if the @sc{url}s are just listed
418 sequentially.
419
420 However, if you specify @samp{--force-html}, the document will be
421 regarded as @samp{html}.  In that case you may have problems with
422 relative links, which you can solve either by adding @code{<base
423 href="@var{url}">} to the documents or by specifying
424 @samp{--base=@var{url}} on the command line.
425
426 @cindex force html
427 @item -F
428 @itemx --force-html
429 When input is read from a file, force it to be treated as an @sc{html}
430 file.  This enables you to retrieve relative links from existing
431 @sc{html} files on your local disk, by adding @code{<base
432 href="@var{url}">} to @sc{html}, or using the @samp{--base} command-line
433 option.
434 @end table
435
436 @node Download Options, Directory Options, Logging and Input File Options, Invoking
437 @section Download Options
438
439 @table @samp
440 @cindex retries
441 @cindex tries
442 @cindex number of retries
443 @item -t @var{number}
444 @itemx --tries=@var{number}
445 Set number of retries to @var{number}.  Specify 0 or @samp{inf} for
446 infinite retrying.
447
448 @item -O @var{file}
449 @itemx --output-document=@var{file}
450 The documents will not be written to the appropriate files, but all will
451 be concatenated together and written to @var{file}.  If @var{file}
452 already exists, it will be overwritten.  If the @var{file} is @samp{-},
453 the documents will be written to standard output.  Including this option
454 automatically sets the number of tries to 1.
455
456 @cindex no-clobber
457 @item -nc
458 @itemx --no-clobber
459 Do not clobber existing files when saving to directory hierarchy within
460 recursive retrieval of several files. This option is @emph{extremely}
461 useful when you wish to continue where you left off with retrieval of
462 many files.  If the files have the @samp{.html} or (yuck) @samp{.htm}
463 suffix, they will be loaded from the local disk, and parsed as if they
464 have been retrieved from the Web.
465
466 @cindex continue retrieval
467 @item -c
468 @itemx --continue
469 Continue getting an existing file.  This is useful when you want to
470 finish up the download started by another program, or a previous
471 instance of Wget.  Thus you can write:
472
473 @example
474 wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z
475 @end example
476
477 If there is a file name @file{ls-lR.Z} in the current directory, Wget
478 will assume that it is the first portion of the remote file, and will
479 require the server to continue the retrieval from an offset equal to the
480 length of the local file.
481
482 Note that you need not specify this option if all you want is Wget to
483 continue retrieving where it left off when the connection is lost---Wget
484 does this by default.  You need this option only when you want to
485 continue retrieval of a file already halfway retrieved, saved by another
486 @sc{ftp} client, or left by Wget being killed.
487
488 Without @samp{-c}, the previous example would just begin to download the
489 remote file to @file{ls-lR.Z.1}.  The @samp{-c} option is also
490 applicable for @sc{http} servers that support the @code{Range} header.
491
492 @cindex dot style
493 @cindex retrieval tracing style
494 @item --dot-style=@var{style}
495 Set the retrieval style to @var{style}.  Wget traces the retrieval of
496 each document by printing dots on the screen, each dot representing a
497 fixed amount of retrieved data.  Any number of dots may be separated in
498 a @dfn{cluster}, to make counting easier.  This option allows you to
499 choose one of the pre-defined styles, determining the number of bytes
500 represented by a dot, the number of dots in a cluster, and the number of
501 dots on the line.
502
503 With the @code{default} style each dot represents 1K, there are ten dots
504 in a cluster and 50 dots in a line.  The @code{binary} style has a more
505 ``computer''-like orientation---8K dots, 16-dots clusters and 48 dots
506 per line (which makes for 384K lines).  The @code{mega} style is
507 suitable for downloading very large files---each dot represents 64K
508 retrieved, there are eight dots in a cluster, and 48 dots on each line
509 (so each line contains 3M).  The @code{micro} style is exactly the
510 reverse; it is suitable for downloading small files, with 128-byte dots,
511 8 dots per cluster, and 48 dots (6K) per line.
512
513 @item -N
514 @itemx --timestamping
515 Turn on time-stamping.  @xref{Time-Stamping} for details.
516
517 @cindex server response, print
518 @item -S
519 @itemx --server-response
520 Print the headers sent by @sc{http} servers and responses sent by
521 @sc{ftp} servers.
522
523 @cindex Wget as spider
524 @cindex spider
525 @item --spider
526 When invoked with this option, Wget will behave as a Web @dfn{spider},
527 which means that it will not download the pages, just check that they
528 are there.  You can use it to check your bookmarks, e.g. with:
529
530 @example
531 wget --spider --force-html -i bookmarks.html
532 @end example
533
534 This feature needs much more work for Wget to get close to the
535 functionality of real @sc{www} spiders.
536
537 @cindex timeout
538 @item -T seconds
539 @itemx --timeout=@var{seconds}
540 Set the read timeout to @var{seconds} seconds.  Whenever a network read
541 is issued, the file descriptor is checked for a timeout, which could
542 otherwise leave a pending connection (uninterrupted read).  The default
543 timeout is 900 seconds (fifteen minutes).  Setting timeout to 0 will
544 disable checking for timeouts.
545
546 Please do not lower the default timeout value with this option unless
547 you know what you are doing.
548
549 @cindex pause
550 @cindex wait
551 @item -w @var{seconds}
552 @itemx --wait=@var{seconds}
553 Wait the specified number of seconds between the retrievals.  Use of
554 this option is recommended, as it lightens the server load by making the
555 requests less frequent.  Instead of in seconds, the time can be
556 specified in minutes using the @code{m} suffix, in hours using @code{h}
557 suffix, or in days using @code{d} suffix.
558
559 Specifying a large value for this option is useful if the network or the
560 destination host is down, so that Wget can wait long enough to
561 reasonably expect the network error to be fixed before the retry.
562
563 @cindex retries, waiting between
564 @cindex waiting between retries
565 @item --waitretry=@var{seconds}
566 If you don't want Wget to wait between @emph{every} retrieval, but only
567 between retries of failed downloads, you can use this option.  If you
568 want to make sure you never "hammer" remote sites with rapid retries,
569 you can leave it set all the time to some non-zero value using the
570 waitretry variable in your @file{.wgetrc} file.
571
572 @cindex proxy
573 @item -Y on/off
574 @itemx --proxy=on/off
575 Turn proxy support on or off. The proxy is on by default if the
576 appropriate environmental variable is defined.
577
578 @cindex quota
579 @item -Q @var{quota}
580 @itemx --quota=@var{quota}
581 Specify download quota for automatic retrievals.  The value can be
582 specified in bytes (default), kilobytes (with @samp{k} suffix), or
583 megabytes (with @samp{m} suffix).
584
585 Note that quota will never affect downloading a single file.  So if you
586 specify @samp{wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz}, all of the
587 @file{ls-lR.gz} will be downloaded.  The same goes even when several
588 @sc{url}s are specified on the command-line.  However, quota is
589 respected when retrieving either recursively, or from an input file.
590 Thus you may safely type @samp{wget -Q2m -i sites}---download will be
591 aborted when the quota is exceeded.
592
593 Setting quota to 0 or to @samp{inf} unlimits the download quota.
594 @end table
595
596 @node Directory Options, HTTP Options, Download Options, Invoking
597 @section Directory Options
598
599 @table @samp
600 @item -nd
601 @itemx --no-directories
602 Do not create a hierarchy of directories when retrieving
603 recursively. With this option turned on, all files will get saved to the
604 current directory, without clobbering (if a name shows up more than
605 once, the filenames will get extensions @samp{.n}).
606
607 @item -x
608 @itemx --force-directories
609 The opposite of @samp{-nd}---create a hierarchy of directories, even if
610 one would not have been created otherwise.  E.g. @samp{wget -x
611 http://fly.cc.fer.hr/robots.txt} will save the downloaded file to
612 @file{fly.cc.fer.hr/robots.txt}.
613
614 @item -nH
615 @itemx --no-host-directories
616 Disable generation of host-prefixed directories.  By default, invoking
617 Wget with @samp{-r http://fly.cc.fer.hr/} will create a structure of
618 directories beginning with @file{fly.cc.fer.hr/}.  This option disables
619 such behavior.
620
621 @cindex cut directories
622 @item --cut-dirs=@var{number}
623 Ignore @var{number} directory components.  This is useful for getting a
624 fine-grained control over the directory where recursive retrieval will
625 be saved.
626
627 Take, for example, the directory at
628 @samp{ftp://ftp.xemacs.org/pub/xemacs/}.  If you retrieve it with
629 @samp{-r}, it will be saved locally under
630 @file{ftp.xemacs.org/pub/xemacs/}.  While the @samp{-nH} option can
631 remove the @file{ftp.xemacs.org/} part, you are still stuck with
632 @file{pub/xemacs}.  This is where @samp{--cut-dirs} comes in handy; it
633 makes Wget not ``see'' @var{number} remote directory components.  Here
634 are several examples of how @samp{--cut-dirs} option works.
635
636 @example
637 @group
638 No options        -> ftp.xemacs.org/pub/xemacs/
639 -nH               -> pub/xemacs/
640 -nH --cut-dirs=1  -> xemacs/
641 -nH --cut-dirs=2  -> .
642
643 --cut-dirs=1      -> ftp.xemacs.org/xemacs/
644 ...
645 @end group
646 @end example
647
648 If you just want to get rid of the directory structure, this option is
649 similar to a combination of @samp{-nd} and @samp{-P}.  However, unlike
650 @samp{-nd}, @samp{--cut-dirs} does not lose with subdirectories---for
651 instance, with @samp{-nH --cut-dirs=1}, a @file{beta/} subdirectory will
652 be placed to @file{xemacs/beta}, as one would expect.
653
654 @cindex directory prefix
655 @item -P @var{prefix}
656 @itemx --directory-prefix=@var{prefix}
657 Set directory prefix to @var{prefix}.  The @dfn{directory prefix} is the
658 directory where all other files and subdirectories will be saved to,
659 i.e. the top of the retrieval tree.  The default is @samp{.} (the
660 current directory).
661 @end table
662
663 @node HTTP Options, FTP Options, Directory Options, Invoking
664 @section HTTP Options
665
666 @table @samp
667 @cindex http user
668 @cindex http password
669 @cindex authentication
670 @item --http-user=@var{user}
671 @itemx --http-passwd=@var{password}
672 Specify the username @var{user} and password @var{password} on an
673 @sc{http} server.  According to the type of the challenge, Wget will
674 encode them using either the @code{basic} (insecure) or the
675 @code{digest} authentication scheme.
676
677 Another way to specify username and password is in the @sc{url} itself
678 (@xref{URL Format}).  For more information about security issues with
679 Wget, @xref{Security Considerations}.
680
681 @cindex proxy
682 @cindex cache
683 @item -C on/off
684 @itemx --cache=on/off
685 When set to off, disable server-side cache.  In this case, Wget will
686 send the remote server an appropriate directive (@samp{Pragma:
687 no-cache}) to get the file from the remote service, rather than
688 returning the cached version.  This is especially useful for retrieving
689 and flushing out-of-date documents on proxy servers.
690
691 Caching is allowed by default.
692
693 @cindex Content-Length, ignore
694 @cindex ignore length
695 @item --ignore-length
696 Unfortunately, some @sc{http} servers (@sc{cgi} programs, to be more
697 precise) send out bogus @code{Content-Length} headers, which makes Wget
698 go wild, as it thinks not all the document was retrieved.  You can spot
699 this syndrome if Wget retries getting the same document again and again,
700 each time claiming that the (otherwise normal) connection has closed on
701 the very same byte.
702
703 With this option, Wget will ignore the @code{Content-Length} header---as
704 if it never existed.
705
706 @cindex header, add
707 @item --header=@var{additional-header}
708 Define an @var{additional-header} to be passed to the @sc{http} servers.
709 Headers must contain a @samp{:} preceded by one or more non-blank
710 characters, and must not contain newlines.
711
712 You may define more than one additional header by specifying
713 @samp{--header} more than once.
714
715 @example
716 @group
717 wget --header='Accept-Charset: iso-8859-2' \
718      --header='Accept-Language: hr'        \
719        http://fly.cc.fer.hr/
720 @end group
721 @end example
722
723 Specification of an empty string as the header value will clear all
724 previous user-defined headers.
725
726 @cindex proxy user
727 @cindex proxy password
728 @cindex proxy authentication
729 @item --proxy-user=@var{user}
730 @itemx --proxy-passwd=@var{password}
731 Specify the username @var{user} and password @var{password} for
732 authentication on a proxy server.  Wget will encode them using the
733 @code{basic} authentication scheme.
734
735 @cindex server response, save
736 @item -s
737 @itemx --save-headers
738 Save the headers sent by the @sc{http} server to the file, preceding the
739 actual contents, with an empty line as the separator.
740
741 @cindex user-agent
742 @item -U @var{agent-string}
743 @itemx --user-agent=@var{agent-string}
744 Identify as @var{agent-string} to the @sc{http} server.
745
746 The @sc{http} protocol allows the clients to identify themselves using a
747 @code{User-Agent} header field.  This enables distinguishing the
748 @sc{www} software, usually for statistical purposes or for tracing of
749 protocol violations.  Wget normally identifies as
750 @samp{Wget/@var{version}}, @var{version} being the current version
751 number of Wget.
752
753 However, some sites have been known to impose the policy of tailoring
754 the output according to the @code{User-Agent}-supplied information.
755 While conceptually this is not such a bad idea, it has been abused by
756 servers denying information to clients other than @code{Mozilla} or
757 Microsoft @code{Internet Explorer}.  This option allows you to change
758 the @code{User-Agent} line issued by Wget.  Use of this option is
759 discouraged, unless you really know what you are doing.
760
761 @strong{NOTE} that Netscape Communications Corp. has claimed that false
762 transmissions of @samp{Mozilla} as the @code{User-Agent} are a copyright
763 infringement, which will be prosecuted.  @strong{DO NOT} misrepresent
764 Wget as Mozilla.
765 @end table
766
767 @node FTP Options, Recursive Retrieval Options, HTTP Options, Invoking
768 @section FTP Options
769
770 @table @samp
771 @cindex retrieve symbolic links
772 @item --retr-symlinks
773 Retrieve symbolic links on @sc{ftp} sites as if they were plain files,
774 i.e. don't just create links locally.
775
776 @cindex globbing, toggle
777 @item -g on/off
778 @itemx --glob=on/off
779 Turn @sc{ftp} globbing on or off.  Globbing means you may use the
780 shell-like special characters (@dfn{wildcards}), like @samp{*},
781 @samp{?}, @samp{[} and @samp{]} to retrieve more than one file from the
782 same directory at once, like:
783
784 @example
785 wget ftp://gnjilux.cc.fer.hr/*.msg
786 @end example
787
788 By default, globbing will be turned on if the @sc{url} contains a
789 globbing character.  This option may be used to turn globbing on or off
790 permanently.
791
792 You may have to quote the @sc{url} to protect it from being expanded by
793 your shell.  Globbing makes Wget look for a directory listing, which is
794 system-specific.  This is why it currently works only with Unix @sc{ftp}
795 servers (and the ones emulating Unix @code{ls} output).
796
797 @cindex passive ftp
798 @item --passive-ftp
799 Use the @dfn{passive} @sc{ftp} retrieval scheme, in which the client
800 initiates the data connection.  This is sometimes required for @sc{ftp}
801 to work behind firewalls.
802 @end table
803
804 @node Recursive Retrieval Options, Recursive Accept/Reject Options, FTP Options, Invoking
805 @section Recursive Retrieval Options
806
807 @table @samp
808 @item -r
809 @itemx --recursive
810 Turn on recursive retrieving.  @xref{Recursive Retrieval} for more
811 details.
812
813 @item -l @var{depth}
814 @itemx --level=@var{depth}
815 Specify recursion maximum depth level @var{depth} (@xref{Recursive
816 Retrieval}).  The default maximum depth is 5.
817
818 @cindex proxy filling
819 @cindex delete after retrieval
820 @cindex filling proxy cache
821 @item --delete-after
822 This option tells Wget to delete every single file it downloads,
823 @emph{after} having done so.  It is useful for pre-fetching popular
824 pages through proxy, e.g.:
825
826 @example
827 wget -r -nd --delete-after http://whatever.com/~popular/page/
828 @end example
829
830 The @samp{-r} option is to retrieve recursively, and @samp{-nd} not to
831 create directories.
832
833 @cindex conversion of links
834 @cindex link conversion
835 @item -k
836 @itemx --convert-links
837 Convert the non-relative links to relative ones locally.  Only the
838 references to the documents actually downloaded will be converted; the
839 rest will be left unchanged.
840
841 Note that only at the end of the download can Wget know which links have
842 been downloaded.  Because of that, much of the work done by @samp{-k}
843 will be performed at the end of the downloads.
844
845 @cindex backing up converted files
846 @item -K
847 @itemx --backup-converted
848 When converting a file, back up the original version with a @samp{.orig}
849 suffix.  Affects the behavior of @samp{-N} (@xref{HTTP Time-Stamping
850 Internals}).
851
852 @item -m
853 @itemx --mirror
854 Turn on options suitable for mirroring.  This option turns on recursion
855 and time-stamping, sets infinite recursion depth and keeps @sc{ftp}
856 directory listings.  It is currently equivalent to
857 @samp{-r -N -l inf -nr}.
858
859 @item -nr
860 @itemx --dont-remove-listing
861 Don't remove the temporary @file{.listing} files generated by @sc{ftp}
862 retrievals.  Normally, these files contain the raw directory listings
863 received from @sc{ftp} servers.  Not removing them can be useful to
864 access the full remote file list when running a mirror, or for debugging
865 purposes.
866 @end table
867
868 @node Recursive Accept/Reject Options,  , Recursive Retrieval Options, Invoking
869 @section Recursive Accept/Reject Options
870
871 @table @samp
872 @item -A @var{acclist} --accept @var{acclist}
873 @itemx -R @var{rejlist} --reject @var{rejlist}
874 Specify comma-separated lists of file name suffixes or patterns to
875 accept or reject (@xref{Types of Files} for more details).
876
877 @item -D @var{domain-list}
878 @itemx --domains=@var{domain-list}
879 Set domains to be accepted and @sc{dns} looked-up, where
880 @var{domain-list} is a comma-separated list.  Note that it does
881 @emph{not} turn on @samp{-H}.  This option speeds things up, even if
882 only one host is spanned (@xref{Domain Acceptance}).
883
884 @item --exclude-domains @var{domain-list}
885 Exclude the domains given in a comma-separated @var{domain-list} from
886 @sc{dns}-lookup (@xref{Domain Acceptance}).
887
888 @cindex follow FTP links
889 @item --follow-ftp
890 Follow @sc{ftp} links from @sc{html} documents.  Without this option,
891 Wget will ignore all the @sc{ftp} links.
892
893 @cindex tag-based recursive pruning
894 @item --follow-tags=@var{list}
895 Wget has an internal table of HTML tag / attribute pairs that it
896 considers when looking for linked documents during a recursive
897 retrieval.  If a user wants only a subset of those tags to be
898 considered, however, he or she should be specify such tags in a
899 comma-separated @var{list} with this option.
900
901 @item -G @var{list}
902 @itemx --ignore-tags=@var{list}
903 This is the opposite of the @samp{--follow-tags} option.  To skip
904 certain HTML tags when recursively looking for documents to download,
905 specify them in a comma-separated @var{list}.  The author of this option
906 likes to use the following command to download a single HTML page and
907 all documents necessary to display it properly:
908
909 @example
910 wget -Ga,area -H -k -K -nh -r http://@var{site}/@var{document}
911 @end example
912
913 @item -H
914 @itemx --span-hosts
915 Enable spanning across hosts when doing recursive retrieving (@xref{All
916 Hosts}).
917
918 @item -L
919 @itemx --relative
920 Follow relative links only.  Useful for retrieving a specific home page
921 without any distractions, not even those from the same hosts
922 (@xref{Relative Links}).
923
924 @item -I @var{list}
925 @itemx --include-directories=@var{list}
926 Specify a comma-separated list of directories you wish to follow when
927 downloading (@xref{Directory-Based Limits} for more details.)  Elements
928 of @var{list} may contain wildcards.
929
930 @item -X @var{list}
931 @itemx --exclude-directories=@var{list}
932 Specify a comma-separated list of directories you wish to exclude from
933 download (@xref{Directory-Based Limits} for more details.)  Elements of
934 @var{list} may contain wildcards.
935
936 @item -nh
937 @itemx --no-host-lookup
938 Disable the time-consuming @sc{dns} lookup of almost all hosts
939 (@xref{Host Checking}).
940
941 @item -np
942 @item --no-parent
943 Do not ever ascend to the parent directory when retrieving recursively.
944 This is a useful option, since it guarantees that only the files
945 @emph{below} a certain hierarchy will be downloaded.
946 @xref{Directory-Based Limits} for more details.
947 @end table
948
949 @node Recursive Retrieval, Following Links, Invoking, Top
950 @chapter Recursive Retrieval
951 @cindex recursion
952 @cindex retrieving
953 @cindex recursive retrieval
954
955 GNU Wget is capable of traversing parts of the Web (or a single
956 @sc{http} or @sc{ftp} server), depth-first following links and directory
957 structure.  This is called @dfn{recursive} retrieving, or
958 @dfn{recursion}.
959
960 With @sc{http} @sc{url}s, Wget retrieves and parses the @sc{html} from
961 the given @sc{url}, documents, retrieving the files the @sc{html}
962 document was referring to, through markups like @code{href}, or
963 @code{src}.  If the freshly downloaded file is also of type
964 @code{text/html}, it will be parsed and followed further.
965
966 The maximum @dfn{depth} to which the retrieval may descend is specified
967 with the @samp{-l} option (the default maximum depth is five layers).
968 @xref{Recursive Retrieval}.
969
970 When retrieving an @sc{ftp} @sc{url} recursively, Wget will retrieve all
971 the data from the given directory tree (including the subdirectories up
972 to the specified depth) on the remote server, creating its mirror image
973 locally.  @sc{ftp} retrieval is also limited by the @code{depth}
974 parameter.
975
976 By default, Wget will create a local directory tree, corresponding to
977 the one found on the remote server.
978
979 Recursive retrieving can find a number of applications, the most
980 important of which is mirroring.  It is also useful for @sc{www}
981 presentations, and any other opportunities where slow network
982 connections should be bypassed by storing the files locally.
983
984 You should be warned that invoking recursion may cause grave overloading
985 on your system, because of the fast exchange of data through the
986 network; all of this may hamper other users' work.  The same stands for
987 the foreign server you are mirroring---the more requests it gets in a
988 rows, the greater is its load.
989
990 Careless retrieving can also fill your file system uncontrollably, which
991 can grind the machine to a halt.
992
993 The load can be minimized by lowering the maximum recursion level
994 (@samp{-l}) and/or by lowering the number of retries (@samp{-t}).  You
995 may also consider using the @samp{-w} option to slow down your requests
996 to the remote servers, as well as the numerous options to narrow the
997 number of followed links (@xref{Following Links}).
998
999 Recursive retrieval is a good thing when used properly.  Please take all
1000 precautions not to wreak havoc through carelessness.
1001
1002 @node Following Links, Time-Stamping, Recursive Retrieval, Top
1003 @chapter Following Links
1004 @cindex links
1005 @cindex following links
1006
1007 When retrieving recursively, one does not wish to retrieve loads of
1008 unnecessary data.  Most of the time the users bear in mind exactly what
1009 they want to download, and want Wget to follow only specific links.
1010
1011 For example, if you wish to download the music archive from
1012 @samp{fly.cc.fer.hr}, you will not want to download all the home pages
1013 that happen to be referenced by an obscure part of the archive.
1014
1015 Wget possesses several mechanisms that allows you to fine-tune which
1016 links it will follow.
1017
1018 @menu
1019 * Relative Links::         Follow relative links only.
1020 * Host Checking::          Follow links on the same host.
1021 * Domain Acceptance::      Check on a list of domains.
1022 * All Hosts::              No host restrictions.
1023 * Types of Files::         Getting only certain files.
1024 * Directory-Based Limits:: Getting only certain directories.
1025 * FTP Links::              Following FTP links.
1026 @end menu
1027
1028 @node Relative Links, Host Checking, Following Links, Following Links
1029 @section Relative Links
1030 @cindex relative links
1031
1032 When only relative links are followed (option @samp{-L}), recursive
1033 retrieving will never span hosts.  No time-expensive @sc{dns}-lookups
1034 will be performed, and the process will be very fast, with the minimum
1035 strain of the network.  This will suit your needs often, especially when
1036 mirroring the output of various @code{x2html} converters, since they
1037 generally output relative links.
1038
1039 @node Host Checking, Domain Acceptance, Relative Links, Following Links
1040 @section Host Checking
1041 @cindex DNS lookup
1042 @cindex host lookup
1043 @cindex host checking
1044
1045 The drawback of following the relative links solely is that humans often
1046 tend to mix them with absolute links to the very same host, and the very
1047 same page.  In this mode (which is the default mode for following links)
1048 all @sc{url}s that refer to the same host will be retrieved.
1049
1050 The problem with this option are the aliases of the hosts and domains.
1051 Thus there is no way for Wget to know that @samp{regoc.srce.hr} and
1052 @samp{www.srce.hr} are the same host, or that @samp{fly.cc.fer.hr} is
1053 the same as @samp{fly.cc.etf.hr}.  Whenever an absolute link is
1054 encountered, the host is @sc{dns}-looked-up with @code{gethostbyname} to
1055 check whether we are maybe dealing with the same hosts.  Although the
1056 results of @code{gethostbyname} are cached, it is still a great
1057 slowdown, e.g. when dealing with large indices of home pages on different
1058 hosts (because each of the hosts must be @sc{dns}-resolved to see
1059 whether it just @emph{might} be an alias of the starting host).
1060
1061 To avoid the overhead you may use @samp{-nh}, which will turn off
1062 @sc{dns}-resolving and make Wget compare hosts literally.  This will
1063 make things run much faster, but also much less reliable
1064 (e.g. @samp{www.srce.hr} and @samp{regoc.srce.hr} will be flagged as
1065 different hosts).
1066
1067 Note that modern @sc{http} servers allow one IP address to host several
1068 @dfn{virtual servers}, each having its own directory hierarchy.  Such
1069 ``servers'' are distinguished by their hostnames (all of which point to
1070 the same IP address); for this to work, a client must send a @code{Host}
1071 header, which is what Wget does.  However, in that case Wget @emph{must
1072 not} try to divine a host's ``real'' address, nor try to use the same
1073 hostname for each access, i.e. @samp{-nh} must be turned on.
1074
1075 In other words, the @samp{-nh} option must be used to enable the
1076 retrieval from virtual servers distinguished by their hostnames.  As the
1077 number of such server setups grow, the behavior of @samp{-nh} may become
1078 the default in the future.
1079
1080 @node Domain Acceptance, All Hosts, Host Checking, Following Links
1081 @section Domain Acceptance
1082
1083 With the @samp{-D} option you may specify the domains that will be
1084 followed.  The hosts the domain of which is not in this list will not be
1085 @sc{dns}-resolved.  Thus you can specify @samp{-Dmit.edu} just to make
1086 sure that @strong{nothing outside of @sc{mit} gets looked up}.  This is
1087 very important and useful.  It also means that @samp{-D} does @emph{not}
1088 imply @samp{-H} (span all hosts), which must be specified explicitly.
1089 Feel free to use this options since it will speed things up, with almost
1090 all the reliability of checking for all hosts.  Thus you could invoke
1091
1092 @example
1093 wget -r -D.hr http://fly.cc.fer.hr/
1094 @end example
1095
1096 to make sure that only the hosts in @samp{.hr} domain get
1097 @sc{dns}-looked-up for being equal to @samp{fly.cc.fer.hr}.  So
1098 @samp{fly.cc.etf.hr} will be checked (only once!) and found equal, but
1099 @samp{www.gnu.ai.mit.edu} will not even be checked.
1100
1101 Of course, domain acceptance can be used to limit the retrieval to
1102 particular domains with spanning of hosts in them, but then you must
1103 specify @samp{-H} explicitly.  E.g.:
1104
1105 @example
1106 wget -r -H -Dmit.edu,stanford.edu http://www.mit.edu/
1107 @end example
1108
1109 will start with @samp{http://www.mit.edu/}, following links across
1110 @sc{mit} and Stanford.
1111
1112 If there are domains you want to exclude specifically, you can do it
1113 with @samp{--exclude-domains}, which accepts the same type of arguments
1114 of @samp{-D}, but will @emph{exclude} all the listed domains.  For
1115 example, if you want to download all the hosts from @samp{foo.edu}
1116 domain, with the exception of @samp{sunsite.foo.edu}, you can do it like
1117 this:
1118
1119 @example
1120 wget -rH -Dfoo.edu --exclude-domains sunsite.foo.edu http://www.foo.edu/
1121 @end example
1122
1123 @node All Hosts, Types of Files, Domain Acceptance, Following Links
1124 @section All Hosts
1125 @cindex all hosts
1126 @cindex span hosts
1127
1128 When @samp{-H} is specified without @samp{-D}, all hosts are freely
1129 spanned.  There are no restrictions whatsoever as to what part of the
1130 net Wget will go to fetch documents, other than maximum retrieval depth.
1131 If a page references @samp{www.yahoo.com}, so be it.  Such an option is
1132 rarely useful for itself.
1133
1134 @node Types of Files, Directory-Based Limits, All Hosts, Following Links
1135 @section Types of Files
1136 @cindex types of files
1137
1138 When downloading material from the web, you will often want to restrict
1139 the retrieval to only certain file types.  For example, if you are
1140 interested in downloading @sc{gif}s, you will not be overjoyed to get
1141 loads of PostScript documents, and vice versa.
1142
1143 Wget offers two options to deal with this problem.  Each option
1144 description lists a short name, a long name, and the equivalent command
1145 in @file{.wgetrc}.
1146
1147 @cindex accept wildcards
1148 @cindex accept suffixes
1149 @cindex wildcards, accept
1150 @cindex suffixes, accept
1151 @table @samp
1152 @item -A @var{acclist}
1153 @itemx --accept @var{acclist}
1154 @itemx accept = @var{acclist}
1155 The argument to @samp{--accept} option is a list of file suffixes or
1156 patterns that Wget will download during recursive retrieval.  A suffix
1157 is the ending part of a file, and consists of ``normal'' letters,
1158 e.g. @samp{gif} or @samp{.jpg}.  A matching pattern contains shell-like
1159 wildcards, e.g. @samp{books*} or @samp{zelazny*196[0-9]*}.
1160
1161 So, specifying @samp{wget -A gif,jpg} will make Wget download only the
1162 files ending with @samp{gif} or @samp{jpg}, i.e. @sc{gif}s and
1163 @sc{jpeg}s.  On the other hand, @samp{wget -A "zelazny*196[0-9]*"} will
1164 download only files beginning with @samp{zelazny} and containing numbers
1165 from 1960 to 1969 anywhere within.  Look up the manual of your shell for
1166 a description of how pattern matching works.
1167
1168 Of course, any number of suffixes and patterns can be combined into a
1169 comma-separated list, and given as an argument to @samp{-A}.
1170
1171 @cindex reject wildcards
1172 @cindex reject suffixes
1173 @cindex wildcards, reject
1174 @cindex suffixes, reject
1175 @item -R @var{rejlist}
1176 @itemx --reject @var{rejlist}
1177 @itemx reject = @var{rejlist}
1178 The @samp{--reject} option works the same way as @samp{--accept}, only
1179 its logic is the reverse; Wget will download all files @emph{except} the
1180 ones matching the suffixes (or patterns) in the list.
1181
1182 So, if you want to download a whole page except for the cumbersome
1183 @sc{mpeg}s and @sc{.au} files, you can use @samp{wget -R mpg,mpeg,au}.
1184 Analogously, to download all files except the ones beginning with
1185 @samp{bjork}, use @samp{wget -R "bjork*"}.  The quotes are to prevent
1186 expansion by the shell.
1187 @end table
1188
1189 The @samp{-A} and @samp{-R} options may be combined to achieve even
1190 better fine-tuning of which files to retrieve.  E.g. @samp{wget -A
1191 "*zelazny*" -R .ps} will download all the files having @samp{zelazny} as
1192 a part of their name, but @emph{not} the PostScript files.
1193
1194 Note that these two options do not affect the downloading of @sc{html}
1195 files; Wget must load all the @sc{html}s to know where to go at
1196 all---recursive retrieval would make no sense otherwise.
1197
1198 @node Directory-Based Limits, FTP Links, Types of Files, Following Links
1199 @section Directory-Based Limits
1200 @cindex directories
1201 @cindex directory limits
1202
1203 Regardless of other link-following facilities, it is often useful to
1204 place the restriction of what files to retrieve based on the directories
1205 those files are placed in.  There can be many reasons for this---the
1206 home pages may be organized in a reasonable directory structure; or some
1207 directories may contain useless information, e.g. @file{/cgi-bin} or
1208 @file{/dev} directories.
1209
1210 Wget offers three different options to deal with this requirement.  Each
1211 option description lists a short name, a long name, and the equivalent
1212 command in @file{.wgetrc}.
1213
1214 @cindex directories, include
1215 @cindex include directories
1216 @cindex accept directories
1217 @table @samp
1218 @item -I @var{list}
1219 @itemx --include @var{list}
1220 @itemx include_directories = @var{list}
1221 @samp{-I} option accepts a comma-separated list of directories included
1222 in the retrieval.  Any other directories will simply be ignored.  The
1223 directories are absolute paths.
1224
1225 So, if you wish to download from @samp{http://host/people/bozo/}
1226 following only links to bozo's colleagues in the @file{/people}
1227 directory and the bogus scripts in @file{/cgi-bin}, you can specify:
1228
1229 @example
1230 wget -I /people,/cgi-bin http://host/people/bozo/
1231 @end example
1232
1233 @cindex directories, exclude
1234 @cindex exclude directories
1235 @cindex reject directories
1236 @item -X @var{list}
1237 @itemx --exclude @var{list}
1238 @itemx exclude_directories = @var{list}
1239 @samp{-X} option is exactly the reverse of @samp{-I}---this is a list of
1240 directories @emph{excluded} from the download.  E.g. if you do not want
1241 Wget to download things from @file{/cgi-bin} directory, specify @samp{-X
1242 /cgi-bin} on the command line.
1243
1244 The same as with @samp{-A}/@samp{-R}, these two options can be combined
1245 to get a better fine-tuning of downloading subdirectories.  E.g. if you
1246 want to load all the files from @file{/pub} hierarchy except for
1247 @file{/pub/worthless}, specify @samp{-I/pub -X/pub/worthless}.
1248
1249 @cindex no parent
1250 @item -np
1251 @itemx --no-parent
1252 @itemx no_parent = on
1253 The simplest, and often very useful way of limiting directories is
1254 disallowing retrieval of the links that refer to the hierarchy
1255 @dfn{above} than the beginning directory, i.e. disallowing ascent to the
1256 parent directory/directories.
1257
1258 The @samp{--no-parent} option (short @samp{-np}) is useful in this case.
1259 Using it guarantees that you will never leave the existing hierarchy.
1260 Supposing you issue Wget with:
1261
1262 @example
1263 wget -r --no-parent http://somehost/~luzer/my-archive/
1264 @end example
1265
1266 You may rest assured that none of the references to
1267 @file{/~his-girls-homepage/} or @file{/~luzer/all-my-mpegs/} will be
1268 followed.  Only the archive you are interested in will be downloaded.
1269 Essentially, @samp{--no-parent} is similar to
1270 @samp{-I/~luzer/my-archive}, only it handles redirections in a more
1271 intelligent fashion.
1272 @end table
1273
1274 @node FTP Links,  , Directory-Based Limits, Following Links
1275 @section Following FTP Links
1276 @cindex following ftp links
1277
1278 The rules for @sc{ftp} are somewhat specific, as it is necessary for
1279 them to be.  @sc{ftp} links in @sc{html} documents are often included
1280 for purposes of reference, and it is often inconvenient to download them
1281 by default.
1282
1283 To have @sc{ftp} links followed from @sc{html} documents, you need to
1284 specify the @samp{--follow-ftp} option.  Having done that, @sc{ftp}
1285 links will span hosts regardless of @samp{-H} setting.  This is logical,
1286 as @sc{ftp} links rarely point to the same host where the @sc{http}
1287 server resides.  For similar reasons, the @samp{-L} options has no
1288 effect on such downloads.  On the other hand, domain acceptance
1289 (@samp{-D}) and suffix rules (@samp{-A} and @samp{-R}) apply normally.
1290
1291 Also note that followed links to @sc{ftp} directories will not be
1292 retrieved recursively further.
1293
1294 @node Time-Stamping, Startup File, Following Links, Top
1295 @chapter Time-Stamping
1296 @cindex time-stamping
1297 @cindex timestamping
1298 @cindex updating the archives
1299 @cindex incremental updating
1300
1301 One of the most important aspects of mirroring information from the
1302 Internet is updating your archives.
1303
1304 Downloading the whole archive again and again, just to replace a few
1305 changed files is expensive, both in terms of wasted bandwidth and money,
1306 and the time to do the update.  This is why all the mirroring tools
1307 offer the option of incremental updating.
1308
1309 Such an updating mechanism means that the remote server is scanned in
1310 search of @dfn{new} files.  Only those new files will be downloaded in
1311 the place of the old ones.
1312
1313 A file is considered new if one of these two conditions are met:
1314
1315 @enumerate
1316 @item
1317 A file of that name does not already exist locally.
1318
1319 @item
1320 A file of that name does exist, but the remote file was modified more
1321 recently than the local file.
1322 @end enumerate
1323
1324 To implement this, the program needs to be aware of the time of last
1325 modification of both remote and local files.  Such information are
1326 called the @dfn{time-stamps}.
1327
1328 The time-stamping in GNU Wget is turned on using @samp{--timestamping}
1329 (@samp{-N}) option, or through @code{timestamping = on} directive in
1330 @file{.wgetrc}.  With this option, for each file it intends to download,
1331 Wget will check whether a local file of the same name exists.  If it
1332 does, and the remote file is older, Wget will not download it.
1333
1334 If the local file does not exist, or the sizes of the files do not
1335 match, Wget will download the remote file no matter what the time-stamps
1336 say.
1337
1338 @menu
1339 * Time-Stamping Usage::
1340 * HTTP Time-Stamping Internals::
1341 * FTP Time-Stamping Internals::
1342 @end menu
1343
1344 @node Time-Stamping Usage, HTTP Time-Stamping Internals, Time-Stamping, Time-Stamping
1345 @section Time-Stamping Usage
1346 @cindex time-stamping usage
1347 @cindex usage, time-stamping
1348
1349 The usage of time-stamping is simple.  Say you would like to download a
1350 file so that it keeps its date of modification.
1351
1352 @example
1353 wget -S http://www.gnu.ai.mit.edu/
1354 @end example
1355
1356 A simple @code{ls -l} shows that the time stamp on the local file equals
1357 the state of the @code{Last-Modified} header, as returned by the server.
1358 As you can see, the time-stamping info is preserved locally, even
1359 without @samp{-N}.
1360
1361 Several days later, you would like Wget to check if the remote file has
1362 changed, and download it if it has.
1363
1364 @example
1365 wget -N http://www.gnu.ai.mit.edu/
1366 @end example
1367
1368 Wget will ask the server for the last-modified date.  If the local file
1369 is newer, the remote file will not be re-fetched.  However, if the remote
1370 file is more recent, Wget will proceed fetching it normally.
1371
1372 The same goes for @sc{ftp}.  For example:
1373
1374 @example
1375 wget ftp://ftp.ifi.uio.no/pub/emacs/gnus/*
1376 @end example
1377
1378 @code{ls} will show that the timestamps are set according to the state
1379 on the remote server.  Reissuing the command with @samp{-N} will make
1380 Wget re-fetch @emph{only} the files that have been modified.
1381
1382 In both @sc{http} and @sc{ftp} retrieval Wget will time-stamp the local
1383 file correctly (with or without @samp{-N}) if it gets the stamps,
1384 i.e. gets the directory listing for @sc{ftp} or the @code{Last-Modified}
1385 header for @sc{http}.
1386
1387 If you wished to mirror the GNU archive every week, you would use the
1388 following command every week:
1389
1390 @example
1391 wget --timestamping -r ftp://prep.ai.mit.edu/pub/gnu/
1392 @end example
1393
1394 @node HTTP Time-Stamping Internals, FTP Time-Stamping Internals, Time-Stamping Usage, Time-Stamping
1395 @section HTTP Time-Stamping Internals
1396 @cindex http time-stamping
1397
1398 Time-stamping in @sc{http} is implemented by checking of the
1399 @code{Last-Modified} header.  If you wish to retrieve the file
1400 @file{foo.html} through @sc{http}, Wget will check whether
1401 @file{foo.html} exists locally.  If it doesn't, @file{foo.html} will be
1402 retrieved unconditionally.
1403
1404 If the file does exist locally, Wget will first check its local
1405 time-stamp (similar to the way @code{ls -l} checks it), and then send a
1406 @code{HEAD} request to the remote server, demanding the information on
1407 the remote file.
1408
1409 The @code{Last-Modified} header is examined to find which file was
1410 modified more recently (which makes it ``newer'').  If the remote file
1411 is newer, it will be downloaded; if it is older, Wget will give
1412 up.@footnote{As an additional check, Wget will look at the
1413 @code{Content-Length} header, and compare the sizes; if they are not the
1414 same, the remote file will be downloaded no matter what the time-stamp
1415 says.}
1416
1417 When @samp{--backup-converted} (@samp{-K}) is specified in conjunction
1418 with @samp{-N}, server file @samp{@var{X}} is compared to local file
1419 @samp{@var{X}.orig}, if extant, rather than being compared to local file
1420 @samp{@var{X}}, which will always differ if it's been converted by
1421 @samp{--convert-links} (@samp{-k}).
1422
1423 Arguably, @sc{http} time-stamping should be implemented using the
1424 @code{If-Modified-Since} request.
1425
1426 @node FTP Time-Stamping Internals,  , HTTP Time-Stamping Internals, Time-Stamping
1427 @section FTP Time-Stamping Internals
1428 @cindex ftp time-stamping
1429
1430 In theory, @sc{ftp} time-stamping works much the same as @sc{http}, only
1431 @sc{ftp} has no headers---time-stamps must be received from the
1432 directory listings.
1433
1434 For each directory files must be retrieved from, Wget will use the
1435 @code{LIST} command to get the listing.  It will try to analyze the
1436 listing, assuming that it is a Unix @code{ls -l} listing, and extract
1437 the time-stamps.  The rest is exactly the same as for @sc{http}.
1438
1439 Assumption that every directory listing is a Unix-style listing may
1440 sound extremely constraining, but in practice it is not, as many
1441 non-Unix @sc{ftp} servers use the Unixoid listing format because most
1442 (all?) of the clients understand it.  Bear in mind that @sc{rfc959}
1443 defines no standard way to get a file list, let alone the time-stamps.
1444 We can only hope that a future standard will define this.
1445
1446 Another non-standard solution includes the use of @code{MDTM} command
1447 that is supported by some @sc{ftp} servers (including the popular
1448 @code{wu-ftpd}), which returns the exact time of the specified file.
1449 Wget may support this command in the future.
1450
1451 @node Startup File, Examples, Time-Stamping, Top
1452 @chapter Startup File
1453 @cindex startup file
1454 @cindex wgetrc
1455 @cindex .wgetrc
1456 @cindex startup
1457 @cindex .netrc
1458
1459 Once you know how to change default settings of Wget through command
1460 line arguments, you may wish to make some of those settings permanent.
1461 You can do that in a convenient way by creating the Wget startup
1462 file---@file{.wgetrc}.
1463
1464 Besides @file{.wgetrc} is the ``main'' initialization file, it is
1465 convenient to have a special facility for storing passwords.  Thus Wget
1466 reads and interprets the contents of @file{$HOME/.netrc}, if it finds
1467 it.  You can find @file{.netrc} format in your system manuals.
1468
1469 Wget reads @file{.wgetrc} upon startup, recognizing a limited set of
1470 commands.
1471
1472 @menu
1473 * Wgetrc Location::   Location of various wgetrc files.
1474 * Wgetrc Syntax::     Syntax of wgetrc.
1475 * Wgetrc Commands::   List of available commands.
1476 * Sample Wgetrc::     A wgetrc example.
1477 @end menu
1478
1479 @node Wgetrc Location, Wgetrc Syntax, Startup File, Startup File
1480 @section Wgetrc Location
1481 @cindex wgetrc location
1482 @cindex location of wgetrc
1483
1484 When initializing, Wget will look for a @dfn{global} startup file,
1485 @file{/usr/local/etc/wgetrc} by default (or some prefix other than
1486 @file{/usr/local}, if Wget was not installed there) and read commands
1487 from there, if it exists.
1488
1489 Then it will look for the user's file.  If the environmental variable
1490 @code{WGETRC} is set, Wget will try to load that file.  Failing that, no
1491 further attempts will be made.
1492
1493 If @code{WGETRC} is not set, Wget will try to load @file{$HOME/.wgetrc}.
1494
1495 The fact that user's settings are loaded after the system-wide ones
1496 means that in case of collision user's wgetrc @emph{overrides} the
1497 system-wide wgetrc (in @file{/usr/local/etc/wgetrc} by default).
1498 Fascist admins, away!
1499
1500 @node Wgetrc Syntax, Wgetrc Commands, Wgetrc Location, Startup File
1501 @section Wgetrc Syntax
1502 @cindex wgetrc syntax
1503 @cindex syntax of wgetrc
1504
1505 The syntax of a wgetrc command is simple:
1506
1507 @example
1508 variable = value
1509 @end example
1510
1511 The @dfn{variable} will also be called @dfn{command}.  Valid
1512 @dfn{values} are different for different commands.
1513
1514 The commands are case-insensitive and underscore-insensitive.  Thus
1515 @samp{DIr__PrefiX} is the same as @samp{dirprefix}.  Empty lines, lines
1516 beginning with @samp{#} and lines containing white-space only are
1517 discarded.
1518
1519 Commands that expect a comma-separated list will clear the list on an
1520 empty command.  So, if you wish to reset the rejection list specified in
1521 global @file{wgetrc}, you can do it with:
1522
1523 @example
1524 reject =
1525 @end example
1526
1527 @node Wgetrc Commands, Sample Wgetrc, Wgetrc Syntax, Startup File
1528 @section Wgetrc Commands
1529 @cindex wgetrc commands
1530
1531 The complete set of commands is listed below, the letter after @samp{=}
1532 denoting the value the command takes. It is @samp{on/off} for @samp{on}
1533 or @samp{off} (which can also be @samp{1} or @samp{0}), @var{string} for
1534 any non-empty string or @var{n} for a positive integer.  For example,
1535 you may specify @samp{use_proxy = off} to disable use of proxy servers
1536 by default. You may use @samp{inf} for infinite values, where
1537 appropriate.
1538
1539 Most of the commands have their equivalent command-line option
1540 (@xref{Invoking}), except some more obscure or rarely used ones.
1541
1542 @table @asis
1543 @item accept/reject = @var{string}
1544 Same as @samp{-A}/@samp{-R} (@xref{Types of Files}).
1545
1546 @item add_hostdir = on/off
1547 Enable/disable host-prefixed file names.  @samp{-nH} disables it.
1548
1549 @item continue = on/off
1550 Enable/disable continuation of the retrieval, the same as @samp{-c}
1551 (which enables it).
1552
1553 @item background = on/off
1554 Enable/disable going to background, the same as @samp{-b} (which enables
1555 it).
1556
1557 @item backup_converted = on/off
1558 Enable/disable saving pre-converted files with the suffix @samp{.orig}
1559 -- the same as @samp{-K} (which enables it).
1560
1561 @c @item backups = @var{number}
1562 @c #### Document me!
1563 @item base = @var{string}
1564 Set base for relative @sc{url}s, the same as @samp{-B}.
1565
1566 @item cache = on/off
1567 When set to off, disallow server-caching.  See the @samp{-C} option.
1568
1569 @item convert links = on/off
1570 Convert non-relative links locally.  The same as @samp{-k}.
1571
1572 @item cut_dirs = @var{n}
1573 Ignore @var{n} remote directory components.
1574
1575 @item debug = on/off
1576 Debug mode, same as @samp{-d}.
1577
1578 @item delete_after = on/off
1579 Delete after download, the same as @samp{--delete-after}.
1580
1581 @item dir_prefix = @var{string}
1582 Top of directory tree, the same as @samp{-P}.
1583
1584 @item dirstruct = on/off
1585 Turning dirstruct on or off, the same as @samp{-x} or @samp{-nd},
1586 respectively.
1587
1588 @item domains = @var{string}
1589 Same as @samp{-D} (@xref{Domain Acceptance}).
1590
1591 @item dot_bytes = @var{n}
1592 Specify the number of bytes ``contained'' in a dot, as seen throughout
1593 the retrieval (1024 by default).  You can postfix the value with
1594 @samp{k} or @samp{m}, representing kilobytes and megabytes,
1595 respectively.  With dot settings you can tailor the dot retrieval to
1596 suit your needs, or you can use the predefined @dfn{styles}
1597 (@xref{Download Options}).
1598
1599 @item dots_in_line = @var{n}
1600 Specify the number of dots that will be printed in each line throughout
1601 the retrieval (50 by default).
1602
1603 @item dot_spacing = @var{n}
1604 Specify the number of dots in a single cluster (10 by default).
1605
1606 @item dot_style = @var{string}
1607 Specify the dot retrieval @dfn{style}, as with @samp{--dot-style}.
1608
1609 @item exclude_directories = @var{string}
1610 Specify a comma-separated list of directories you wish to exclude from
1611 download, the same as @samp{-X} (@xref{Directory-Based Limits}).
1612
1613 @item exclude_domains = @var{string}
1614 Same as @samp{--exclude-domains} (@xref{Domain Acceptance}).
1615
1616 @item follow_ftp = on/off
1617 Follow @sc{ftp} links from @sc{html} documents, the same as @samp{-f}.
1618
1619 @item follow_tags = @var{string}
1620 Only follow certain HTML tags when doing a recursive retrieval, just like
1621 @samp{--follow-tags}. 
1622
1623 @item force_html = on/off
1624 If set to on, force the input filename to be regarded as an @sc{html}
1625 document, the same as @samp{-F}.
1626
1627 @item ftp_proxy = @var{string}
1628 Use @var{string} as @sc{ftp} proxy, instead of the one specified in
1629 environment.
1630
1631 @item glob = on/off
1632 Turn globbing on/off, the same as @samp{-g}.
1633
1634 @item header = @var{string}
1635 Define an additional header, like @samp{--header}.
1636
1637 @item http_passwd = @var{string}
1638 Set @sc{http} password.
1639
1640 @item http_proxy = @var{string}
1641 Use @var{string} as @sc{http} proxy, instead of the one specified in
1642 environment.
1643
1644 @item http_user = @var{string}
1645 Set @sc{http} user to @var{string}.
1646
1647 @item ignore_length = on/off
1648 When set to on, ignore @code{Content-Length} header; the same as
1649 @samp{--ignore-length}.
1650
1651 @item ignore_tags = @var{string}
1652 Ignore certain HTML tags when doing a recursive retrieval, just like
1653 @samp{-G} / @samp{--ignore-tags}. 
1654
1655 @item include_directories = @var{string}
1656 Specify a comma-separated list of directories you wish to follow when
1657 downloading, the same as @samp{-I}.
1658
1659 @item input = @var{string}
1660 Read the @sc{url}s from @var{string}, like @samp{-i}.
1661
1662 @item kill_longer = on/off
1663 Consider data longer than specified in content-length header
1664 as invalid (and retry getting it). The default behaviour is to save
1665 as much data as there is, provided there is more than or equal
1666 to the value in @code{Content-Length}.
1667
1668 @item logfile = @var{string}
1669 Set logfile, the same as @samp{-o}.
1670
1671 @item login = @var{string}
1672 Your user name on the remote machine, for @sc{ftp}.  Defaults to
1673 @samp{anonymous}.
1674
1675 @item mirror = on/off
1676 Turn mirroring on/off.  The same as @samp{-m}.
1677
1678 @item netrc = on/off
1679 Turn reading netrc on or off.
1680
1681 @item noclobber = on/off
1682 Same as @samp{-nc}.
1683
1684 @item no_parent = on/off
1685 Disallow retrieving outside the directory hierarchy, like
1686 @samp{--no-parent} (@xref{Directory-Based Limits}).
1687
1688 @item no_proxy = @var{string}
1689 Use @var{string} as the comma-separated list of domains to avoid in
1690 proxy loading, instead of the one specified in environment.
1691
1692 @item output_document = @var{string}
1693 Set the output filename, the same as @samp{-O}.
1694
1695 @item passive_ftp = on/off
1696 Set passive @sc{ftp}, the same as @samp{--passive-ftp}.
1697
1698 @item passwd = @var{string}
1699 Set your @sc{ftp} password to @var{password}.  Without this setting, the
1700 password defaults to @samp{username@@hostname.domainname}.
1701
1702 @item proxy_user = @var{string}
1703 Set proxy authentication user name to @var{string}, like
1704 @samp{--proxy-user}.
1705
1706 @item proxy_passwd = @var{string}
1707 Set proxy authentication password to @var{string}, like
1708 @samp{--proxy-passwd}.
1709
1710 @item quiet = on/off
1711 Quiet mode, the same as @samp{-q}.
1712
1713 @item quota = @var{quota}
1714 Specify the download quota, which is useful to put in global
1715 wgetrc. When download quota is specified, Wget will stop retrieving
1716 after the download sum has become greater than quota.  The quota can be
1717 specified in bytes (default), kbytes @samp{k} appended) or mbytes
1718 (@samp{m} appended).  Thus @samp{quota = 5m} will set the quota to 5
1719 mbytes. Note that the user's startup file overrides system settings.
1720
1721 @item reclevel = @var{n}
1722 Recursion level, the same as @samp{-l}.
1723
1724 @item recursive = on/off
1725 Recursive on/off, the same as @samp{-r}.
1726
1727 @item relative_only = on/off
1728 Follow only relative links, the same as @samp{-L} (@xref{Relative
1729 Links}).
1730
1731 @item remove_listing = on/off
1732 If set to on, remove @sc{ftp} listings downloaded by Wget.  Setting it
1733 to off is the same as @samp{-nr}.
1734
1735 @item retr_symlinks = on/off
1736 When set to on, retrieve symbolic links as if they were plain files; the
1737 same as @samp{--retr-symlinks}.
1738
1739 @item robots = on/off
1740 Use (or not) @file{/robots.txt} file (@xref{Robots}).  Be sure to know
1741 what you are doing before changing the default (which is @samp{on}).
1742
1743 @item server_response = on/off
1744 Choose whether or not to print the @sc{http} and @sc{ftp} server
1745 responses, the same as @samp{-S}.
1746
1747 @item simple_host_check = on/off
1748 Same as @samp{-nh} (@xref{Host Checking}).
1749
1750 @item span_hosts = on/off
1751 Same as @samp{-H}.
1752
1753 @item timeout = @var{n}
1754 Set timeout value, the same as @samp{-T}.
1755
1756 @item timestamping = on/off
1757 Turn timestamping on/off. The same as @samp{-N} (@xref{Time-Stamping}).
1758
1759 @item tries = @var{n}
1760 Set number of retries per @sc{url}, the same as @samp{-t}.
1761
1762 @item use_proxy = on/off
1763 Turn proxy support on/off. The same as @samp{-Y}.
1764
1765 @item verbose = on/off
1766 Turn verbose on/off, the same as @samp{-v}/@samp{-nv}.
1767
1768 @item wait = @var{n}
1769 Wait @var{n} seconds between retrievals, the same as @samp{-w}.
1770
1771 @item waitretry = @var{n}
1772 Wait @var{n} seconds between retries of failed retrievals only -- the same as
1773 @samp{--waitretry}.
1774 @end table
1775
1776 @node Sample Wgetrc,  , Wgetrc Commands, Startup File
1777 @section Sample Wgetrc
1778 @cindex sample wgetrc
1779
1780 This is the sample initialization file, as given in the distribution.
1781 It is divided in two section---one for global usage (suitable for global
1782 startup file), and one for local usage (suitable for
1783 @file{$HOME/.wgetrc}).  Be careful about the things you change.
1784
1785 Note that all the lines are commented out.  For any line to have effect,
1786 you must remove the @samp{#} prefix at the beginning of line.
1787
1788 @example
1789 ###
1790 ### Sample Wget initialization file .wgetrc
1791 ###
1792
1793 ## You can use this file to change the default behaviour of wget or to
1794 ## avoid having to type many many command-line options. This file does
1795 ## not contain a comprehensive list of commands -- look at the manual
1796 ## to find out what you can put into this file.
1797 ##
1798 ## Wget initialization file can reside in /usr/local/etc/wgetrc
1799 ## (global, for all users) or $HOME/.wgetrc (for a single user).
1800 ##
1801 ## To use any of the settings in this file, you will have to uncomment
1802 ## them (and probably change them).
1803
1804
1805 ##
1806 ## Global settings (useful for setting up in /usr/local/etc/wgetrc).
1807 ## Think well before you change them, since they may reduce wget's
1808 ## functionality, and make it behave contrary to the documentation:
1809 ##
1810
1811 # You can set retrieve quota for beginners by specifying a value
1812 # optionally followed by 'K' (kilobytes) or 'M' (megabytes).  The
1813 # default quota is unlimited.
1814 #quota = inf
1815
1816 # You can lower (or raise) the default number of retries when
1817 # downloading a file (default is 20).
1818 #tries = 20
1819
1820 # Lowering the maximum depth of the recursive retrieval is handy to
1821 # prevent newbies from going too "deep" when they unwittingly start
1822 # the recursive retrieval.  The default is 5.
1823 #reclevel = 5
1824
1825 # Many sites are behind firewalls that do not allow initiation of
1826 # connections from the outside.  On these sites you have to use the
1827 # `passive' feature of FTP.  If you are behind such a firewall, you
1828 # can turn this on to make Wget use passive FTP by default.
1829 #passive_ftp = off
1830
1831
1832 ##
1833 ## Local settings (for a user to set in his $HOME/.wgetrc).  It is
1834 ## *highly* undesirable to put these settings in the global file, since
1835 ## they are potentially dangerous to "normal" users.
1836 ##
1837 ## Even when setting up your own ~/.wgetrc, you should know what you
1838 ## are doing before doing so.
1839 ##
1840
1841 # Set this to on to use timestamping by default:
1842 #timestamping = off
1843
1844 # It is a good idea to make Wget send your email address in a `From:'
1845 # header with your request (so that server administrators can contact
1846 # you in case of errors).  Wget does *not* send `From:' by default.
1847 #header = From: Your Name <username@@site.domain>
1848
1849 # You can set up other headers, like Accept-Language.  Accept-Language
1850 # is *not* sent by default.
1851 #header = Accept-Language: en
1852
1853 # You can set the default proxy for Wget to use.  It will override the
1854 # value in the environment.
1855 #http_proxy = http://proxy.yoyodyne.com:18023/
1856
1857 # If you do not want to use proxy at all, set this to off.
1858 #use_proxy = on
1859
1860 # You can customize the retrieval outlook.  Valid options are default,
1861 # binary, mega and micro.
1862 #dot_style = default
1863
1864 # Setting this to off makes Wget not download /robots.txt.  Be sure to
1865 # know *exactly* what /robots.txt is and how it is used before changing
1866 # the default!
1867 #robots = on
1868
1869 # It can be useful to make Wget wait between connections.  Set this to
1870 # the number of seconds you want Wget to wait.
1871 #wait = 0
1872
1873 # You can force creating directory structure, even if a single is being
1874 # retrieved, by setting this to on.
1875 #dirstruct = off
1876
1877 # You can turn on recursive retrieving by default (don't do this if
1878 # you are not sure you know what it means) by setting this to on.
1879 #recursive = off
1880
1881 # To have Wget follow FTP links from HTML files by default, set this
1882 # to on:
1883 #follow_ftp = off
1884 @end example
1885
1886 @node Examples, Various, Startup File, Top
1887 @chapter Examples
1888 @cindex examples
1889
1890 The examples are classified into three sections, because of clarity.
1891 The first section is a tutorial for beginners.  The second section
1892 explains some of the more complex program features.  The third section
1893 contains advice for mirror administrators, as well as even more complex
1894 features (that some would call perverted).
1895
1896 @menu
1897 * Simple Usage::        Simple, basic usage of the program.
1898 * Advanced Usage::      Advanced techniques of usage.
1899 * Guru Usage::          Mirroring and the hairy stuff.
1900 @end menu
1901
1902 @node Simple Usage, Advanced Usage, Examples, Examples
1903 @section Simple Usage
1904
1905 @itemize @bullet
1906 @item
1907 Say you want to download a @sc{url}.  Just type:
1908
1909 @example
1910 wget http://fly.cc.fer.hr/
1911 @end example
1912
1913 The response will be something like:
1914
1915 @example
1916 @group
1917 --13:30:45--  http://fly.cc.fer.hr:80/en/
1918            => `index.html'
1919 Connecting to fly.cc.fer.hr:80... connected!
1920 HTTP request sent, awaiting response... 200 OK
1921 Length: 4,694 [text/html]
1922
1923     0K -> ....                                                   [100%]
1924
1925 13:30:46 (23.75 KB/s) - `index.html' saved [4694/4694]
1926 @end group
1927 @end example
1928
1929 @item
1930 But what will happen if the connection is slow, and the file is lengthy?
1931 The connection will probably fail before the whole file is retrieved,
1932 more than once.  In this case, Wget will try getting the file until it
1933 either gets the whole of it, or exceeds the default number of retries
1934 (this being 20).  It is easy to change the number of tries to 45, to
1935 insure that the whole file will arrive safely:
1936
1937 @example
1938 wget --tries=45 http://fly.cc.fer.hr/jpg/flyweb.jpg
1939 @end example
1940
1941 @item
1942 Now let's leave Wget to work in the background, and write its progress
1943 to log file @file{log}.  It is tiring to type @samp{--tries}, so we
1944 shall use @samp{-t}.
1945
1946 @example
1947 wget -t 45 -o log http://fly.cc.fer.hr/jpg/flyweb.jpg &
1948 @end example
1949
1950 The ampersand at the end of the line makes sure that Wget works in the
1951 background.  To unlimit the number of retries, use @samp{-t inf}.
1952
1953 @item
1954 The usage of @sc{ftp} is as simple.  Wget will take care of login and
1955 password.
1956
1957 @example
1958 @group
1959 $ wget ftp://gnjilux.cc.fer.hr/welcome.msg
1960 --10:08:47--  ftp://gnjilux.cc.fer.hr:21/welcome.msg
1961            => `welcome.msg'
1962 Connecting to gnjilux.cc.fer.hr:21... connected!
1963 Logging in as anonymous ... Logged in!
1964 ==> TYPE I ... done.  ==> CWD not needed.
1965 ==> PORT ... done.    ==> RETR welcome.msg ... done.
1966 Length: 1,340 (unauthoritative)
1967
1968     0K -> .                                                      [100%]
1969
1970 10:08:48 (1.28 MB/s) - `welcome.msg' saved [1340]
1971 @end group
1972 @end example
1973
1974 @item
1975 If you specify a directory, Wget will retrieve the directory listing,
1976 parse it and convert it to @sc{html}.  Try:
1977
1978 @example
1979 wget ftp://prep.ai.mit.edu/pub/gnu/
1980 lynx index.html
1981 @end example
1982 @end itemize
1983
1984 @node Advanced Usage, Guru Usage, Simple Usage, Examples
1985 @section Advanced Usage
1986
1987 @itemize @bullet
1988 @item
1989 You would like to read the list of @sc{url}s from a file?  Not a problem
1990 with that:
1991
1992 @example
1993 wget -i file
1994 @end example
1995
1996 If you specify @samp{-} as file name, the @sc{url}s will be read from
1997 standard input.
1998
1999 @item
2000 Create a mirror image of GNU @sc{www} site (with the same directory structure
2001 the original has) with only one try per document, saving the log of the
2002 activities to @file{gnulog}:
2003
2004 @example
2005 wget -r -t1 http://www.gnu.ai.mit.edu/ -o gnulog
2006 @end example
2007
2008 @item
2009 Retrieve the first layer of yahoo links:
2010
2011 @example
2012 wget -r -l1 http://www.yahoo.com/
2013 @end example
2014
2015 @item
2016 Retrieve the index.html of @samp{www.lycos.com}, showing the original
2017 server headers:
2018
2019 @example
2020 wget -S http://www.lycos.com/
2021 @end example
2022
2023 @item
2024 Save the server headers with the file:
2025 @example
2026 wget -s http://www.lycos.com/
2027 more index.html
2028 @end example
2029
2030 @item
2031 Retrieve the first two levels of @samp{wuarchive.wustl.edu}, saving them
2032 to /tmp.
2033
2034 @example
2035 wget -P/tmp -l2 ftp://wuarchive.wustl.edu/
2036 @end example
2037
2038 @item
2039 You want to download all the @sc{gif}s from an @sc{http} directory.
2040 @samp{wget http://host/dir/*.gif} doesn't work, since @sc{http}
2041 retrieval does not support globbing.  In that case, use:
2042
2043 @example
2044 wget -r -l1 --no-parent -A.gif http://host/dir/
2045 @end example
2046
2047 It is a bit of a kludge, but it works.  @samp{-r -l1} means to retrieve
2048 recursively (@xref{Recursive Retrieval}), with maximum depth of 1.
2049 @samp{--no-parent} means that references to the parent directory are
2050 ignored (@xref{Directory-Based Limits}), and @samp{-A.gif} means to
2051 download only the @sc{gif} files.  @samp{-A "*.gif"} would have worked
2052 too.
2053
2054 @item
2055 Suppose you were in the middle of downloading, when Wget was
2056 interrupted.  Now you do not want to clobber the files already present.
2057 It would be:
2058
2059 @example
2060 wget -nc -r http://www.gnu.ai.mit.edu/
2061 @end example
2062
2063 @item
2064 If you want to encode your own username and password to @sc{http} or
2065 @sc{ftp}, use the appropriate @sc{url} syntax (@xref{URL Format}).
2066
2067 @example
2068 wget ftp://hniksic:mypassword@@jagor.srce.hr/.emacs
2069 @end example
2070
2071 @item
2072 If you do not like the default retrieval visualization (1K dots with 10
2073 dots per cluster and 50 dots per line), you can customize it through dot
2074 settings (@xref{Wgetrc Commands}).  For example, many people like the
2075 ``binary'' style of retrieval, with 8K dots and 512K lines:
2076
2077 @example
2078 wget --dot-style=binary ftp://prep.ai.mit.edu/pub/gnu/README
2079 @end example
2080
2081 You can experiment with other styles, like:
2082
2083 @example
2084 wget --dot-style=mega ftp://ftp.xemacs.org/pub/xemacs/xemacs-20.4/xemacs-20.4.tar.gz
2085 wget --dot-style=micro http://fly.cc.fer.hr/
2086 @end example
2087
2088 To make these settings permanent, put them in your @file{.wgetrc}, as
2089 described before (@xref{Sample Wgetrc}).
2090 @end itemize
2091
2092 @node Guru Usage,  , Advanced Usage, Examples
2093 @section Guru Usage
2094
2095 @cindex mirroring
2096 @itemize @bullet
2097 @item
2098 If you wish Wget to keep a mirror of a page (or @sc{ftp}
2099 subdirectories), use @samp{--mirror} (@samp{-m}), which is the shorthand
2100 for @samp{-r -N}.  You can put Wget in the crontab file asking it to
2101 recheck a site each Sunday:
2102
2103 @example
2104 crontab
2105 0 0 * * 0 wget --mirror ftp://ftp.xemacs.org/pub/xemacs/ -o /home/me/weeklog
2106 @end example
2107
2108 @item
2109 You may wish to do the same with someone's home page.  But you do not
2110 want to download all those images---you're only interested in @sc{html}.
2111
2112 @example
2113 wget --mirror -A.html http://www.w3.org/
2114 @end example
2115
2116 @item
2117 But what about mirroring the hosts networkologically close to you?  It
2118 seems so awfully slow because of all that @sc{dns} resolving.  Just use
2119 @samp{-D} (@xref{Domain Acceptance}).
2120
2121 @example
2122 wget -rN -Dsrce.hr http://www.srce.hr/
2123 @end example
2124
2125 Now Wget will correctly find out that @samp{regoc.srce.hr} is the same
2126 as @samp{www.srce.hr}, but will not even take into consideration the
2127 link to @samp{www.mit.edu}.
2128
2129 @item
2130 You have a presentation and would like the dumb absolute links to be
2131 converted to relative?  Use @samp{-k}:
2132
2133 @example
2134 wget -k -r @var{URL}
2135 @end example
2136
2137 @cindex redirecting output
2138 @item
2139 You would like the output documents to go to standard output instead of
2140 to files?  OK, but Wget will automatically shut up (turn on
2141 @samp{--quiet}) to prevent mixing of Wget output and the retrieved
2142 documents.
2143
2144 @example
2145 wget -O - http://jagor.srce.hr/ http://www.srce.hr/
2146 @end example
2147
2148 You can also combine the two options and make weird pipelines to
2149 retrieve the documents from remote hotlists:
2150
2151 @example
2152 wget -O - http://cool.list.com/ | wget --force-html -i -
2153 @end example
2154 @end itemize
2155
2156 @node Various, Appendices, Examples, Top
2157 @chapter Various
2158 @cindex various
2159
2160 This chapter contains all the stuff that could not fit anywhere else.
2161
2162 @menu
2163 * Proxies::             Support for proxy servers
2164 * Distribution::        Getting the latest version.
2165 * Mailing List::        Wget mailing list for announcements and discussion.
2166 * Reporting Bugs::      How and where to report bugs.
2167 * Portability::         The systems Wget works on.
2168 * Signals::             Signal-handling performed by Wget.
2169 @end menu
2170
2171 @node Proxies, Distribution, Various, Various
2172 @section Proxies
2173 @cindex proxies
2174
2175 @dfn{Proxies} are special-purpose @sc{http} servers designed to transfer
2176 data from remote servers to local clients.  One typical use of proxies
2177 is lightening network load for users behind a slow connection.  This is
2178 achieved by channeling all @sc{http} and @sc{ftp} requests through the
2179 proxy which caches the transferred data.  When a cached resource is
2180 requested again, proxy will return the data from cache.  Another use for
2181 proxies is for companies that separate (for security reasons) their
2182 internal networks from the rest of Internet.  In order to obtain
2183 information from the Web, their users connect and retrieve remote data
2184 using an authorized proxy.
2185
2186 Wget supports proxies for both @sc{http} and @sc{ftp} retrievals.  The
2187 standard way to specify proxy location, which Wget recognizes, is using
2188 the following environment variables:
2189
2190 @table @code
2191 @item http_proxy
2192 This variable should contain the @sc{url} of the proxy for @sc{http}
2193 connections.
2194
2195 @item ftp_proxy
2196 This variable should contain the @sc{url} of the proxy for @sc{http}
2197 connections.  It is quite common that @sc{http_proxy} and @sc{ftp_proxy}
2198 are set to the same @sc{url}.
2199
2200 @item no_proxy
2201 This variable should contain a comma-separated list of domain extensions
2202 proxy should @emph{not} be used for.  For instance, if the value of
2203 @code{no_proxy} is @samp{.mit.edu}, proxy will not be used to retrieve
2204 documents from MIT.
2205 @end table
2206
2207 In addition to the environment variables, proxy location and settings
2208 may be specified from within Wget itself.
2209
2210 @table @samp
2211 @item -Y on/off
2212 @itemx --proxy=on/off
2213 @itemx proxy = on/off
2214 This option may be used to turn the proxy support on or off.  Proxy
2215 support is on by default, provided that the appropriate environment
2216 variables are set.
2217
2218 @item http_proxy = @var{URL}
2219 @itemx ftp_proxy = @var{URL}
2220 @itemx no_proxy = @var{string}
2221 These startup file variables allow you to override the proxy settings
2222 specified by the environment.
2223 @end table
2224
2225 Some proxy servers require authorization to enable you to use them.  The
2226 authorization consists of @dfn{username} and @dfn{password}, which must
2227 be sent by Wget.  As with @sc{http} authorization, several
2228 authentication schemes exist.  For proxy authorization only the
2229 @code{Basic} authentication scheme is currently implemented.
2230
2231 You may specify your username and password either through the proxy
2232 @sc{url} or through the command-line options.  Assuming that the
2233 company's proxy is located at @samp{proxy.srce.hr} at port 8001, a proxy
2234 @sc{url} location containing authorization data might look like this:
2235
2236 @example
2237 http://hniksic:mypassword@@proxy.company.com:8001/
2238 @end example
2239
2240 Alternatively, you may use the @samp{proxy-user} and
2241 @samp{proxy-password} options, and the equivalent @file{.wgetrc}
2242 settings @code{proxy_user} and @code{proxy_passwd} to set the proxy
2243 username and password.
2244
2245 @node Distribution, Mailing List, Proxies, Various
2246 @section Distribution
2247 @cindex latest version
2248
2249 Like all GNU utilities, the latest version of Wget can be found at the
2250 master GNU archive site prep.ai.mit.edu, and its mirrors.  For example,
2251 Wget @value{VERSION} can be found at
2252 @url{ftp://prep.ai.mit.edu/gnu/wget/wget-@value{VERSION}.tar.gz}
2253
2254 @node Mailing List, Reporting Bugs, Distribution, Various
2255 @section Mailing List
2256 @cindex mailing list
2257 @cindex list
2258
2259 Wget has its own mailing list at @email{wget@@sunsite.auc.dk}, thanks
2260 to Karsten Thygesen.  The mailing list is for discussion of Wget
2261 features and web, reporting Wget bugs (those that you think may be of
2262 interest to the public) and mailing announcements.  You are welcome to
2263 subscribe.  The more people on the list, the better!
2264
2265 To subscribe, send mail to @email{wget-subscribe@@sunsite.auc.dk}.
2266 the magic word @samp{subscribe} in the subject line.  Unsubscribe by
2267 mailing to @email{wget-unsubscribe@@sunsite.auc.dk}.
2268
2269 The mailing list is archived at @url{http://fly.cc.fer.hr/archive/wget}.
2270
2271 @node Reporting Bugs, Portability, Mailing List, Various
2272 @section Reporting Bugs
2273 @cindex bugs
2274 @cindex reporting bugs
2275 @cindex bug reports
2276
2277 You are welcome to send bug reports about GNU Wget to
2278 @email{bug-wget@@gnu.org}.  The bugs that you think are of the
2279 interest to the public (i.e. more people should be informed about them)
2280 can be Cc-ed to the mailing list at @email{wget@@sunsite.auc.dk}.
2281
2282 Before actually submitting a bug report, please try to follow a few
2283 simple guidelines.
2284
2285 @enumerate
2286 @item
2287 Please try to ascertain that the behaviour you see really is a bug.  If
2288 Wget crashes, it's a bug.  If Wget does not behave as documented,
2289 it's a bug.  If things work strange, but you are not sure about the way
2290 they are supposed to work, it might well be a bug.
2291
2292 @item
2293 Try to repeat the bug in as simple circumstances as possible.  E.g. if
2294 Wget crashes on @samp{wget -rLl0 -t5 -Y0 http://yoyodyne.com -o
2295 /tmp/log}, you should try to see if it will crash with a simpler set of
2296 options.
2297
2298 Also, while I will probably be interested to know the contents of your
2299 @file{.wgetrc} file, just dumping it into the debug message is probably
2300 a bad idea.  Instead, you should first try to see if the bug repeats
2301 with @file{.wgetrc} moved out of the way.  Only if it turns out that
2302 @file{.wgetrc} settings affect the bug, should you mail me the relevant
2303 parts of the file.
2304
2305 @item
2306 Please start Wget with @samp{-d} option and send the log (or the
2307 relevant parts of it).  If Wget was compiled without debug support,
2308 recompile it.  It is @emph{much} easier to trace bugs with debug support
2309 on.
2310
2311 @item
2312 If Wget has crashed, try to run it in a debugger, e.g. @code{gdb `which
2313 wget` core} and type @code{where} to get the backtrace.
2314
2315 @item
2316 Find where the bug is, fix it and send me the patches. :-)
2317 @end enumerate
2318
2319 @node Portability, Signals, Reporting Bugs, Various
2320 @section Portability
2321 @cindex portability
2322 @cindex operating systems
2323
2324 Since Wget uses GNU Autoconf for building and configuring, and avoids
2325 using ``special'' ultra--mega--cool features of any particular Unix, it
2326 should compile (and work) on all common Unix flavors.
2327
2328 Various Wget versions have been compiled and tested under many kinds of
2329 Unix systems, including Solaris, Linux, SunOS, OSF (aka Digital Unix),
2330 Ultrix, *BSD, IRIX, and others; refer to the file @file{MACHINES} in the
2331 distribution directory for a comprehensive list.  If you compile it on
2332 an architecture not listed there, please let me know so I can update it.
2333
2334 Wget should also compile on the other Unix systems, not listed in
2335 @file{MACHINES}.  If it doesn't, please let me know.
2336
2337 Thanks to kind contributors, this version of Wget compiles and works on
2338 Microsoft Windows 95 and Windows NT platforms.  It has been compiled
2339 successfully using MS Visual C++ 4.0, Watcom, and Borland C compilers,
2340 with Winsock as networking software.  Naturally, it is crippled of some
2341 features available on Unix, but it should work as a substitute for
2342 people stuck with Windows.  Note that the Windows port is
2343 @strong{neither tested nor maintained} by me---all questions and
2344 problems should be reported to Wget mailing list at
2345 @email{wget@@sunsite.auc.dk} where the maintainers will look at them.
2346
2347 @node Signals,  , Portability, Various
2348 @section Signals
2349 @cindex signal handling
2350 @cindex hangup
2351
2352 Since the purpose of Wget is background work, it catches the hangup
2353 signal (@code{SIGHUP}) and ignores it.  If the output was on standard
2354 output, it will be redirected to a file named @file{wget-log}.
2355 Otherwise, @code{SIGHUP} is ignored.  This is convenient when you wish
2356 to redirect the output of Wget after having started it.
2357
2358 @example
2359 $ wget http://www.ifi.uio.no/~larsi/gnus.tar.gz &
2360 $ kill -HUP %%     # Redirect the output to wget-log
2361 @end example
2362
2363 Other than that, Wget will not try to interfere with signals in any
2364 way. @kbd{C-c}, @code{kill -TERM} and @code{kill -KILL} should kill it
2365 alike.
2366
2367 @node Appendices, Copying, Various, Top
2368 @chapter Appendices
2369
2370 This chapter contains some references I consider useful, like the Robots
2371 Exclusion Standard specification, as well as a list of contributors to
2372 GNU Wget.
2373
2374 @menu
2375 * Robots::                  Wget as a WWW robot.
2376 * Security Considerations:: Security with Wget.
2377 * Contributors::            People who helped.
2378 @end menu
2379
2380 @node Robots, Security Considerations, Appendices, Appendices
2381 @section Robots
2382 @cindex robots
2383 @cindex robots.txt
2384 @cindex server maintenance
2385
2386 Since Wget is able to traverse the web, it counts as one of the Web
2387 @dfn{robots}.  Thus Wget understands @dfn{Robots Exclusion Standard}
2388 (@sc{res})---contents of @file{/robots.txt}, used by server
2389 administrators to shield parts of their systems from wanderings of Wget.
2390
2391 Norobots support is turned on only when retrieving recursively, and
2392 @emph{never} for the first page.  Thus, you may issue:
2393
2394 @example
2395 wget -r http://fly.cc.fer.hr/
2396 @end example
2397
2398 First the index of fly.cc.fer.hr will be downloaded.  If Wget finds
2399 anything worth downloading on the same host, only @emph{then} will it
2400 load the robots, and decide whether or not to load the links after all.
2401 @file{/robots.txt} is loaded only once per host.  Wget does not support
2402 the robots @code{META} tag.
2403
2404 The description of the norobots standard was written, and is maintained
2405 by Martijn Koster @email{m.koster@@webcrawler.com}.  With his
2406 permission, I contribute a (slightly modified) TeXified version of the
2407 @sc{res}.
2408
2409 @menu
2410 * Introduction to RES::
2411 * RES Format::
2412 * User-Agent Field::
2413 * Disallow Field::
2414 * Norobots Examples::
2415 @end menu
2416
2417 @node Introduction to RES, RES Format, Robots, Robots
2418 @subsection Introduction to RES
2419 @cindex norobots introduction
2420
2421 @dfn{WWW Robots} (also called @dfn{wanderers} or @dfn{spiders}) are
2422 programs that traverse many pages in the World Wide Web by recursively
2423 retrieving linked pages. For more information see the robots page.
2424
2425 In 1993 and 1994 there have been occasions where robots have visited
2426 @sc{www} servers where they weren't welcome for various
2427 reasons. Sometimes these reasons were robot specific, e.g. certain
2428 robots swamped servers with rapid-fire requests, or retrieved the same
2429 files repeatedly. In other situations robots traversed parts of @sc{www}
2430 servers that weren't suitable, e.g. very deep virtual trees, duplicated
2431 information, temporary information, or cgi-scripts with side-effects
2432 (such as voting).
2433
2434 These incidents indicated the need for established mechanisms for
2435 @sc{www} servers to indicate to robots which parts of their server
2436 should not be accessed. This standard addresses this need with an
2437 operational solution.
2438
2439 This document represents a consensus on 30 June 1994 on the robots
2440 mailing list (@code{robots@@webcrawler.com}), between the majority of
2441 robot authors and other people with an interest in robots. It has also
2442 been open for discussion on the Technical World Wide Web mailing list
2443 (@code{www-talk@@info.cern.ch}). This document is based on a previous
2444 working draft under the same title.
2445
2446 It is not an official standard backed by a standards body, or owned by
2447 any commercial organization. It is not enforced by anybody, and there
2448 no guarantee that all current and future robots will use it. Consider
2449 it a common facility the majority of robot authors offer the @sc{www}
2450 community to protect @sc{www} server against unwanted accesses by their
2451 robots.
2452
2453 The latest version of this document can be found at
2454 @url{http://info.webcrawler.com/mak/projects/robots/norobots.html}.
2455
2456 @node RES Format, User-Agent Field, Introduction to RES, Robots
2457 @subsection RES Format
2458 @cindex norobots format
2459
2460 The format and semantics of the @file{/robots.txt} file are as follows:
2461
2462 The file consists of one or more records separated by one or more blank
2463 lines (terminated by @code{CR}, @code{CR/NL}, or @code{NL}).  Each
2464 record contains lines of the form:
2465
2466 @example
2467 <field>:<optionalspace><value><optionalspace>
2468 @end example
2469
2470 The field name is case insensitive.
2471
2472 Comments can be included in file using UNIX Bourne shell conventions:
2473 the @samp{#} character is used to indicate that preceding space (if any)
2474 and the remainder of the line up to the line termination is discarded.
2475 Lines containing only a comment are discarded completely, and therefore
2476 do not indicate a record boundary.
2477
2478 The record starts with one or more User-agent lines, followed by one or
2479 more Disallow lines, as detailed below. Unrecognized headers are
2480 ignored.
2481
2482 The presence of an empty @file{/robots.txt} file has no explicit
2483 associated semantics, it will be treated as if it was not present,
2484 i.e. all robots will consider themselves welcome.
2485
2486 @node User-Agent Field, Disallow Field, RES Format, Robots
2487 @subsection User-Agent Field
2488 @cindex norobots user-agent
2489
2490 The value of this field is the name of the robot the record is
2491 describing access policy for.
2492
2493 If more than one User-agent field is present the record describes an
2494 identical access policy for more than one robot.  At least one field
2495 needs to be present per record.
2496
2497 The robot should be liberal in interpreting this field. A case
2498 insensitive substring match of the name without version information is
2499 recommended.
2500
2501 If the value is @samp{*}, the record describes the default access policy
2502 for any robot that has not matched any of the other records. It is not
2503 allowed to have multiple such records in the @file{/robots.txt} file.
2504
2505 @node Disallow Field, Norobots Examples, User-Agent Field, Robots
2506 @subsection Disallow Field
2507 @cindex norobots disallow
2508
2509 The value of this field specifies a partial @sc{url} that is not to be
2510 visited. This can be a full path, or a partial path; any @sc{url} that
2511 starts with this value will not be retrieved. For example,
2512 @w{@samp{Disallow: /help}} disallows both @samp{/help.html} and
2513 @samp{/help/index.html}, whereas @w{@samp{Disallow: /help/}} would
2514 disallow @samp{/help/index.html} but allow @samp{/help.html}.
2515
2516 Any empty value, indicates that all @sc{url}s can be retrieved. At least
2517 one Disallow field needs to be present in a record.
2518
2519 @node Norobots Examples,  , Disallow Field, Robots
2520 @subsection Norobots Examples
2521 @cindex norobots examples
2522
2523 The following example @samp{/robots.txt} file specifies that no robots
2524 should visit any @sc{url} starting with @samp{/cyberworld/map/} or
2525 @samp{/tmp/}:
2526
2527 @example
2528 # robots.txt for http://www.site.com/
2529
2530 User-agent: *
2531 Disallow: /cyberworld/map/ # This is an infinite virtual URL space
2532 Disallow: /tmp/ # these will soon disappear
2533 @end example
2534
2535 This example @samp{/robots.txt} file specifies that no robots should
2536 visit any @sc{url} starting with @samp{/cyberworld/map/}, except the
2537 robot called @samp{cybermapper}:
2538
2539 @example
2540 # robots.txt for http://www.site.com/
2541
2542 User-agent: *
2543 Disallow: /cyberworld/map/ # This is an infinite virtual URL space
2544
2545 # Cybermapper knows where to go.
2546 User-agent: cybermapper
2547 Disallow:
2548 @end example
2549
2550 This example indicates that no robots should visit this site further:
2551
2552 @example
2553 # go away
2554 User-agent: *
2555 Disallow: /
2556 @end example
2557
2558 @node Security Considerations, Contributors, Robots, Appendices
2559 @section Security Considerations
2560 @cindex security
2561
2562 When using Wget, you must be aware that it sends unencrypted passwords
2563 through the network, which may present a security problem.  Here are the
2564 main issues, and some solutions.
2565
2566 @enumerate
2567 @item
2568 The passwords on the command line are visible using @code{ps}.  If this
2569 is a problem, avoid putting passwords from the command line---e.g. you
2570 can use @file{.netrc} for this.
2571
2572 @item
2573 Using the insecure @dfn{basic} authentication scheme, unencrypted
2574 passwords are transmitted through the network routers and gateways.
2575
2576 @item
2577 The @sc{ftp} passwords are also in no way encrypted.  There is no good
2578 solution for this at the moment.
2579
2580 @item
2581 Although the ``normal'' output of Wget tries to hide the passwords,
2582 debugging logs show them, in all forms.  This problem is avoided by
2583 being careful when you send debug logs (yes, even when you send them to
2584 me).
2585 @end enumerate
2586
2587 @node Contributors,  , Security Considerations, Appendices
2588 @section Contributors
2589 @cindex contributors
2590
2591 @iftex
2592 GNU Wget was written by Hrvoje Nik@v{s}i@'{c} @email{hniksic@@iskon.hr}.
2593 @end iftex
2594 @ifinfo
2595 GNU Wget was written by Hrvoje Niksic @email{hniksic@@iskon.hr}.
2596 @end ifinfo
2597 However, its development could never have gone as far as it has, were it
2598 not for the help of many people, either with bug reports, feature
2599 proposals, patches, or letters saying ``Thanks!''.
2600
2601 Special thanks goes to the following people (no particular order):
2602
2603 @itemize @bullet
2604 @item
2605 Karsten Thygesen---donated the mailing list and the initial @sc{ftp}
2606 space.
2607
2608 @item
2609 Shawn McHorse---bug reports and patches.
2610
2611 @item
2612 Kaveh R. Ghazi---on-the-fly @code{ansi2knr}-ization.
2613
2614 @item
2615 Gordon Matzigkeit---@file{.netrc} support.
2616
2617 @item
2618 @iftex
2619 Zlatko @v{C}alu@v{s}i@'{c}, Tomislav Vujec and Dra@v{z}en
2620 Ka@v{c}ar---feature suggestions and ``philosophical'' discussions.
2621 @end iftex
2622 @ifinfo
2623 Zlatko Calusic, Tomislav Vujec and Drazen Kacar---feature suggestions
2624 and ``philosophical'' discussions.
2625 @end ifinfo
2626
2627 @item
2628 Darko Budor---initial port to Windows.
2629
2630 @item
2631 Antonio Rosella---help and suggestions, plus the Italian translation.
2632
2633 @item
2634 @iftex
2635 Tomislav Petrovi@'{c}, Mario Miko@v{c}evi@'{c}---many bug reports and
2636 suggestions.
2637 @end iftex
2638 @ifinfo
2639 Tomislav Petrovic, Mario Mikocevic---many bug reports and suggestions.
2640 @end ifinfo
2641
2642 @item
2643 @iftex
2644 Fran@,{c}ois Pinard---many thorough bug reports and discussions.
2645 @end iftex
2646 @ifinfo
2647 Francois Pinard---many thorough bug reports and discussions.
2648 @end ifinfo
2649
2650 @item
2651 Karl Eichwalder---lots of help with internationalization and other
2652 things.
2653
2654 @item
2655 Junio Hamano---donated support for Opie and @sc{http} @code{Digest}
2656 authentication.
2657
2658 @item
2659 Brian Gough---a generous donation.
2660 @end itemize
2661
2662 The following people have provided patches, bug/build reports, useful
2663 suggestions, beta testing services, fan mail and all the other things
2664 that make maintenance so much fun:
2665
2666 Tim Adam,
2667 Martin Baehr,
2668 Dieter Baron,
2669 Roger Beeman and the Gurus at Cisco,
2670 Dan Berger,
2671 Mark Boyns,
2672 John Burden,
2673 Wanderlei Cavassin,
2674 Gilles Cedoc,
2675 Tim Charron,
2676 Noel Cragg,
2677 @iftex
2678 Kristijan @v{C}onka@v{s},
2679 @end iftex
2680 @ifinfo
2681 Kristijan Conkas,
2682 @end ifinfo
2683 Andrew Deryabin,
2684 @iftex
2685 Damir D@v{z}eko,
2686 @end iftex
2687 @ifinfo
2688 Damir Dzeko,
2689 @end ifinfo
2690 Andrew Davison,
2691 Ulrich Drepper,
2692 Marc Duponcheel,
2693 @iftex
2694 Aleksandar Erkalovi@'{c},
2695 @end iftex
2696 @ifinfo
2697 Aleksandar Erkalovic,
2698 @end ifinfo
2699 Andy Eskilsson,
2700 Masashi Fujita,
2701 Howard Gayle,
2702 Marcel Gerrits,
2703 Hans Grobler,
2704 Mathieu Guillaume,
2705 Dan Harkless,
2706 Heiko Herold,
2707 Karl Heuer,
2708 HIROSE Masaaki,
2709 Gregor Hoffleit,
2710 Erik Magnus Hulthen,
2711 Richard Huveneers,
2712 Simon Josefsson,
2713 @iftex
2714 Mario Juri@'{c},
2715 @end iftex
2716 @ifinfo
2717 Mario Juric,
2718 @end ifinfo
2719 @iftex
2720 Goran Kezunovi@'{c},
2721 @end iftex
2722 @ifinfo
2723 Goran Kezunovic,
2724 @end ifinfo
2725 Robert Kleine,
2726 Fila Kolodny,
2727 Alexander Kourakos,
2728 Martin Kraemer,
2729 @tex
2730 $\Sigma\acute{\iota}\mu o\varsigma\;
2731 \Xi\varepsilon\nu\iota\tau\acute{\epsilon}\lambda\lambda\eta\varsigma$
2732 (Simos KSenitellis),
2733 @end tex
2734 @ifinfo
2735 Simos KSenitellis,
2736 @end ifinfo
2737 Hrvoje Lacko,
2738 Daniel S. Lewart,
2739 Dave Love,
2740 Jordan Mendelson,
2741 Lin Zhe Min,
2742 Charlie Negyesi,
2743 Andrew Pollock,
2744 Steve Pothier,
2745 Jan Prikryl,
2746 Marin Purgar,
2747 Keith Refson,
2748 Tobias Ringstrom,
2749 @c Texinfo doesn't grok @'{@i}, so we have to use TeX itself.
2750 @tex
2751 Juan Jos\'{e} Rodr\'{\i}gues,
2752 @end tex
2753 @ifinfo
2754 Juan Jose Rodrigues,
2755 @end ifinfo
2756 Edward J. Sabol,
2757 Heinz Salzmann,
2758 Robert Schmidt,
2759 Toomas Soome,
2760 Tage Stabell-Kulo,
2761 Sven Sternberger,
2762 Markus Strasser,
2763 Szakacsits Szabolcs,
2764 Mike Thomas,
2765 Russell Vincent,
2766 Charles G Waldman,
2767 Douglas E. Wegscheid,
2768 Jasmin Zainul,
2769 @iftex
2770 Bojan @v{Z}drnja,
2771 @end iftex
2772 @ifinfo
2773 Bojan Zdrnja,
2774 @end ifinfo
2775 Kristijan Zimmer.
2776
2777 Apologies to all who I accidentally left out, and many thanks to all the
2778 subscribers of the Wget mailing list.
2779
2780 @node Copying, Concept Index, Appendices, Top
2781 @unnumbered GNU GENERAL PUBLIC LICENSE
2782 @cindex copying
2783 @cindex GPL
2784 @center Version 2, June 1991
2785
2786 @display
2787 Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
2788 675 Mass Ave, Cambridge, MA 02139, USA
2789
2790 Everyone is permitted to copy and distribute verbatim copies
2791 of this license document, but changing it is not allowed.
2792 @end display
2793
2794 @unnumberedsec Preamble
2795
2796   The licenses for most software are designed to take away your
2797 freedom to share and change it.  By contrast, the GNU General Public
2798 License is intended to guarantee your freedom to share and change free
2799 software---to make sure the software is free for all its users.  This
2800 General Public License applies to most of the Free Software
2801 Foundation's software and to any other program whose authors commit to
2802 using it.  (Some other Free Software Foundation software is covered by
2803 the GNU Library General Public License instead.)  You can apply it to
2804 your programs, too.
2805
2806   When we speak of free software, we are referring to freedom, not
2807 price.  Our General Public Licenses are designed to make sure that you
2808 have the freedom to distribute copies of free software (and charge for
2809 this service if you wish), that you receive source code or can get it
2810 if you want it, that you can change the software or use pieces of it
2811 in new free programs; and that you know you can do these things.
2812
2813   To protect your rights, we need to make restrictions that forbid
2814 anyone to deny you these rights or to ask you to surrender the rights.
2815 These restrictions translate to certain responsibilities for you if you
2816 distribute copies of the software, or if you modify it.
2817
2818   For example, if you distribute copies of such a program, whether
2819 gratis or for a fee, you must give the recipients all the rights that
2820 you have.  You must make sure that they, too, receive or can get the
2821 source code.  And you must show them these terms so they know their
2822 rights.
2823
2824   We protect your rights with two steps: (1) copyright the software, and
2825 (2) offer you this license which gives you legal permission to copy,
2826 distribute and/or modify the software.
2827
2828   Also, for each author's protection and ours, we want to make certain
2829 that everyone understands that there is no warranty for this free
2830 software.  If the software is modified by someone else and passed on, we
2831 want its recipients to know that what they have is not the original, so
2832 that any problems introduced by others will not reflect on the original
2833 authors' reputations.
2834
2835   Finally, any free program is threatened constantly by software
2836 patents.  We wish to avoid the danger that redistributors of a free
2837 program will individually obtain patent licenses, in effect making the
2838 program proprietary.  To prevent this, we have made it clear that any
2839 patent must be licensed for everyone's free use or not licensed at all.
2840
2841   The precise terms and conditions for copying, distribution and
2842 modification follow.
2843
2844 @iftex
2845 @unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2846 @end iftex
2847 @ifinfo
2848 @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2849 @end ifinfo
2850
2851 @enumerate
2852 @item
2853 This License applies to any program or other work which contains
2854 a notice placed by the copyright holder saying it may be distributed
2855 under the terms of this General Public License.  The ``Program'', below,
2856 refers to any such program or work, and a ``work based on the Program''
2857 means either the Program or any derivative work under copyright law:
2858 that is to say, a work containing the Program or a portion of it,
2859 either verbatim or with modifications and/or translated into another
2860 language.  (Hereinafter, translation is included without limitation in
2861 the term ``modification''.)  Each licensee is addressed as ``you''.
2862
2863 Activities other than copying, distribution and modification are not
2864 covered by this License; they are outside its scope.  The act of
2865 running the Program is not restricted, and the output from the Program
2866 is covered only if its contents constitute a work based on the
2867 Program (independent of having been made by running the Program).
2868 Whether that is true depends on what the Program does.
2869
2870 @item
2871 You may copy and distribute verbatim copies of the Program's
2872 source code as you receive it, in any medium, provided that you
2873 conspicuously and appropriately publish on each copy an appropriate
2874 copyright notice and disclaimer of warranty; keep intact all the
2875 notices that refer to this License and to the absence of any warranty;
2876 and give any other recipients of the Program a copy of this License
2877 along with the Program.
2878
2879 You may charge a fee for the physical act of transferring a copy, and
2880 you may at your option offer warranty protection in exchange for a fee.
2881
2882 @item
2883 You may modify your copy or copies of the Program or any portion
2884 of it, thus forming a work based on the Program, and copy and
2885 distribute such modifications or work under the terms of Section 1
2886 above, provided that you also meet all of these conditions:
2887
2888 @enumerate a
2889 @item
2890 You must cause the modified files to carry prominent notices
2891 stating that you changed the files and the date of any change.
2892
2893 @item
2894 You must cause any work that you distribute or publish, that in
2895 whole or in part contains or is derived from the Program or any
2896 part thereof, to be licensed as a whole at no charge to all third
2897 parties under the terms of this License.
2898
2899 @item
2900 If the modified program normally reads commands interactively
2901 when run, you must cause it, when started running for such
2902 interactive use in the most ordinary way, to print or display an
2903 announcement including an appropriate copyright notice and a
2904 notice that there is no warranty (or else, saying that you provide
2905 a warranty) and that users may redistribute the program under
2906 these conditions, and telling the user how to view a copy of this
2907 License.  (Exception: if the Program itself is interactive but
2908 does not normally print such an announcement, your work based on
2909 the Program is not required to print an announcement.)
2910 @end enumerate
2911
2912 These requirements apply to the modified work as a whole.  If
2913 identifiable sections of that work are not derived from the Program,
2914 and can be reasonably considered independent and separate works in
2915 themselves, then this License, and its terms, do not apply to those
2916 sections when you distribute them as separate works.  But when you
2917 distribute the same sections as part of a whole which is a work based
2918 on the Program, the distribution of the whole must be on the terms of
2919 this License, whose permissions for other licensees extend to the
2920 entire whole, and thus to each and every part regardless of who wrote it.
2921
2922 Thus, it is not the intent of this section to claim rights or contest
2923 your rights to work written entirely by you; rather, the intent is to
2924 exercise the right to control the distribution of derivative or
2925 collective works based on the Program.
2926
2927 In addition, mere aggregation of another work not based on the Program
2928 with the Program (or with a work based on the Program) on a volume of
2929 a storage or distribution medium does not bring the other work under
2930 the scope of this License.
2931
2932 @item
2933 You may copy and distribute the Program (or a work based on it,
2934 under Section 2) in object code or executable form under the terms of
2935 Sections 1 and 2 above provided that you also do one of the following:
2936
2937 @enumerate a
2938 @item
2939 Accompany it with the complete corresponding machine-readable
2940 source code, which must be distributed under the terms of Sections
2941 1 and 2 above on a medium customarily used for software interchange; or,
2942
2943 @item
2944 Accompany it with a written offer, valid for at least three
2945 years, to give any third party, for a charge no more than your
2946 cost of physically performing source distribution, a complete
2947 machine-readable copy of the corresponding source code, to be
2948 distributed under the terms of Sections 1 and 2 above on a medium
2949 customarily used for software interchange; or,
2950
2951 @item
2952 Accompany it with the information you received as to the offer
2953 to distribute corresponding source code.  (This alternative is
2954 allowed only for noncommercial distribution and only if you
2955 received the program in object code or executable form with such
2956 an offer, in accord with Subsection b above.)
2957 @end enumerate
2958
2959 The source code for a work means the preferred form of the work for
2960 making modifications to it.  For an executable work, complete source
2961 code means all the source code for all modules it contains, plus any
2962 associated interface definition files, plus the scripts used to
2963 control compilation and installation of the executable.  However, as a
2964 special exception, the source code distributed need not include
2965 anything that is normally distributed (in either source or binary
2966 form) with the major components (compiler, kernel, and so on) of the
2967 operating system on which the executable runs, unless that component
2968 itself accompanies the executable.
2969
2970 If distribution of executable or object code is made by offering
2971 access to copy from a designated place, then offering equivalent
2972 access to copy the source code from the same place counts as
2973 distribution of the source code, even though third parties are not
2974 compelled to copy the source along with the object code.
2975
2976 @item
2977 You may not copy, modify, sublicense, or distribute the Program
2978 except as expressly provided under this License.  Any attempt
2979 otherwise to copy, modify, sublicense or distribute the Program is
2980 void, and will automatically terminate your rights under this License.
2981 However, parties who have received copies, or rights, from you under
2982 this License will not have their licenses terminated so long as such
2983 parties remain in full compliance.
2984
2985 @item
2986 You are not required to accept this License, since you have not
2987 signed it.  However, nothing else grants you permission to modify or
2988 distribute the Program or its derivative works.  These actions are
2989 prohibited by law if you do not accept this License.  Therefore, by
2990 modifying or distributing the Program (or any work based on the
2991 Program), you indicate your acceptance of this License to do so, and
2992 all its terms and conditions for copying, distributing or modifying
2993 the Program or works based on it.
2994
2995 @item
2996 Each time you redistribute the Program (or any work based on the
2997 Program), the recipient automatically receives a license from the
2998 original licensor to copy, distribute or modify the Program subject to
2999 these terms and conditions.  You may not impose any further
3000 restrictions on the recipients' exercise of the rights granted herein.
3001 You are not responsible for enforcing compliance by third parties to
3002 this License.
3003
3004 @item
3005 If, as a consequence of a court judgment or allegation of patent
3006 infringement or for any other reason (not limited to patent issues),
3007 conditions are imposed on you (whether by court order, agreement or
3008 otherwise) that contradict the conditions of this License, they do not
3009 excuse you from the conditions of this License.  If you cannot
3010 distribute so as to satisfy simultaneously your obligations under this
3011 License and any other pertinent obligations, then as a consequence you
3012 may not distribute the Program at all.  For example, if a patent
3013 license would not permit royalty-free redistribution of the Program by
3014 all those who receive copies directly or indirectly through you, then
3015 the only way you could satisfy both it and this License would be to
3016 refrain entirely from distribution of the Program.
3017
3018 If any portion of this section is held invalid or unenforceable under
3019 any particular circumstance, the balance of the section is intended to
3020 apply and the section as a whole is intended to apply in other
3021 circumstances.
3022
3023 It is not the purpose of this section to induce you to infringe any
3024 patents or other property right claims or to contest validity of any
3025 such claims; this section has the sole purpose of protecting the
3026 integrity of the free software distribution system, which is
3027 implemented by public license practices.  Many people have made
3028 generous contributions to the wide range of software distributed
3029 through that system in reliance on consistent application of that
3030 system; it is up to the author/donor to decide if he or she is willing
3031 to distribute software through any other system and a licensee cannot
3032 impose that choice.
3033
3034 This section is intended to make thoroughly clear what is believed to
3035 be a consequence of the rest of this License.
3036
3037 @item
3038 If the distribution and/or use of the Program is restricted in
3039 certain countries either by patents or by copyrighted interfaces, the
3040 original copyright holder who places the Program under this License
3041 may add an explicit geographical distribution limitation excluding
3042 those countries, so that distribution is permitted only in or among
3043 countries not thus excluded.  In such case, this License incorporates
3044 the limitation as if written in the body of this License.
3045
3046 @item
3047 The Free Software Foundation may publish revised and/or new versions
3048 of the General Public License from time to time.  Such new versions will
3049 be similar in spirit to the present version, but may differ in detail to
3050 address new problems or concerns.
3051
3052 Each version is given a distinguishing version number.  If the Program
3053 specifies a version number of this License which applies to it and ``any
3054 later version'', you have the option of following the terms and conditions
3055 either of that version or of any later version published by the Free
3056 Software Foundation.  If the Program does not specify a version number of
3057 this License, you may choose any version ever published by the Free Software
3058 Foundation.
3059
3060 @item
3061 If you wish to incorporate parts of the Program into other free
3062 programs whose distribution conditions are different, write to the author
3063 to ask for permission.  For software which is copyrighted by the Free
3064 Software Foundation, write to the Free Software Foundation; we sometimes
3065 make exceptions for this.  Our decision will be guided by the two goals
3066 of preserving the free status of all derivatives of our free software and
3067 of promoting the sharing and reuse of software generally.
3068
3069 @iftex
3070 @heading NO WARRANTY
3071 @end iftex
3072 @ifinfo
3073 @center NO WARRANTY
3074 @end ifinfo
3075 @cindex no warranty
3076
3077 @item
3078 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
3079 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
3080 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
3081 PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
3082 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3083 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
3084 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
3085 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
3086 REPAIR OR CORRECTION.
3087
3088 @item
3089 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
3090 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
3091 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
3092 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
3093 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
3094 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
3095 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
3096 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
3097 POSSIBILITY OF SUCH DAMAGES.
3098 @end enumerate
3099
3100 @iftex
3101 @heading END OF TERMS AND CONDITIONS
3102 @end iftex
3103 @ifinfo
3104 @center END OF TERMS AND CONDITIONS
3105 @end ifinfo
3106
3107 @page
3108 @unnumberedsec How to Apply These Terms to Your New Programs
3109
3110   If you develop a new program, and you want it to be of the greatest
3111 possible use to the public, the best way to achieve this is to make it
3112 free software which everyone can redistribute and change under these terms.
3113
3114   To do so, attach the following notices to the program.  It is safest
3115 to attach them to the start of each source file to most effectively
3116 convey the exclusion of warranty; and each file should have at least
3117 the ``copyright'' line and a pointer to where the full notice is found.
3118
3119 @smallexample
3120 @var{one line to give the program's name and an idea of what it does.}
3121 Copyright (C) 19@var{yy}  @var{name of author}
3122
3123 This program is free software; you can redistribute it and/or
3124 modify it under the terms of the GNU General Public License
3125 as published by the Free Software Foundation; either version 2
3126 of the License, or (at your option) any later version.
3127
3128 This program is distributed in the hope that it will be useful,
3129 but WITHOUT ANY WARRANTY; without even the implied warranty of
3130 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3131 GNU General Public License for more details.
3132
3133 You should have received a copy of the GNU General Public License
3134 along with this program; if not, write to the Free Software
3135 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3136 @end smallexample
3137
3138 Also add information on how to contact you by electronic and paper mail.
3139
3140 If the program is interactive, make it output a short notice like this
3141 when it starts in an interactive mode:
3142
3143 @smallexample
3144 Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
3145 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
3146 type `show w'.  This is free software, and you are welcome
3147 to redistribute it under certain conditions; type `show c'
3148 for details.
3149 @end smallexample
3150
3151 The hypothetical commands @samp{show w} and @samp{show c} should show
3152 the appropriate parts of the General Public License.  Of course, the
3153 commands you use may be called something other than @samp{show w} and
3154 @samp{show c}; they could even be mouse-clicks or menu items---whatever
3155 suits your program.
3156
3157 You should also get your employer (if you work as a programmer) or your
3158 school, if any, to sign a ``copyright disclaimer'' for the program, if
3159 necessary.  Here is a sample; alter the names:
3160
3161 @smallexample
3162 @group
3163 Yoyodyne, Inc., hereby disclaims all copyright
3164 interest in the program `Gnomovision'
3165 (which makes passes at compilers) written
3166 by James Hacker.
3167
3168 @var{signature of Ty Coon}, 1 April 1989
3169 Ty Coon, President of Vice
3170 @end group
3171 @end smallexample
3172
3173 This General Public License does not permit incorporating your program into
3174 proprietary programs.  If your program is a subroutine library, you may
3175 consider it more useful to permit linking proprietary applications with the
3176 library.  If this is what you want to do, use the GNU Library General
3177 Public License instead of this License.
3178
3179 @node Concept Index,  , Copying, Top
3180 @unnumbered Concept Index
3181 @printindex cp
3182
3183 @contents
3184
3185 @bye