version 1.47, 2005/01/07 10:36:29 |
version 1.48, 2005/01/07 11:07:40 |
|
|
.Nm |
.Nm |
is the user interface to the |
is the user interface to the |
.Tn ARPANET |
.Tn ARPANET |
standard File Transfer Protocol. |
standard File Transfer Protocol (FTP). |
The program allows a user to transfer files to and from a |
The program allows a user to transfer files to and from a |
remote network site. |
remote network site. |
.Pp |
.Pp |
|
|
.Nm |
.Nm |
to use IPv6 addresses only. |
to use IPv6 addresses only. |
.It Fl A |
.It Fl A |
Force active mode ftp. |
Force active mode FTP. |
By default, |
By default, |
.Nm |
.Nm |
will try to use passive mode ftp and fall back to active mode |
will try to use passive mode FTP and fall back to active mode |
if passive is not supported by the server. |
if passive is not supported by the server. |
This option causes |
This option causes |
.Nm |
.Nm |
|
|
.Ar output . |
.Ar output . |
To make the contents go to stdout, |
To make the contents go to stdout, |
use |
use |
.Dq - |
.Sq - |
for |
for |
.Ar output . |
.Ar output . |
.It Fl P Ar port |
.It Fl P Ar port |
|
|
If this is done, |
If this is done, |
.Nm |
.Nm |
will immediately attempt to establish a connection to an |
will immediately attempt to establish a connection to an |
.Tn FTP |
FTP server on that host; otherwise, |
server on that host; otherwise, |
|
.Nm |
.Nm |
will enter its command interpreter and await instructions |
will enter its command interpreter and await instructions |
from the user. |
from the user. |
|
|
is provided to the user. |
is provided to the user. |
The following commands are recognized |
The following commands are recognized |
by |
by |
.Nm ftp : |
.Nm : |
.Bl -tag -width Fl |
.Bl -tag -width Fl |
.It Ic \&! Op Ar command Op Ar args |
.It Ic \&! Op Ar command Op Ar args |
Invoke an interactive shell on the local machine. |
Invoke an interactive shell on the local machine. |
|
|
.Ic type |
.Ic type |
to support binary image transfer. |
to support binary image transfer. |
.It Ic bye |
.It Ic bye |
Terminate the |
Terminate the FTP session with the remote server and exit |
.Tn FTP |
.Nm . |
session with the remote server |
|
and exit |
|
.Nm ftp . |
|
An end-of-file will also terminate the session and exit. |
An end-of-file will also terminate the session and exit. |
.It Ic case |
.It Ic case |
Toggle remote computer file name case mapping during |
Toggle remote computer file name case mapping during |
|
|
system to |
system to |
.Ar mode . |
.Ar mode . |
.It Ic close |
.It Ic close |
Terminate the |
Terminate the FTP session with the remote server and |
.Tn FTP |
|
session with the remote server and |
|
return to the command interpreter. |
return to the command interpreter. |
Any defined macros are erased. |
Any defined macros are erased. |
.It Ic cr |
.It Ic cr |
|
|
separately on the remote machine and the lists are not merged. |
separately on the remote machine and the lists are not merged. |
Expansion of a directory name is likely to be |
Expansion of a directory name is likely to be |
different from expansion of the name of an ordinary file: |
different from expansion of the name of an ordinary file: |
the exact result depends on the foreign operating system and ftp server, |
the exact result depends on the foreign operating system and FTP server, |
and can be previewed by doing |
and can be previewed by doing |
.Dq mls remote-files - . |
.Dq mls remote-files - . |
Note: |
Note: |
|
|
.It Ic open Ar host Op Ar port |
.It Ic open Ar host Op Ar port |
Establish a connection to the specified |
Establish a connection to the specified |
.Ar host |
.Ar host |
.Tn FTP |
FTP server. |
server. |
|
An optional port number may be supplied, |
An optional port number may be supplied, |
in which case |
in which case |
.Nm |
.Nm |
will attempt to contact an |
will attempt to contact an FTP server at that port. |
.Tn FTP |
|
server at that port. |
|
If the |
If the |
.Ic auto-login |
.Ic auto-login |
option is on (default), |
option is on (default), |
.Nm |
.Nm |
will also attempt to automatically log the user in to |
will also attempt to automatically log the user in to |
the |
the FTP server (see below). |
.Tn FTP |
|
server (see below). |
|
.It Ic page Ar file |
.It Ic page Ar file |
Retrieve |
Retrieve |
.Ic file |
.Ic file |
|
|
is null or not defined). |
is null or not defined). |
.It Ic passive |
.It Ic passive |
Toggle passive mode. |
Toggle passive mode. |
If passive mode is turned on (default is on), the ftp client will |
If passive mode is turned on (default is on), |
send a |
.Nm |
|
will send a |
.Dv PASV |
.Dv PASV |
command for all data connections instead of the usual |
command for all data connections instead of the usual |
.Dv PORT |
.Dv PORT |
|
|
.Nm |
.Nm |
through a gateway router or host that controls the directionality of |
through a gateway router or host that controls the directionality of |
traffic. |
traffic. |
(Note that though ftp servers are required to support the |
(Note that though FTP servers are required to support the |
.Dv PASV |
.Dv PASV |
command by RFC 1123, some do not.) |
command by RFC 1123, some do not.) |
.It Ic preserve |
.It Ic preserve |
|
|
The progress bar will be disabled for a transfer that has |
The progress bar will be disabled for a transfer that has |
.Ar local-file |
.Ar local-file |
as |
as |
.Dq - |
.Sq - |
or a command that starts with |
or a command that starts with |
.Sq \&| . |
.Sq \&| . |
Refer to |
Refer to |
|
|
Transfer the file. |
Transfer the file. |
.El |
.El |
.It Ic proxy Ar ftp-command |
.It Ic proxy Ar ftp-command |
Execute an ftp command on a secondary control connection. |
Execute an FTP command on a secondary control connection. |
This command allows simultaneous connection to two remote ftp |
This command allows simultaneous connection to two remote FTP |
servers for transferring files between the two servers. |
servers for transferring files between the two servers. |
The first |
The first |
.Ic proxy |
.Ic proxy |
|
|
to establish the secondary control connection. |
to establish the secondary control connection. |
Enter the command |
Enter the command |
.Ic proxy ?\& |
.Ic proxy ?\& |
to see other ftp commands executable on the |
to see other FTP commands executable on the |
secondary connection. |
secondary connection. |
The following commands behave differently when prefaced by |
The following commands behave differently when prefaced by |
.Ic proxy : |
.Ic proxy : |
|
|
.Ic append |
.Ic append |
transfer files from the host on the secondary control connection |
transfer files from the host on the secondary control connection |
to the host on the primary control connection. |
to the host on the primary control connection. |
Third party file transfers depend upon support of the ftp protocol |
Third party file transfers depend upon support of the FTP protocol |
.Dv PASV |
.Dv PASV |
command by the server on the secondary control connection. |
command by the server on the secondary control connection. |
.It Ic put Ar local-file Op Ar remote-file |
.It Ic put Ar local-file Op Ar remote-file |
|
|
A synonym for |
A synonym for |
.Ic bye . |
.Ic bye . |
.It Ic quote Ar arg1 arg2 ... |
.It Ic quote Ar arg1 arg2 ... |
The arguments specified are sent, verbatim, to the remote |
The arguments specified are sent, verbatim, to the remote FTP server. |
.Tn FTP |
|
server. |
|
.It Ic recv Ar remote-file Op Ar local-file |
.It Ic recv Ar remote-file Op Ar local-file |
A synonym for |
A synonym for |
.Ic get . |
.Ic get . |
|
|
.It Ic reset |
.It Ic reset |
Clear reply queue. |
Clear reply queue. |
This command re-synchronizes command/reply sequencing with the remote |
This command re-synchronizes command/reply sequencing with the remote |
ftp server. |
FTP server. |
Resynchronization may be necessary following a violation of the ftp protocol |
Resynchronization may be necessary following a violation of the FTP protocol |
by the remote server. |
by the remote server. |
.It Ic restart Ar marker |
.It Ic restart Ar marker |
Restart the immediately following |
Restart the immediately following |
|
|
is usually a byte |
is usually a byte |
offset into the file. |
offset into the file. |
.It Ic rhelp Op Ar command-name |
.It Ic rhelp Op Ar command-name |
Request help from the remote |
Request help from the remote FTP server. |
.Tn FTP |
|
server. |
|
If a |
If a |
.Ar command-name |
.Ar command-name |
is specified, it is supplied to the server as well. |
is specified, it is supplied to the server as well. |
|
|
commands is disabled, no attempt will be made to use |
commands is disabled, no attempt will be made to use |
.Dv PORT |
.Dv PORT |
commands for each data transfer. |
commands for each data transfer. |
This is useful |
This is useful for certain FTP implementations which do ignore |
for certain |
|
.Tn FTP |
|
implementations which do ignore |
|
.Dv PORT |
.Dv PORT |
commands but, incorrectly, indicate they've been accepted. |
commands but, incorrectly, indicate they've been accepted. |
.It Ic site Ar arg1 arg2 ... |
.It Ic site Ar arg1 arg2 ... |
The arguments specified are sent, verbatim, to the remote |
The arguments specified are sent, verbatim, to the remote FTP server as a |
.Tn FTP |
|
server as a |
|
.Dv SITE |
.Dv SITE |
command. |
command. |
.It Ic size Ar file-name |
.It Ic size Ar file-name |
|
|
on remote machine. |
on remote machine. |
.It Ic status |
.It Ic status |
Show the current status of |
Show the current status of |
.Nm ftp . |
.Nm . |
.\" .It Ic struct Op Ar struct-name |
.\" .It Ic struct Op Ar struct-name |
.\" Set the file transfer |
.\" Set the file transfer |
.\" .Ar structure |
.\" .Ar structure |
|
|
.\" structure is used. |
.\" structure is used. |
.It Ic sunique |
.It Ic sunique |
Toggle storing of files on remote machine under unique file names. |
Toggle storing of files on remote machine under unique file names. |
The remote ftp server must support the ftp protocol |
The remote FTP server must support the FTP protocol |
.Dv STOU |
.Dv STOU |
command for |
command for |
successful completion. |
successful completion. |
|
|
.Ic user Ar user-name |
.Ic user Ar user-name |
.Op Ar password Op Ar account |
.Op Ar password Op Ar account |
.Xc |
.Xc |
Identify yourself to the remote |
Identify yourself to the remote FTP server. |
.Tn FTP |
|
server. |
|
If the |
If the |
.Ar password |
.Ar password |
is not specified and the server requires it, |
is not specified and the server requires it, |
|
|
will prompt the user for it (after disabling local echo). |
will prompt the user for it (after disabling local echo). |
If an |
If an |
.Ar account |
.Ar account |
field is not specified, and the |
field is not specified, and the FTP server requires it, |
.Tn FTP |
the user will be prompted for it. |
server |
|
requires it, the user will be prompted for it. |
|
If an |
If an |
.Ar account |
.Ar account |
field is specified, an account command will |
field is specified, an account command will |
|
|
is invoked with |
is invoked with |
.Dq auto-login |
.Dq auto-login |
disabled, this process is done automatically on initial connection to the |
disabled, this process is done automatically on initial connection to the |
.Tn FTP |
FTP server. |
server. |
|
.It Ic verbose |
.It Ic verbose |
Toggle verbose mode. |
Toggle verbose mode. |
In verbose mode, all responses from |
In verbose mode, all responses from |
the |
the FTP server are displayed to the user. |
.Tn FTP |
|
server are displayed to the user. |
|
In addition, |
In addition, |
if verbose is on, when a file transfer completes, statistics |
if verbose is on, when a file transfer completes, statistics |
regarding the efficiency of the transfer are reported. |
regarding the efficiency of the transfer are reported. |
|
|
.Bl -tag -width "ftp://[user:password@]host[:port]/file[/]" |
.Bl -tag -width "ftp://[user:password@]host[:port]/file[/]" |
.It host:/file[/] |
.It host:/file[/] |
.Dq Classic |
.Dq Classic |
ftp format. |
.Nm |
|
format. |
.It ftp://[user:password@]host[:port]/file[/] |
.It ftp://[user:password@]host[:port]/file[/] |
An ftp URL, retrieved using the ftp protocol if |
An FTP URL, retrieved using the FTP protocol if |
.Ev ftp_proxy |
.Ev ftp_proxy |
isn't defined. |
isn't defined. |
Otherwise, transfer using http via the proxy defined in |
Otherwise, transfer using HTTP via the proxy defined in |
.Ev ftp_proxy . |
.Ev ftp_proxy . |
If |
If |
.Ar user : Ns Ar password Ns @ |
.Ar user : Ns Ar password Ns @ |
|
|
with a password of |
with a password of |
.Ar password . |
.Ar password . |
.It http://host[:port]/file |
.It http://host[:port]/file |
An http URL, retrieved using the http protocol. |
An HTTP URL, retrieved using the HTTP protocol. |
If |
If |
.Ev http_proxy |
.Ev http_proxy |
is defined, it is used as a URL to an HTTP proxy server. |
is defined, it is used as a URL to an HTTP proxy server. |
.El |
.El |
.Pp |
.Pp |
If a classic format or an ftp URL format has a trailing |
If a classic format or an FTP URL format has a trailing |
.Sq / , |
.Sq / , |
then |
then |
.Nm |
.Nm |
|
|
to the directory given as the path, and leave the user in interactive |
to the directory given as the path, and leave the user in interactive |
mode ready for further input. |
mode ready for further input. |
.Pp |
.Pp |
If successive auto-fetch ftp elements refer to the same host, then |
If successive auto-fetch FTP elements refer to the same host, then |
the connection is maintained between transfers, reducing overhead on |
the connection is maintained between transfers, reducing overhead on |
connection creation and deletion. |
connection creation and deletion. |
.Pp |
.Pp |
|
|
To abort a file transfer, use the terminal interrupt key |
To abort a file transfer, use the terminal interrupt key |
(usually Ctrl-C). |
(usually Ctrl-C). |
Sending transfers will be immediately halted. |
Sending transfers will be immediately halted. |
Receiving transfers will be halted by sending an ftp protocol |
Receiving transfers will be halted by sending an FTP protocol |
.Dv ABOR |
.Dv ABOR |
command to the remote server, and discarding any further data received. |
command to the remote server, and discarding any further data received. |
The speed at which this is accomplished depends upon the remote |
The speed at which this is accomplished depends upon the remote |
|
|
from the remote server. |
from the remote server. |
A long delay in this mode may result from the ABOR processing described |
A long delay in this mode may result from the ABOR processing described |
above, or from unexpected behavior by the remote server, including |
above, or from unexpected behavior by the remote server, including |
violations of the ftp protocol. |
violations of the FTP protocol. |
If the delay results from unexpected remote server behavior, the local |
If the delay results from unexpected remote server behavior, the local |
.Nm |
.Nm |
program must be killed by hand. |
program must be killed by hand. |
|
|
.Bl -enum |
.Bl -enum |
.It |
.It |
If the file name |
If the file name |
.Dq - |
.Sq - |
is specified, the standard input (for reading) |
is specified, the standard input (for reading) |
or standard output (for writing) |
or standard output (for writing) |
is used. |
is used. |
|
|
.Pp |
.Pp |
thereby giving the user |
thereby giving the user |
.Ar automatic |
.Ar automatic |
anonymous ftp login to |
anonymous FTP login to |
machines not specified in |
machines not specified in |
.Pa .netrc . |
.Pa .netrc . |
This can be overridden |
This can be overridden |
|
|
.It Ev FTPMODE |
.It Ev FTPMODE |
Overrides the default operation mode. |
Overrides the default operation mode. |
Recognized values are: |
Recognized values are: |
.Bl -tag -width "passive " |
.Pp |
|
.Bl -tag -width "passive " -offset indent -compact |
.It passive |
.It passive |
passive mode ftp only |
passive mode FTP only |
.It active |
.It active |
active mode ftp only |
active mode FTP only |
.It auto |
.It auto |
automatic determination of passive or active (this is the default) |
automatic determination of passive or active (this is the default) |
.It gate |
.It gate |
|
|
Directory to put temporary files. |
Directory to put temporary files. |
.It Ev ftp_proxy |
.It Ev ftp_proxy |
URL of FTP proxy to use when making FTP URL requests |
URL of FTP proxy to use when making FTP URL requests |
(if not defined, use the standard ftp protocol). |
(if not defined, use the standard FTP protocol). |
.It Ev http_proxy |
.It Ev http_proxy |
URL of HTTP proxy to use when making HTTP URL requests. |
URL of HTTP proxy to use when making HTTP URL requests. |
.El |
.El |