FETCH(1) | MidnightBSD General Commands Manual | FETCH(1) |
fetch
— retrieve a
file by Uniform Resource Locator
fetch |
[-146AadFlMmnPpqRrsUv ]
[-B bytes]
[--bind-address= host]
[--ca-cert= file]
[--ca-path= dir]
[--cert= file]
[--crl= file]
[-i file]
[--key= file]
[-N file]
[--no-passive ]
[--no-proxy= list]
[--no-sslv3 ] [--no-tlsv1 ]
[--no-verify-hostname ]
[--no-verify-peer ] [-o
file]
[--referer= URL]
[-S bytes]
[-T seconds]
[--user-agent= agent-string]
[-w seconds]
URL ... |
fetch |
[-146AadFlMmnPpqRrsUv ]
[-B bytes]
[--bind-address= host]
[--ca-cert= file]
[--ca-path= dir]
[--cert= file]
[--crl= file]
[-i file]
[--key= file]
[-N file]
[--no-passive ]
[--no-proxy= list]
[--no-sslv3 ] [--no-tlsv1 ]
[--no-verify-hostname ]
[--no-verify-peer ] [-o
file]
[--referer= URL]
[-S bytes]
[-T seconds]
[--user-agent= agent-string]
[-w seconds]
-h host
-f file
[-c dir] |
The fetch
utility provides a command-line
interface to the fetch(3)
library. Its purpose is to retrieve the file(s) pointed to by the URL(s) on
the command line.
The following options are available:
-1
,
--one-file
-4
,
--ipv4-only
fetch
to use IPv4 addresses only.-6
,
--ipv6-only
fetch
to use IPv6 addresses only.-A
,
--no-redirect
-a
,
--retry
-B
bytes,
--buffer-size=
bytes-v
flag).--bind-address=
host-c
dir--ca-cert=
file--ca-path=
dir--cert=
file--crl=
file-d
,
--direct
-F
,
--force-restart
-r
flag, forces a restart
even if the local and remote files have different modification times.
Implies -R
.-f
file-h
host-i
file,
--if-modified-since=
file--key=
file-l
,
--symlink
-M
-m
,
--mirror
-m
and -r
flags are
mutually exclusive.-N
file,
--netrc=
file-n
,
--no-mtime
--no-passive
--no-proxy=
list--no-sslv3
SSL_ALLOW_SSL3
to change this behavior.--no-tlsv1
--no-verify-hostname
--no-verify-peer
-o
file,
--output=
file-
’ indicates that results are to be
directed to the standard output. If the file
argument is a directory, fetched file(s) will be placed within the
directory, with name(s) selected as in the default behaviour.-P
-p
,
--passive
--no-passive
flag or set the
FTP_PASSIVE_MODE
environment variable to
‘NO
’.--referer=
URL-q
,
--quiet
-R
,
--keep-output
-r
,
--restart
-m
and -r
flags are
mutually exclusive.-S
bytes,
--require-size=
bytes-s
,
--print-size
-T
seconds,
--timeout=
secondsFTP_TIMEOUT
for FTP
transfers or HTTP_TIMEOUT
for HTTP transfers if
set.-U
,
--passive-portrange-default
--user-agent=
agent-string-v
,
--verbose
-w
seconds,
--retry-delay=
seconds-a
flag is specified, wait this many
seconds between successive retries.If fetch
receives a
SIGINFO
signal (see the
status
argument for
stty(1)), the current
transfer rate statistics will be written to the standard error output, in
the same format as the standard completion message.
FTP_TIMEOUT
HTTP_TIMEOUT
See fetch(3) for
a description of additional environment variables, including
FETCH_BIND_ADDRESS
,
FTP_LOGIN
, FTP_PASSIVE_MODE
,
FTP_PASSWORD
, FTP_PROXY
,
ftp_proxy
, HTTP_ACCEPT
,
HTTP_AUTH
, HTTP_PROXY
,
http_proxy
, HTTP_PROXY_AUTH
,
HTTP_REFERER
,
HTTP_USER_AGENT
, NETRC
,
NO_PROXY
, no_proxy
,
SSL_CA_CERT_FILE
,
SSL_CA_CERT_PATH
,
SSL_CLIENT_CERT_FILE
,
SSL_CLIENT_KEY_FILE
,
SSL_CRL_FILE
,
SSL_ALLOW_SSL3
, SSL_NO_TLS1
,
SSL_NO_TLS1_1
,
SSL_NO_TLS1_2
,
SSL_NO_VERIFY_HOSTNAME
and
SSL_NO_VERIFY_PEER
.
The fetch
command returns zero on success,
or one on failure. If multiple URLs are listed on the command line,
fetch
will attempt to retrieve each one of them in
turn, and will return zero only if they were all successfully retrieved.
If the -i
argument is used and the remote
file is not newer than the specified file then the command will still return
success, although no file is transferred.
The fetch
command appeared in
FreeBSD 2.1.5. This implementation first appeared in
FreeBSD 4.1.
The original implementation of fetch
was
done by Jean-Marc Zucconi
<jmz@FreeBSD.org>. It
was extensively re-worked for FreeBSD 2.2 by
Garrett Wollman
<wollman@FreeBSD.org>,
and later completely rewritten to use the
fetch(3) library by
Dag-Erling Smørgrav
<des@FreeBSD.org> and
Michael Gmelin
<freebsd@grem.de>.
The -b
and -t
options are no longer supported and will generate warnings. They were
workarounds for bugs in other OSes which this implementation does not
trigger.
One cannot both use the -h
,
-c
and -f
options and
specify URLs on the command line.
May 6, 2018 | midnightbsd-3.1 |