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