version 1.5, 1996/11/09 19:56:23 |
version 1.6, 1997/02/03 01:02:38 |
|
|
.\" $OpenBSD$ |
.\" $NetBSD: ftp.1,v 1.17 1997/02/01 10:45:01 lukem Exp $ |
.\" $NetBSD: ftp.1,v 1.11 1995/09/08 01:06:24 tls Exp $ |
|
.\" |
.\" |
.\" Copyright (c) 1985, 1989, 1990, 1993 |
.\" Copyright (c) 1985, 1989, 1990, 1993 |
.\" The Regents of the University of California. All rights reserved. |
.\" The Regents of the University of California. All rights reserved. |
|
|
.\" |
.\" |
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 |
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 |
.\" |
.\" |
.Dd October 9, 1994 |
.Dd January 20, 1997 |
.Dt FTP 1 |
.Dt FTP 1 |
.Os BSD 4.2 |
.Os BSD 4.2 |
.Sh NAME |
.Sh NAME |
|
|
.Tn ARPANET |
.Tn ARPANET |
file transfer program |
file transfer program |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm ftp |
.Nm |
.Op Fl t |
.Op Fl a |
.Op Fl v |
|
.Op Fl d |
.Op Fl d |
|
.Op Fl g |
.Op Fl i |
.Op Fl i |
.Op Fl n |
.Op Fl n |
.Op Fl g |
.Op Fl p |
.Op Fl r Ar seconds |
.Op Fl P Ar port |
.Op Ar host |
.Op Fl t |
|
.Op Fl v |
|
.Op Fl V |
|
.Op Ar host Op Ar port |
.Nm ftp |
.Nm ftp |
.Ar http://host/path/file.html |
ftp://\fIhost\fR[:\fIport\fR]/\fIfile\fR[/] |
.Nm ftp |
.Nm ftp |
.Ar ftp://host/path/file.tar.gz |
http://\fIhost\fR[:\fIport\fR]/\fIfile\fR |
.Nm ftp |
.Nm ftp |
.Ar host:/path/file.tar.gz |
\fIhost\fR:\fIfile\fR[/] |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm Ftp |
.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. |
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 |
The latter three usage formats will fetch a file using either the |
|
HTTP or FTP protocols into the current directory. |
|
This is ideal for scripts. |
|
.Pp |
|
Options may be specified at the command line, or to the |
Options may be specified at the command line, or to the |
command interpreter. |
command interpreter. |
.Bl -tag -width flag |
.Bl -tag -width "port " |
.It Fl t |
.It Fl a |
Enables packet tracing. |
Causes |
.It Fl v |
.Nm |
Verbose option forces |
to bypass normal login procedure, and use an anonymous login instead. |
.Nm ftp |
.It Fl d |
to show all responses from the remote server, as well |
Enables debugging. |
as report on data transfer statistics. |
.It Fl g |
|
Disables file name globbing. |
|
.It Fl i |
|
Turns off interactive prompting during |
|
multiple file transfers. |
.It Fl n |
.It Fl n |
Restrains |
Restrains |
.Nm ftp |
.Nm |
from attempting \*(Lqauto-login\*(Rq upon initial connection. |
from attempting |
|
.Dq auto-login |
|
upon initial connection. |
If auto-login is enabled, |
If auto-login is enabled, |
.Nm ftp |
.Nm |
will check the |
will check the |
.Pa .netrc |
.Pa .netrc |
(see below) file in the user's home directory for an entry describing |
(see below) file in the user's home directory for an entry describing |
an account on the remote machine. |
an account on the remote machine. |
If no entry exists, |
If no entry exists, |
.Nm ftp |
.Nm |
will prompt for the remote machine login name (default is the user |
will prompt for the remote machine login name (default is the user |
identity on the local machine), and, if necessary, prompt for a password |
identity on the local machine), and, if necessary, prompt for a password |
and an account with which to login. |
and an account with which to login. |
.It Fl i |
.It Fl p |
Turns off interactive prompting during |
Enable passive mode operation for use behind connection filtering firewalls. |
multiple file transfers. |
.It Fl P Ar port |
.It Fl d |
Sets the port number to |
Enables debugging. |
.Ar port . |
.It Fl g |
.It Fl t |
Disables file name globbing. |
Enables packet tracing. |
.It Fl r Ar number |
.It Fl v |
Retry to connect if failed, pausing for |
Enable verbose mode. |
.Ar number |
This is the default if input is from a terminal. |
of seconds. |
Forces |
|
.Nm |
|
to show all responses from the remote server, as well |
|
as report on data transfer statistics. |
|
.It Fl V |
|
Disable verbose mode, overriding the default of enabled when input |
|
is from a terminal. |
.El |
.El |
.Pp |
.Pp |
The client host with which |
The client host with which |
.Nm ftp |
.Nm |
is to communicate may be specified on the command line. |
is to communicate may be specified on the command line. |
If this is done, |
If this is done, |
.Nm ftp |
.Nm |
will immediately attempt to establish a connection to an |
will immediately attempt to establish a connection to an |
.Tn FTP |
.Tn FTP |
server on that host; otherwise, |
server on that host; otherwise, |
.Nm ftp |
.Nm |
will enter its command interpreter and await instructions |
will enter its command interpreter and await instructions |
from the user. |
from the user. |
When |
When |
.Nm ftp |
.Nm |
is awaiting commands from the user the prompt |
is awaiting commands from the user the prompt |
.Ql ftp> |
.Ql ftp> |
is provided to the user. |
is provided to the user. |
|
|
.Tn FTP |
.Tn FTP |
session with the remote server |
session with the remote server |
and exit |
and exit |
.Nm ftp . |
.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 |
|
|
.It Ic \&cd Ar remote-directory |
.It Ic \&cd Ar remote-directory |
Change the working directory on the remote machine |
Change the working directory on the remote machine |
to |
to |
.Ar remote-directory . |
.Ar remote-directory . |
.It Ic cdup |
.It Ic cdup |
Change the remote machine working directory to the parent of the |
Change the remote machine working directory to the parent of the |
current remote machine working directory. |
current remote machine working directory. |
|
|
Change the permission modes of the file |
Change the permission modes of the file |
.Ar file-name |
.Ar file-name |
on the remote |
on the remote |
sytem to |
system to |
.Ar mode . |
.Ar mode . |
.It Ic close |
.It Ic close |
Terminate the |
Terminate the |
.Tn FTP |
.Tn FTP |
|
|
.Ar debug-value |
.Ar debug-value |
is specified it is used to set the debugging level. |
is specified it is used to set the debugging level. |
When debugging is on, |
When debugging is on, |
.Nm ftp |
.Nm |
prints each command sent to the remote machine, preceded |
prints each command sent to the remote machine, preceded |
by the string |
by the string |
.Ql \-\-> |
.Ql \-\-> |
.It Xo |
.It Ic dir Op Ar remote-directory Op Ar local-file |
.Ic dir |
Print a listing of the contents of a |
.Op Ar remote-directory |
directory on the remote machine. |
.Op Ar local-file |
The listing includes any system-dependent information that the server |
.Xc |
chooses to include; for example, most |
Print a listing of the directory contents in the |
.Ux |
directory, |
systems will produce |
.Ar remote-directory , |
output from the command |
and, optionally, placing the output in |
.Ql ls \-l . |
.Ar local-file . |
(See also |
|
.Ic ls . ) |
|
If |
|
.Ar remote-directory |
|
is left unspecified, the current working directory is used. |
If interactive prompting is on, |
If interactive prompting is on, |
.Nm ftp |
.Nm |
will prompt the user to verify that the last argument is indeed the |
will prompt the user to verify that the last argument is indeed the |
target local file for receiving |
target local file for receiving |
.Ic dir |
.Ic dir |
output. |
output. |
If no directory is specified, the current working |
If no local file is specified, or if |
directory on the remote machine is used. |
|
If no local |
|
file is specified, or |
|
.Ar local-file |
.Ar local-file |
is |
is |
.Fl , |
.Sq Fl , |
output comes to the terminal. |
the output is sent to the terminal. |
.It Ic disconnect |
.It Ic disconnect |
A synonym for |
A synonym for |
.Ar close . |
.Ic close . |
|
.It Ic edit |
|
Toggle command line editing, and context sensitive command and file |
|
completion. |
|
This is automatically enabled if input is from a terminal, and |
|
disabled otherwise. |
|
.It Ic exit |
|
A synonym for |
|
.Ic bye . |
|
.It Ic ftp Ar host Op Ar port |
|
A synonym for |
|
.Ic open . |
.It Ic form Ar format |
.It Ic form Ar format |
Set the file transfer |
Set the file transfer |
.Ic form |
.Ic form |
to |
to |
.Ar format . |
.Ar format . |
The default format is \*(Lqfile\*(Rq. |
The default format is \*(Lqfile\*(Rq. |
.It Ic get Ar remote-file Op Ar local-file |
.It Ic get Ar remote-file Op Ar local-file |
Retrieve the |
Retrieve the |
|
|
.Ic mdelete , |
.Ic mdelete , |
.Ic mget |
.Ic mget |
and |
and |
.Ic mput . |
.Ic mput . |
If globbing is turned off with |
If globbing is turned off with |
.Ic glob , |
.Ic glob , |
the file name arguments |
the file name arguments |
|
|
Toggle hash-sign (``#'') printing for each data block |
Toggle hash-sign (``#'') printing for each data block |
transferred. |
transferred. |
The size of a data block defaults to 1024 bytes. |
The size of a data block defaults to 1024 bytes. |
This can be changed by specifying a size in bytes. |
This can be changed by specifying |
|
.Ar size |
|
in bytes. |
.It Ic help Op Ar command |
.It Ic help Op Ar command |
Print an informative message about the meaning of |
Print an informative message about the meaning of |
.Ar command . |
.Ar command . |
If no argument is given, |
If no argument is given, |
.Nm ftp |
.Nm |
prints a list of the known commands. |
prints a list of the known commands. |
.It Ic idle Op Ar seconds |
.It Ic idle Op Ar seconds |
Set the inactivity timer on the remote server to |
Set the inactivity timer on the remote server to |
|
|
no |
no |
.Ar directory |
.Ar directory |
is specified, the user's home directory is used. |
is specified, the user's home directory is used. |
.It Xo |
.It Ic lpwd |
.Ic \&ls |
Print the working directory on the local machine. |
.Op Ar remote-directory |
.It Ic \&ls Op Ar remote-directory Op Ar local-file |
.Op Ar local-file |
Print a list of the files in a |
.Xc |
|
Print a listing of the contents of a |
|
directory on the remote machine. |
directory on the remote machine. |
The listing includes any system-dependent information that the server |
|
chooses to include; for example, most |
|
.Ux |
|
systems will produce |
|
output from the command |
|
.Ql ls \-l . |
|
(See also |
|
.Ic nlist . ) |
|
If |
If |
.Ar remote-directory |
.Ar remote-directory |
is left unspecified, the current working directory is used. |
is left unspecified, the current working directory is used. |
If interactive prompting is on, |
If interactive prompting is on, |
.Nm ftp |
.Nm |
will prompt the user to verify that the last argument is indeed the |
will prompt the user to verify that the last argument is indeed the |
target local file for receiving |
target local file for receiving |
.Ic \&ls |
.Ic ls |
output. |
output. |
If no local file is specified, or if |
If no local file is specified, or if |
.Ar local-file |
.Ar local-file |
is |
is |
.Sq Fl , |
.Fl , |
the output is sent to the terminal. |
the output is sent to the terminal. |
.It Ic macdef Ar macro-name |
.It Ic macdef Ar macro-name |
Define a macro. |
Define a macro. |
|
|
.Ic dir , |
.Ic dir , |
except multiple remote files may be specified. |
except multiple remote files may be specified. |
If interactive prompting is on, |
If interactive prompting is on, |
.Nm ftp |
.Nm |
will prompt the user to verify that the last argument is indeed the |
will prompt the user to verify that the last argument is indeed the |
target local file for receiving |
target local file for receiving |
.Ic mdir |
.Ic mdir |
|
|
Make a directory on the remote machine. |
Make a directory on the remote machine. |
.It Ic mls Ar remote-files local-file |
.It Ic mls Ar remote-files local-file |
Like |
Like |
.Ic nlist , |
.Ic ls , |
except multiple remote files may be specified, |
except multiple remote files may be specified, |
and the |
and the |
.Ar local-file |
.Ar local-file |
must be specified. |
must be specified. |
If interactive prompting is on, |
If interactive prompting is on, |
.Nm ftp |
.Nm |
will prompt the user to verify that the last argument is indeed the |
will prompt the user to verify that the last argument is indeed the |
target local file for receiving |
target local file for receiving |
.Ic mls |
.Ic mls |
|
|
Set the file transfer |
Set the file transfer |
.Ic mode |
.Ic mode |
to |
to |
.Ar mode-name . |
.Ar mode-name . |
The default mode is \*(Lqstream\*(Rq mode. |
The default mode is \*(Lqstream\*(Rq mode. |
.It Ic modtime Ar file-name |
.It Ic modtime Ar file-name |
Show the last modification time of the file on the remote machine. |
Show the last modification time of the file on the remote machine. |
|
|
and |
and |
.Ic nmap |
.Ic nmap |
settings. |
settings. |
|
.It Ic msend Ar local-files |
|
A synonym for |
|
.Ic mput . |
.It Ic newer Ar file-name |
.It Ic newer Ar file-name |
Get the file only if the modification time of the remote file is more |
Get the file only if the modification time of the remote file is more |
recent that the file on the current system. |
recent that the file on the current system. |
If the file does not |
If the file does not |
exist on the current system, the remote file is considered |
exist on the current system, the remote file is considered |
.Ic newer . |
.Ic newer . |
Otherwise, this command is identical to |
Otherwise, this command is identical to |
.Ar get . |
.Ar get . |
.It Xo |
.It Ic nlist Op Ar remote-directory Op Ar local-file |
.Ic nlist |
A synonym for |
.Op Ar remote-directory |
.Ic ls . |
.Op Ar local-file |
|
.Xc |
|
Print a list of the files in a |
|
directory on the remote machine. |
|
If |
|
.Ar remote-directory |
|
is left unspecified, the current working directory is used. |
|
If interactive prompting is on, |
|
.Nm ftp |
|
will prompt the user to verify that the last argument is indeed the |
|
target local file for receiving |
|
.Ic nlist |
|
output. |
|
If no local file is specified, or if |
|
.Ar local-file |
|
is |
|
.Fl , |
|
the output is sent to the terminal. |
|
.It Ic nmap Op Ar inpattern outpattern |
.It Ic nmap Op Ar inpattern outpattern |
Set or unset the filename mapping mechanism. |
Set or unset the filename mapping mechanism. |
If no arguments are specified, the filename mapping mechanism is unset. |
If no arguments are specified, the filename mapping mechanism is unset. |
|
|
The mapping follows the pattern set by |
The mapping follows the pattern set by |
.Ar inpattern |
.Ar inpattern |
and |
and |
.Ar outpattern . |
.Ar outpattern . |
.Op Ar Inpattern |
.Op Ar Inpattern |
is a template for incoming filenames (which may have already been |
is a template for incoming filenames (which may have already been |
processed according to the |
processed according to the |
|
|
settings). |
settings). |
Variable templating is accomplished by including the |
Variable templating is accomplished by including the |
sequences `$1', `$2', ..., `$9' in |
sequences `$1', `$2', ..., `$9' in |
.Ar inpattern . |
.Ar inpattern . |
Use `\\' to prevent this special treatment of the `$' character. |
Use `\\' to prevent this special treatment of the `$' character. |
All other characters are treated literally, and are used to determine the |
All other characters are treated literally, and are used to determine the |
.Ic nmap |
.Ic nmap |
|
|
Characters in a filename matching a character in |
Characters in a filename matching a character in |
.Ar inchars |
.Ar inchars |
are replaced with the corresponding character in |
are replaced with the corresponding character in |
.Ar outchars . |
.Ar outchars . |
If the character's position in |
If the character's position in |
.Ar inchars |
.Ar inchars |
is longer than the length of |
is longer than the length of |
|
|
server. |
server. |
An optional port number may be supplied, |
An optional port number may be supplied, |
in which case, |
in which case, |
.Nm ftp |
.Nm |
will attempt to contact an |
will attempt to contact an |
.Tn FTP |
.Tn FTP |
server at that port. |
server at that port. |
If the |
If the |
.Ic auto-login |
.Ic auto-login |
option is on (default), |
option is on (default), |
.Nm ftp |
.Nm |
will also attempt to automatically log the user in to |
will also attempt to automatically log the user in to |
the |
the |
.Tn FTP |
.Tn FTP |
|
|
.Dv PORT |
.Dv PORT |
command, the client listens on a port and sends that address to the remote |
command, the client listens on a port and sends that address to the remote |
server, who connects back to it. Passive mode is useful when using |
server, who connects back to it. Passive mode is useful when using |
.Nm ftp |
.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 |
|
Toggle preservation of modification times on retrieved files. |
|
.It Ic progress |
|
Toggle display of transfer progress bar. |
.It Ic prompt |
.It Ic prompt |
Toggle interactive prompting. |
Toggle interactive prompting. |
Interactive prompting |
Interactive prompting |
|
|
will transfer all files, and any |
will transfer all files, and any |
.Ic mdelete |
.Ic mdelete |
will delete all files. |
will delete all files. |
|
.Pp |
|
When prompting is on, the following commands are available at a prompt: |
|
.Bl -tag -width 2n -offset indent |
|
.It Ic n |
|
Do not transfer the file. |
|
.It Ic a |
|
Answer |
|
.Sq yes |
|
to the current file, and automatically answer |
|
.Sq yes |
|
to any remaining files for the current command. |
|
.It Ic p |
|
Answer |
|
.Sq yes |
|
to the current file, and turn off prompt mode |
|
(as is |
|
.Dq prompt off |
|
had been given). |
|
.El |
|
.Pp |
|
Any other reponse will answer |
|
.Sq yes |
|
to the current file. |
.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 |
|
|
.Ic format , |
.Ic format , |
.Ic mode , |
.Ic mode , |
and |
and |
.Ic structure . |
.Ic structure . |
.It Ic pwd |
.It Ic pwd |
Print the name of the current working directory on the remote |
Print the name of the current working directory on the remote |
machine. |
machine. |
.It Ic quit |
.It Ic quit |
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 |
.Tn FTP |
.Tn FTP |
server. |
server. |
.It Ic recv Ar remote-file Op Ar local-file |
.It Ic recv Ar remote-file Op Ar local-file |
A synonym for get. |
A synonym for |
|
.Ic get . |
.It Ic reget Ar remote-file Op Ar local-file |
.It Ic reget Ar remote-file Op Ar local-file |
Reget acts like get, except that if |
Reget acts like get, except that if |
.Ar local-file |
.Ar local-file |
|
|
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. |
.It Ic remotestatus Op Ar file-name |
.It Ic rstatus Op Ar file-name |
With no arguments, show status of remote machine. |
With no arguments, show status of remote machine. |
If |
If |
.Ar file-name |
.Ar file-name |
is specified, show status of |
is specified, show status of |
.Ar file-name |
.Ar file-name |
on remote machine. |
on remote machine. |
.It Xo |
.It Ic rename Op Ar from Op Ar to |
.Ic rename |
|
.Op Ar from |
|
.Op Ar to |
|
.Xc |
|
Rename the file |
Rename the file |
.Ar from |
.Ar from |
on the remote machine, to the file |
on the remote machine, to the file |
.Ar to . |
.Ar to . |
.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 |
|
|
.Ic put |
.Ic put |
at the |
at the |
indicated |
indicated |
.Ar marker . |
.Ar marker . |
On |
On |
.Ux |
.Ux |
systems, marker is usually a byte |
systems, marker is usually a byte |
|
|
(see below). |
(see below). |
The default value is off. |
The default value is off. |
.It Ic send Ar local-file Op Ar remote-file |
.It Ic send Ar local-file Op Ar remote-file |
A synonym for put. |
A synonym for |
|
.Ic put . |
.It Ic sendport |
.It Ic sendport |
Toggle the use of |
Toggle the use of |
.Dv PORT |
.Dv PORT |
commands. |
commands. |
By default, |
By default, |
.Nm ftp |
.Nm |
will attempt to use a |
will attempt to use a |
.Dv PORT |
.Dv PORT |
command when establishing |
command when establishing |
|
|
If the |
If the |
.Dv PORT |
.Dv PORT |
command fails, |
command fails, |
.Nm ftp |
.Nm |
will use the default data port. |
will use the default data port. |
When the use of |
When the use of |
.Dv PORT |
.Dv PORT |
|
|
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 ftp . |
.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 |
|
|
Set the file transfer |
Set the file transfer |
.Ic type |
.Ic type |
to |
to |
.Ar type-name . |
.Ar type-name . |
If no type is specified, the current type |
If no type is specified, the current type |
is printed. |
is printed. |
The default type is network |
The default type is network |
.Tn ASCII . |
.Tn ASCII . |
.It Ic umask Op Ar newmask |
.It Ic umask Op Ar newmask |
Set the default umask on the remote server to |
Set the default umask on the remote server to |
.Ar newmask . |
.Ar newmask . |
If |
If |
.Ar newmask |
.Ar newmask |
is omitted, the current umask is printed. |
is omitted, the current umask is printed. |
.It Xo |
.It Xo |
.Ic user Ar user-name |
.Ic user Ar user-name |
.Op Ar password |
.Op Ar password Op Ar account |
.Op Ar account |
|
.Xc |
.Xc |
Identify yourself to the remote |
Identify yourself to the remote |
.Tn FTP |
.Tn FTP |
|
|
If the |
If the |
.Ar password |
.Ar password |
is not specified and the server requires it, |
is not specified and the server requires it, |
.Nm ftp |
.Nm |
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 |
|
|
is completed if the remote server did not require it |
is completed if the remote server did not require it |
for logging in. |
for logging in. |
Unless |
Unless |
.Nm ftp |
.Nm |
is invoked with \*(Lqauto-login\*(Rq disabled, this |
is invoked with \*(Lqauto-login\*(Rq disabled, this |
process is done automatically on initial connection to |
process is done automatically on initial connection to |
the |
the |
|
|
By default, |
By default, |
verbose is on. |
verbose is on. |
.It Ic ? Op Ar command |
.It Ic ? Op Ar command |
A synonym for help. |
A synonym for |
|
.Ic help . |
.El |
.El |
.Pp |
.Pp |
Command arguments which have embedded spaces may be quoted with |
Command arguments which have embedded spaces may be quoted with |
quote `"' marks. |
quote `"' marks. |
|
.Pp |
|
Commands which toggle settings can take an explicit |
|
.Ic on |
|
or |
|
.Ic off |
|
argument to force the setting appropriately. |
|
.Pp |
|
If |
|
.Nm |
|
receives a |
|
.Dv SIGINFO |
|
(see the |
|
.Dq status |
|
argument of |
|
.Xr stty 1 ) |
|
signal whilst a transfer is in progress, the current transfer rate |
|
statistics will be written to the standard error output, in the |
|
same format as the standard completion message. |
|
.Sh AUTO-FETCHING FILES |
|
In addition to standard commands, this version of |
|
.Nm |
|
supports an auto-fetch feature. |
|
To enable auto-fetch, simply pass the list of hostnames/files |
|
on the command line. |
|
.Pp |
|
The following formats are valid syntax for an auto-fetch element: |
|
.Bl -tag -width "http://host[:port]/file" |
|
.It host:/file |
|
.Dq Classic |
|
ftp format |
|
.It ftp://host[:port]/file |
|
FTP URL, using the ftp protocol. |
|
.It http://host[:port]/file |
|
HTTP URL, using the http protocol. |
|
If |
|
.Ev http_proxy |
|
is defined, it is used as a URL to an HTTP proxy server. |
|
.El |
|
.Pp |
|
If a classic format or a ftp URL format has a trailing |
|
.Sq / , |
|
then |
|
.Nm |
|
will connect to the site and |
|
.Ic cd |
|
to the directory given as the path, and leave the user in interactive |
|
mode ready for further input. |
|
.Pp |
|
If successive auto-fetch ftp elements refer to the same host, then |
|
the connection is maintained between transfers, reducing overhead on |
|
connection creation and deletion. |
.Sh ABORTING A FILE TRANSFER |
.Sh ABORTING A FILE TRANSFER |
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 the requested file. |
sending the requested file. |
.Pp |
.Pp |
The terminal interrupt key sequence will be ignored when |
The terminal interrupt key sequence will be ignored when |
.Nm ftp |
.Nm |
has completed any local processing and is awaiting a reply |
has completed any local processing and is awaiting a reply |
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 ftp |
.Nm |
program must be killed by hand. |
program must be killed by hand. |
.Sh FILE NAMING CONVENTIONS |
.Sh FILE NAMING CONVENTIONS |
Files specified as arguments to |
Files specified as arguments to |
.Nm ftp |
.Nm |
commands are processed according to the following rules. |
commands are processed according to the following rules. |
.Bl -enum |
.Bl -enum |
.It |
.It |
|
|
.Sq \&| , |
.Sq \&| , |
the |
the |
remainder of the argument is interpreted as a shell command. |
remainder of the argument is interpreted as a shell command. |
.Nm Ftp |
.Nm |
then forks a shell, using |
then forks a shell, using |
.Xr popen 3 |
.Xr popen 3 |
with the argument supplied, and reads (writes) from the stdout |
with the argument supplied, and reads (writes) from the stdout |
|
|
must be quoted; e.g. |
must be quoted; e.g. |
\*(Lq" ls -lt"\*(Rq. |
\*(Lq" ls -lt"\*(Rq. |
A particularly |
A particularly |
useful example of this mechanism is: \*(Lqdir more\*(Rq. |
useful example of this mechanism is: \*(Lqdir \&|more\*(Rq. |
.It |
.It |
Failing the above checks, if ``globbing'' is enabled, |
Failing the above checks, if ``globbing'' is enabled, |
local file names are expanded |
local file names are expanded |
|
|
.Ic glob |
.Ic glob |
command. |
command. |
If the |
If the |
.Nm ftp |
.Nm |
command expects a single local file (.e.g. |
command expects a single local file (.e.g. |
.Ic put ) , |
.Ic put ) , |
only the first filename generated by the "globbing" operation is used. |
only the first filename generated by the "globbing" operation is used. |
|
|
and |
and |
.Tn PDP Ns -20's |
.Tn PDP Ns -20's |
mostly). |
mostly). |
.Nm Ftp |
.Nm |
supports the ascii and image types of file transfer, |
supports the ascii and image types of file transfer, |
plus local byte size 8 for |
plus local byte size 8 for |
.Ic tenex |
.Ic tenex |
mode transfers. |
mode transfers. |
.Pp |
.Pp |
.Nm Ftp |
.Nm |
supports only the default values for the remaining |
supports only the default values for the remaining |
file transfer parameters: |
file transfer parameters: |
.Ic mode , |
.Ic mode , |
.Ic form , |
.Ic form , |
and |
and |
.Ic struct . |
.Ic struct . |
.Sh THE .netrc FILE |
.Sh THE .netrc FILE |
The |
The |
.Pa .netrc |
.Pa .netrc |
|
|
file for a |
file for a |
.Ic machine |
.Ic machine |
token that matches the remote machine specified on the |
token that matches the remote machine specified on the |
.Nm ftp |
.Nm |
command line or as an |
command line or as an |
.Ic open |
.Ic open |
command argument. |
command argument. |
|
|
file for any user other |
file for any user other |
than |
than |
.Ar anonymous , |
.Ar anonymous , |
.Nm ftp |
.Nm |
will abort the auto-login process if the |
will abort the auto-login process if the |
.Pa .netrc |
.Pa .netrc |
is readable by |
is readable by |
|
|
.It Ic macdef Ar name |
.It Ic macdef Ar name |
Define a macro. |
Define a macro. |
This token functions like the |
This token functions like the |
.Nm ftp |
.Nm |
.Ic macdef |
.Ic macdef |
command functions. |
command functions. |
A macro is defined with the specified name; its contents begin with the |
A macro is defined with the specified name; its contents begin with the |
|
|
is defined, it is automatically executed as the last step in the |
is defined, it is automatically executed as the last step in the |
auto-login process. |
auto-login process. |
.El |
.El |
|
.Sh COMMAND LINE EDITING |
|
.Nm |
|
supports interactive command line editing, via the |
|
.Xr editline 3 |
|
library. |
|
It is enabled with the |
|
.Ic edit |
|
command, and is enabled by default. |
|
Previous lines can be recalled and edited with the arrow keys, |
|
and other GNU Emacs-style editing keys may be used as well. |
|
.Pp |
|
The |
|
.Xr editline 3 |
|
library is configured with a |
|
.Pa .editrc |
|
file - refer to |
|
.Xr editrc 5 |
|
for more information. |
|
.Pp |
|
An extra key binding is available to |
|
.Nm |
|
to provide context sensitive command and filename completion |
|
(including remote file completion). |
|
To use this, bind a key to the |
|
.Xr editline 3 |
|
command |
|
.Ic ftp-complete . |
|
By default, this is bound to the TAB key. |
.Sh ENVIRONMENT |
.Sh ENVIRONMENT |
.Nm Ftp |
.Nm |
utilizes the following environment variables. |
utilizes the following environment variables. |
.Bl -tag -width Fl |
.Bl -tag -width "http_proxy" |
.It Ev HOME |
.It Ev HOME |
For default location of a |
For default location of a |
.Pa .netrc |
.Pa .netrc |
file, if one exists. |
file, if one exists. |
.It Ev SHELL |
.It Ev SHELL |
For default shell. |
For default shell. |
|
.It Ev http_proxy |
|
URL of HTTP proxy to use when making HTTP requests. |
.El |
.El |
.Sh SEE ALSO |
.Sh SEE ALSO |
|
.Xr editrc 5 , |
.Xr ftpd 8 |
.Xr ftpd 8 |
.Sh HISTORY |
.Sh HISTORY |
The |
The |
.Nm ftp |
.Nm |
command appeared in |
command appeared in |
.Bx 4.2 . |
.Bx 4.2 . |
|
.Pp |
|
Various features such as command line editing, context sensitive |
|
command and file completion, dynamic progress bar, automatic |
|
fetching of files, ftp and http URLs, and modification time |
|
preservation were implemented in |
|
.Nx 1.2b |
|
by Luke Mewburn, with assistance from Jason Thorpe. |
.Sh BUGS |
.Sh BUGS |
Correct execution of many commands depends upon proper behavior |
Correct execution of many commands depends upon proper behavior |
by the remote server. |
by the remote server. |