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