Chapter 2: Invoking 11
will not affect caching that might be performed by the resolving library or by an
external caching layer, such as NSCD.
If you don’t understand exactly what this option does, you probably won’t need it.
‘--restrict-file-names=modes’
Change which characters found in remote URLs must be escaped during generation
of local filenames. Characters that are restricted by this option are escaped, i.e.
replaced with ‘%HH’, where ‘HH’ is the hexadecimal number that corresponds to the
restricted character. This option may also be used to force all alphabetical cases to
be either lower- or uppercase.
By default, Wget escapes the characters that are not valid or safe as part of file
names on your operating system, as well as control characters that are typically
unprintable. This option is useful for changing these defaults, perhaps because you
are downloading to a non-native partition, or because you want to disable escaping
of the control characters, or you want to further restrict characters to only those in
the ascii range of values.
The modes are a comma-separated set of text values. The acceptable values are
‘unix’, ‘windows’, ‘nocontrol’, ‘ascii’, ‘lowercase’, and ‘uppercase’. The values
‘unix’ and ‘windows’ are mutually exclusive (one will override the other), as are
‘lowercase’ and ‘uppercase’. Those last are special cases, as they do not change
the set of characters that would be escaped, but rather force local file paths to be
converted either to lower- or uppercase.
When “unix” is specified, Wget escapes the character ‘/’ and the control characters
in the ranges 0–31 and 128–159. This is the default on Unix-like operating systems.
When “windows” is given, Wget escapes the characters ‘\’, ‘|’, ‘/’, ‘:’, ‘?’, ‘"’,
‘*’, ‘<’, ‘>’, and the control characters in the ranges 0–31 and 128–159. In addi-
tion to this, Wget in Windows mode uses ‘+’ instead of ‘:’ to separate host and
port in local file names, and uses ‘@’ instead of ‘?’ to separate the query por-
tion of the file name from the rest. Therefore, a URL that would be saved as
‘www.xemacs.org:4300/search.pl?input=blah’ in Unix mode would be saved as
‘www.xemacs.org+4300/search.pl@input=blah’ in Windows mode. This mode is
the default on Windows.
If you specify ‘nocontrol’, then the escaping of the control characters is also
switched off. This option may make sense when you are downloading URLs whose
names contain UTF-8 characters, on a system which can save and display filenames
in UTF-8 (some possible byte values used in UTF-8 byte sequences fall in the range
of values designated by Wget as “controls”).
The ‘ascii’ mode is used to specify that any bytes whose values are outside the
range of ascii characters (that is, greater than 127) shall be escaped. This can be
useful when saving filenames whose encoding does not match the one used locally.
‘-4’
‘--inet4-only’
‘-6’
‘--inet6-only’
Force connecting to IPv4 or IPv6 addresses. With ‘--inet4-only’ or ‘-4’, Wget
will only connect to IPv4 hosts, ignoring AAAA records in DNS, and refusing to
connect to IPv6 addresses specified in URLs. Conversely, with ‘--inet6-only’ or
‘-6’, Wget will only connect to IPv6 hosts and ignore A records and IPv4 addresses.
Neither options should be needed normally. By default, an IPv6-aware Wget will
use the address family specified by the host’s DNS record. If the DNS responds with