1.\" $Id: fetch.1,v 1.8 1996/09/19 18:07:24 peter Exp $ 2.Dd July 2, 1996 3.Dt FETCH 1 4.Os 5.Sh NAME 6.Nm fetch 7.Nd retrieve a file by Uniform Resource Locator 8.Sh SYNOPSIS 9.Nm fetch 10.Op Fl MPmnpqr 11.Op Fl o Ar file 12.Ar URL 13.Nm fetch 14.Op Fl MPmnpqr 15.Op Fl o Ar file 16.Op Fl c Ar dir 17.Fl f Ar file 18.Fl h Ar host 19.Sh DESCRIPTION 20.Nm fetch 21allows a user to transfer files from a remote network site using 22either the 23.Em ftp 24or the 25.Em http 26protocol. In the first form of the command, the 27.Ar URL 28may be of the form 29.Em http://site.domain/path/to/the/file 30or 31.Em ftp://site.domain/path/to/the/file. 32For compatibility with 33.Xr tftp 1 34the form 35.Em site.domain:/path/to/the/file 36is also accepted. 37To denote a local filename to be copied or linked to (see 38.Fl l 39flag), the 40.Em file:/path/to/the/file 41URL form is used. 42 43The second form of the command can be used to get a file using the 44.Em ftp 45protocol, specifying the file name and the remote host with the 46.Fl h 47and the 48.Fl f 49flags. 50.Pp 51The following options are available: 52.Bl -tag -width Fl -compact 53.It Fl M 54.It Fl m 55Mirror mode: Set the modification time of the file so that it is 56identical to the modification time of the file at the remote host. 57If the file already exists on the local host and is identical (as 58gauged by size and modification time), no transfer is done. 59.It Fl n 60Don't preserve the modtime of the transfered file, use the current time. 61.It Fl P 62.It Fl p 63Use passive mode if you are behind a firewall. 64.It Fl c Ar dir 65Change to directory 66.Ar dir 67at remote host before starting the transfer. 68.It Fl f Ar file 69Retrieve 70.Ar file 71on the remote host. 72.It Fl h Ar host 73Set the 74.Ar host 75for transfer. 76.It Fl l 77If target is a 78.Ar file:/ 79style of URL, make a link to the target rather than trying 80to copy it. 81.It Fl T Ar seconds 82Set timeout value to 83.Ar seconds. 84Overrides the environment variables 85.Ev FTP_TIMEOUT 86for ftp transfers or 87.Ev HTTP_TIMEOUT 88for http transfers if set. 89.It Fl q 90Quiet mode. Do not report transfer progress on the terminal. 91.It Fl v 92Verbose mode - display FTP connection information in painful detail. 93.It Fl r 94Reget. Use this flag to restart an interrupted transfer. 95.It Fl o Ar file 96Set the output file name to 97.Ar file 98.El 99.Sh ENVIRONMENT 100A transfer using the 101.Em ftp 102protocol will be aborted after the delay specified by the 103.Ev FTP_TIMEOUT 104variable. The default is 300 (seconds) 105 106A transfer using the 107.Em http 108protocol will be aborted after the delay specified by the 109.Ev HTTP_TIMEOUT 110variable. The default is 300 (seconds) 111 112.Ev FTP_LOGIN 113is the login name for the remote host. Default is 114.Em anonymous 115 116.Ev FTP_PASSWORD 117is the password for the remote host. Default is 118.Em <yourname>@ 119 120.Ev FTP_PASSIVE_MODE 121will force the use of passive mode FTP for firewalls. 122 123If 124.Ev HTTP_PROXY 125is set to a value of the form 126.Em host:port 127it specifies the address of a http proxy. The proxy will be used 128for all ftp and http requests. This is useful if you are behind 129an application firewall. 130.Sh SEE ALSO 131.Xr tftp 1 , 132.Xr ftp 1 133.Sh HISTORY 134The 135.Nm fetch 136command appeared in 137.Fx 2.1.5 . 138