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