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