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