FETCH(1)

NAME
fetch - retrieve a file by Uniform Resource Locator

SYNOPSIS
fetch [-MPmnpqr] [-o file] URL
fetch [-MPmnpqr] [-o file] [-c dir] -f file -h host

DESCRIPTION
fetch allows a user to transfer files from a remote network site using either the ftp or the http protocol. In the first form of the command, the URL may be of the form http://site.domain/path/to/the/file or ftp://site.domain/path/to/the/file. For compatibility with tftp(1) the form site.domain:/path/to/the/file is also accepted. To denote a local filename to be copied or linked to (see -l flag), the file:/path/to/the/file URL form is used. The second form of the command can be used to get a file using the ftp protocol, specifying the file name and the remote host with the -h and the -f flags.

The following options are available:
-M
-m  Mirror mode: Set the modification time of the file so that it is identical to the modification time of the file at the remote host. If the file already exists on the local host and is identical (as gauged by size and modification time), no transfer is done.
-n  Don't preserve the modtime of the transfered file, use the current time.
-P
-p  Use passive mode if you are behind a firewall.
-c dir
    Change to directory dir at remote host before starting the transfer.
-f file
    Retrieve file on the remote host.
-h host
    Set the host for transfer.
-l  If target is a file:/ style of URL, make a link to the target rather than trying to copy it.
-T seconds
    Set timeout value to seconds. Overrides the environment variables FTP_TIMEOUT for ftp transfers or HTTP_TIMEOUT for http transfers if set.
-q  Quiet mode. Do not report transfer progress on the terminal.
-v  Verbose mode - display FTP connection information in painful detail.
-r  Reget. Use this flag to restart an interrupted transfer.
-o file
    Set the output file name to file

ENVIRONMENT
A transfer using the ftp protocol will be aborted after the delay specified by the FTP_TIMEOUT variable. The default is 300 (seconds) A transfer using the http protocol will be aborted after the delay specified by the HTTP_TIMEOUT variable. The default is 300 (seconds) FTP_LOGIN is the login name for the remote host. Default is anonymous FTP_PASSWORD is the password for the remote host. Default is <yourname>@ FTP_PASSIVE_MODE will force the use of passive mode FTP for firewalls. If HTTP_PROXY is set to a value of the form host:port it specifies the address of a http proxy. The proxy will be used for all ftp and http requests. This is useful if you are behind an application firewall.

SEE ALSO
tftp(1), ftp(1)

HISTORY
The fetch command appeared in FreeBSD 2.1.5.