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