2 .\" Copyright (c) 2000 Dag-Erling Coïdan Smørgrav
3 .\" All rights reserved.
4 .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer
12 .\" in this position and unchanged.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. The name of the author may not be used to endorse or promote products
17 .\" derived from this software without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 .Nd retrieve a file by Uniform Resource Locator
40 .Op Fl 146AFMPRUadlmnpqrsv
53 utility provides a command-line interface to the
56 Its purpose is to retrieve the file(s) pointed to by the URL(s) on the
59 The following options are available:
62 Stop and return exit code 0 at the first successfully retrieved file.
66 to use IPv4 addresses only.
70 to use IPv6 addresses only.
72 Do not automatically follow ``temporary'' (302) redirects.
73 Some broken Web sites will return a redirect instead of a not-found
74 error when the requested object does not exist.
76 Automatically retry the transfer upon soft failures.
78 Specify the read buffer size in bytes.
79 The default is 4096 bytes.
80 Attempts to set a buffer size lower than this will be silently
82 The number of reads actually performed is reported at verbosity level
83 two or higher (see the
87 The file to retrieve is in directory
90 This option is deprecated and is provided for backward compatibility
93 Use a direct connection even if a proxy is configured.
95 In combination with the
97 flag, forces a restart even if the local and remote files have
98 different modification times.
100 The file to retrieve is named
103 This option is deprecated and is provided for backward compatibility
106 The file to retrieve is located on the host
108 This option is deprecated and is provided for backward compatibility
111 If the target is a file-scheme URL, make a symbolic link to the target
112 rather than trying to copy it.
115 Mirror mode: if the file already exists locally and has the same size
116 and modification time as the remote file, it will not be fetched.
121 flags are mutually exclusive.
123 Don't preserve the modification time of the transferred file.
125 Set the output file name to
127 By default, a ``pathname'' is extracted from the specified URI, and
128 its basename is used as the name of the output file.
133 indicates that results are to be directed to the standard output.
137 This is useful if you are behind a firewall which blocks incoming
141 seems to hang when retrieving FTP URLs.
145 The output files are precious, and should not be deleted under any
146 circumstances, even if the transfer failed or was incomplete.
148 Restart a previously interrupted transfer.
153 flags are mutually exclusive.
155 Require the file size reported by the server to match the specified
157 If it does not, a message is printed and the file is not fetched.
158 If the server does not support reporting file sizes, this option is
159 ignored and the file is fetched unconditionally.
161 Print the size in bytes of each requested file, without fetching it.
165 Overrides the environment variables
169 for HTTP transfers if set.
171 When using passive FTP, allocate the port for the data connection from
172 the low (default) port range.
175 for details on how to specify which port range this corresponds to.
177 Increase verbosity level.
181 flag is specified, wait this many seconds between successive retries.
192 the current transfer rate statistics will be written to the
193 standard error output, in the same format as the standard completion
198 command returns zero on success, or one on failure.
199 If multiple URLs are listed on the command line,
201 will attempt to retrieve them each of them in turn, and return zero
202 only if they were all successfully retrieved.
204 .Bl -tag -width HTTP_TIMEOUT
206 maximum time, in seconds, to wait before aborting an
210 maximum time, in seconds, to wait before aborting an
215 All environment variables mentioned in the documentation for the
217 library are supported.
225 This implementation first appeared in
229 The original implementation of
232 .An Jean-Marc Zucconi .
233 It was extensively re-worked for
236 .An Garrett Wollman ,
237 and later completely rewritten to use the
240 .An Dag-Erling Sm\(/orgrav .
246 options are no longer supported and will generate warnings.
247 They were workarounds for bugs in other OSes which this implementation
250 One cannot both use the
255 options and specify URLs on the command line.