BSD 4_4 development
[unix-history] / usr / share / man / cat1 / ftp.0
FTP(1) BSD Reference Manual FTP(1)
N\bNA\bAM\bME\bE
f\bft\btp\bp - ARPANET file transfer program
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
f\bft\btp\bp [-\b-v\bv] [-\b-d\bd] [-\b-i\bi] [-\b-n\bn] [-\b-g\bg] [_\bh_\bo_\bs_\bt]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
F\bFt\btp\bp is the user interface to the ARPANET standard File Transfer Protocol.
The program allows a user to transfer files to and from a remote network
site.
Options may be specified at the command line, or to the command inter-
preter.
-\b-v\bv Verbose option forces f\bft\btp\bp to show all responses from the remote
server, as well as report on data transfer statistics.
-\b-n\bn Restrains f\bft\btp\bp from attempting ``auto-login'' upon initial connec-
tion. If auto-login is enabled, f\bft\btp\bp will check the _\b._\bn_\be_\bt_\br_\bc (see be-
low) file in the user's home directory for an entry describing an
account on the remote machine. If no entry exists, f\bft\btp\bp will prompt
for the remote machine login name (default is the user identity on
the local machine), and, if necessary, prompt for a password and an
account with which to login.
-\b-i\bi Turns off interactive prompting during multiple file transfers.
-\b-d\bd Enables debugging.
-\b-g\bg Disables file name globbing.
The client host with which f\bft\btp\bp is to communicate may be specified on the
command line. If this is done, f\bft\btp\bp will immediately attempt to establish
a connection to an FTP server on that host; otherwise, f\bft\btp\bp will enter its
command interpreter and await instructions from the user. When f\bft\btp\bp is
awaiting commands from the user the prompt `ftp>' is provided to the us-
er. The following commands are recognized by f\bft\btp\bp:
!\b! [_\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\ba_\br_\bg_\bs]]
Invoke an interactive shell on the local machine. If there
are arguments, the first is taken to be a command to execute
directly, with the rest of the arguments as its arguments.
$\b$ _\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bs]
Execute the macro _\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be that was defined with the m\bma\bac\bcd\bde\bef\bf
command. Arguments are passed to the macro unglobbed.
a\bac\bcc\bco\bou\bun\bnt\bt [_\bp_\ba_\bs_\bs_\bw_\bd]
Supply a supplemental password required by a remote system
for access to resources once a login has been successfully
completed. If no argument is included, the user will be
prompted for an account password in a non-echoing input mode.
a\bap\bpp\bpe\ben\bnd\bd _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be]
Append a local file to a file on the remote machine. If
_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be is left unspecified, the local file name is used
in naming the remote file after being altered by any n\bnt\btr\bra\ban\bns\bs
or n\bnm\bma\bap\bp setting. File transfer uses the current settings for
t\bty\byp\bpe\be, f\bfo\bor\brm\bma\bat\bt, m\bmo\bod\bde\be, and s\bst\btr\bru\buc\bct\btu\bur\bre\be.
a\bas\bsc\bci\bii\bi Set the file transfer t\bty\byp\bpe\be to network ASCII. This is the de-
fault type.
b\bbe\bel\bll\bl Arrange that a bell be sounded after each file transfer com-
mand is completed.
b\bbi\bin\bna\bar\bry\by Set the file transfer t\bty\byp\bpe\be to support binary image transfer.
b\bby\bye\be Terminate the FTP session with the remote server and exit
f\bft\btp\bp. An end of file will also terminate the session and exit.
c\bca\bas\bse\be Toggle remote computer file name case mapping during m\bmg\bge\bet\bt
commands. When c\bca\bas\bse\be is on (default is off), remote computer
file names with all letters in upper case are written in the
local directory with the letters mapped to lower case.
c\bcd\bd _\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
Change the working directory on the remote machine to _\br_\be_\bm_\bo_\bt_\be_\b-
_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by.
c\bcd\bdu\bup\bp Change the remote machine working directory to the parent of
the current remote machine working directory.
c\bch\bhm\bmo\bod\bd _\bm_\bo_\bd_\be _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
Change the permission modes of the file _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be on the re-
mote sytem to _\bm_\bo_\bd_\be.
c\bcl\blo\bos\bse\be Terminate the FTP session with the remote server, and return
to the command interpreter. Any defined macros are erased.
c\bcr\br Toggle carriage return stripping during ascii type file re-
trieval. Records are denoted by a carriage return/linefeed
sequence during ascii type file transfer. When c\bcr\br is on (the
default), carriage returns are stripped from this sequence to
conform with the UNIX single linefeed record delimiter.
Records on non-Ux remote systems may contain single line-
feeds; when an ascii type transfer is made, these linefeeds
may be distinguished from a record delimiter only when c\bcr\br is
off.
d\bde\bel\ble\bet\bte\be _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be
Delete the file _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be on the remote machine.
d\bde\beb\bbu\bug\bg [_\bd_\be_\bb_\bu_\bg_\b-_\bv_\ba_\bl_\bu_\be]
Toggle debugging mode. If an optional _\bd_\be_\bb_\bu_\bg_\b-_\bv_\ba_\bl_\bu_\be is speci-
fied it is used to set the debugging level. When debugging
is on, f\bft\btp\bp prints each command sent to the remote machine,
preceded by the string `-->'
d\bdi\bir\br [_\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
Print a listing of the directory contents in the directory,
_\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by, and, optionally, placing the output in
_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be. If interactive prompting is on, f\bft\btp\bp will prompt
the user to verify that the last argument is indeed the tar-
get local file for receiving d\bdi\bir\br output. If no directory is
specified, the current working directory on the remote ma-
chine is used. If no local file is specified, or _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
is -\b-, output comes to the terminal.
d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt A synonym for _\bc_\bl_\bo_\bs_\be.
f\bfo\bor\brm\bm _\bf_\bo_\br_\bm_\ba_\bt
Set the file transfer f\bfo\bor\brm\bm to _\bf_\bo_\br_\bm_\ba_\bt. The default format is
``file''.
g\bge\bet\bt _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
Retrieve the _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be and store it on the local machine.
If the local file name is not specified, it is given the same
name it has on the remote machine, subject to alteration by
the current c\bca\bas\bse\be, n\bnt\btr\bra\ban\bns\bs, and n\bnm\bma\bap\bp settings. The current
settings for t\bty\byp\bpe\be, f\bfo\bor\brm\bm, m\bmo\bod\bde\be, and s\bst\btr\bru\buc\bct\btu\bur\bre\be are used while
transferring the file.
g\bgl\blo\bob\bb Toggle filename expansion for m\bmd\bde\bel\ble\bet\bte\be, m\bmg\bge\bet\bt and m\bmp\bpu\but\bt. If
globbing is turned off with g\bgl\blo\bob\bb, the file name arguments are
taken literally and not expanded. Globbing for m\bmp\bpu\but\bt is done
as in csh(1). For m\bmd\bde\bel\ble\bet\bte\be and m\bmg\bge\bet\bt, each remote file name is
expanded separately on the remote machine and the lists are
not merged. Expansion of a directory name is likely to be
different from expansion of the name of an ordinary file: the
exact result depends on the foreign operating system and ftp
server, and can be previewed by doing `mls remote-files -'
Note: m\bmg\bge\bet\bt and m\bmp\bpu\but\bt are not meant to transfer entire directo-
ry subtrees of files. That can be done by transferring a
tar(1) archive of the subtree (in binary mode).
h\bha\bas\bsh\bh Toggle hash-sign (``#'') printing for each data block trans-
ferred. The size of a data block is 1024 bytes.
h\bhe\bel\blp\bp [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
Print an informative message about the meaning of _\bc_\bo_\bm_\bm_\ba_\bn_\bd. If
no argument is given, f\bft\btp\bp prints a list of the known com-
mands.
i\bid\bdl\ble\be [_\bs_\be_\bc_\bo_\bn_\bd_\bs]
Set the inactivity timer on the remote server to _\bs_\be_\bc_\bo_\bn_\bd_\bs sec-
onds. If _\bs_\be_\bc_\bo_\bn_\bd_\bs is ommitted, the current inactivity timer
is printed.
l\blc\bcd\bd [_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by]
Change the working directory on the local machine. If no
_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by is specified, the user's home directory is used.
l\bls\bs [_\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
Print a listing of the contents of a directory on the remote
machine. The listing includes any system-dependent informa-
tion that the server chooses to include; for example, most
UNIX systems will produce output from the command `ls -l'.
(See also n\bnl\bli\bis\bst\bt.) If _\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by is left unspecified,
the current working directory is used. If interactive
prompting is on, f\bft\btp\bp will prompt the user to verify that the
last argument is indeed the target local file for receiving
l\bls\bs output. If no local file is specified, or if _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
is `-\b-', the output is sent to the terminal.
m\bma\bac\bcd\bde\bef\bfN\bNs\bs _\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be
Define a macro. Subsequent lines are stored as the macro
_\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be; a null line (consecutive newline characters in a
file or carriage returns from the terminal) terminates macro
input mode. There is a limit of 16 macros and 4096 total
characters in all defined macros. Macros remain defined un-
til a c\bcl\blo\bos\bse\be command is executed. The macro processor inter-
prets `$' and `\' as special characters. A `$' followed by a
number (or numbers) is replaced by the corresponding argument
on the macro invocation command line. A `$' followed by an
`i' signals that macro processor that the executing macro is
to be looped. On the first pass `$i' is replaced by the
first argument on the macro invocation command line, on the
second pass it is replaced by the second argument, and so on.
A `\' followed by any character is replaced by that charac-
ter. Use the `\' to prevent special treatment of the `$'.
m\bmd\bde\bel\ble\bet\bte\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs]
Delete the _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs on the remote machine.
m\bmd\bdi\bir\br _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
Like d\bdi\bir\br, except multiple remote files may be specified. If
interactive prompting is on, f\bft\btp\bp will prompt the user to ver-
ify that the last argument is indeed the target local file
for receiving m\bmd\bdi\bir\br output.
m\bmg\bge\bet\bt _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs
Expand the _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs on the remote machine and do a g\bge\bet\bt
for each file name thus produced. See g\bgl\blo\bob\bb for details on
the filename expansion. Resulting file names will then be
processed according to c\bca\bas\bse\be, n\bnt\btr\bra\ban\bns\bs, and n\bnm\bma\bap\bp settings.
Files are transferred into the local working directory, which
can be changed with `lcd directory'; new local directories
can be created with `! mkdir directory'.
m\bmk\bkd\bdi\bir\br _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by_\b-_\bn_\ba_\bm_\be
Make a directory on the remote machine.
m\bml\bls\bs _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
Like n\bnl\bli\bis\bst\bt, except multiple remote files may be specified,
and the _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be must be specified. If interactive prompt-
ing is on, f\bft\btp\bp will prompt the user to verify that the last
argument is indeed the target local file for receiving m\bml\bls\bs
output.
m\bmo\bod\bde\be [_\bm_\bo_\bd_\be_\b-_\bn_\ba_\bm_\be]
Set the file transfer m\bmo\bod\bde\be to _\bm_\bo_\bd_\be_\b-_\bn_\ba_\bm_\be. The default mode is
``stream'' mode.
m\bmo\bod\bdt\bti\bim\bme\be _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
Show the last modification time of the file on the remote ma-
chine.
m\bmp\bpu\but\bt _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be_\bs
Expand wild cards in the list of local files given as argu-
ments and do a p\bpu\but\bt for each file in the resulting list. See
g\bgl\blo\bob\bb for details of filename expansion. Resulting file names
will then be processed according to n\bnt\btr\bra\ban\bns\bs and n\bnm\bma\bap\bp settings.
n\bne\bew\bwe\ber\br _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
Get the file only if the modification time of the remote file
is more recent that the file on the current system. If the
file does not exist on the current system, the remote file is
considered n\bne\bew\bwe\ber\br. Otherwise, this command is identical to
_\bg_\be_\bt.
n\bnl\bli\bis\bst\bt [_\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
Print a list of the files in a directory on the remote ma-
chine. If _\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by is left unspecified, the current
working directory is used. If interactive prompting is on,
f\bft\btp\bp will prompt the user to verify that the last argument is
indeed the target local file for receiving n\bnl\bli\bis\bst\bt output. If
no local file is specified, or if _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be is -\b-, the output
is sent to the terminal.
n\bnm\bma\bap\bp [_\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn _\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn]
Set or unset the filename mapping mechanism. If no arguments
are specified, the filename mapping mechanism is unset. If
arguments are specified, remote filenames are mapped during
m\bmp\bpu\but\bt commands and p\bpu\but\bt commands issued without a specified re-
mote target filename. If arguments are specified, local
filenames are mapped during m\bmg\bge\bet\bt commands and g\bge\bet\bt commands
issued without a specified local target filename. This com-
mand is useful when connecting to a non-Ux remote computer
with different file naming conventions or practices. The
mapping follows the pattern set by _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn and _\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn.
[_\bI_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn] is a template for incoming filenames (which may
have already been processed according to the n\bnt\btr\bra\ban\bns\bs and c\bca\bas\bse\be
settings). Variable templating is accomplished by including
the sequences `$1', `$2', ..., `$9' in _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn. Use `\' to
prevent this special treatment of the `$' character. All
other characters are treated literally, and are used to de-
termine the n\bnm\bma\bap\bp [_\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn] variable values. For example,
given _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn $1.$2 and the remote file name "mydata.data",
$1 would have the value "mydata", and $2 would have the value
"data". The _\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn determines the resulting mapped file-
name. The sequences `$1', `$2', ...., `$9' are replaced by
any value resulting from the _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn template. The se-
quence `$0' is replace by the original filename. Additional-
ly, the sequence `[_\bs_\be_\bq_\b1, _\bs_\be_\bq_\b2]' is replaced by [_\bs_\be_\bq_\b1] if _\bs_\be_\bq_\b1
is not a null string; otherwise it is replaced by _\bs_\be_\bq_\b2. For
example, the command
nmap $1.$2.$3 [$1,$2].[$2,file]
would yield the output filename "myfile.data" for input file-
names "myfile.data" and "myfile.data.old", "myfile.file" for
the input filename "myfile", and "myfile.myfile" for the in-
put filename ".myfile". Spaces may be included in
_\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn, as in the example: `nmap $1 sed "s/ *$//" > $1'
. Use the `\' character to prevent special treatment of the
`$','[','[', and `,' characters.
n\bnt\btr\bra\ban\bns\bs [_\bi_\bn_\bc_\bh_\ba_\br_\bs [_\bo_\bu_\bt_\bc_\bh_\ba_\br_\bs]]
Set or unset the filename character translation mechanism.
If no arguments are specified, the filename character trans-
lation mechanism is unset. If arguments are specified, char-
acters in remote filenames are translated during m\bmp\bpu\but\bt com-
mands and p\bpu\but\bt commands issued without a specified remote tar-
get filename. If arguments are specified, characters in lo-
cal filenames are translated during m\bmg\bge\bet\bt commands and g\bge\bet\bt
commands issued without a specified local target filename.
This command is useful when connecting to a non-Ux remote
computer with different file naming conventions or practices.
Characters in a filename matching a character in _\bi_\bn_\bc_\bh_\ba_\br_\bs are
replaced with the corresponding character in _\bo_\bu_\bt_\bc_\bh_\ba_\br_\bs. If the
character's position in _\bi_\bn_\bc_\bh_\ba_\br_\bs is longer than the length of
_\bo_\bu_\bt_\bc_\bh_\ba_\br_\bs, the character is deleted from the file name.
o\bop\bpe\ben\bn _\bh_\bo_\bs_\bt [_\bp_\bo_\br_\bt]
Establish a connection to the specified _\bh_\bo_\bs_\bt FTP server. An
optional port number may be supplied, in which case, f\bft\btp\bp will
attempt to contact an FTP server at that port. If the a\bau\but\bto\bo-\b-
l\blo\bog\bgi\bin\bn option is on (default), f\bft\btp\bp will also attempt to auto-
matically log the user in to the FTP server (see below).
p\bpr\bro\bom\bmp\bpt\bt Toggle interactive prompting. Interactive prompting occurs
during multiple file transfers to allow the user to selec-
tively retrieve or store files. If prompting is turned off
(default is on), any m\bmg\bge\bet\bt or m\bmp\bpu\but\bt will transfer all files,
and any m\bmd\bde\bel\ble\bet\bte\be will delete all files.
p\bpr\bro\box\bxy\by _\bf_\bt_\bp_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
Execute an ftp command on a secondary control connection.
This command allows simultaneous connection to two remote ftp
servers for transferring files between the two servers. The
first p\bpr\bro\box\bxy\by command should be an o\bop\bpe\ben\bn, to establish the sec-
ondary control connection. Enter the command "proxy ?" to
see other ftp commands executable on the secondary connec-
tion. The following commands behave differently when pref-
aced by p\bpr\bro\box\bxy\by: o\bop\bpe\ben\bn will not define new macros during the au-
to-login process, c\bcl\blo\bos\bse\be will not erase existing macro defini-
tions, g\bge\bet\bt and m\bmg\bge\bet\bt transfer files from the host on the pri-
mary control connection to the host on the secondary control
connection, and p\bpu\but\bt, m\bmp\bpu\but\bt, and a\bap\bpp\bpe\ben\bnd\bd transfer files from the
host on the secondary control connection to the host on the
primary control connection. Third party file transfers de-
pend upon support of the ftp protocol PASV command by the
server on the secondary control connection.
p\bpu\but\bt _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be]
Store a local file on the remote machine. If _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be is
left unspecified, the local file name is used after process-
ing according to any n\bnt\btr\bra\ban\bns\bs or n\bnm\bma\bap\bp settings in naming the
remote file. File transfer uses the current settings for
t\bty\byp\bpe\be, f\bfo\bor\brm\bma\bat\bt, m\bmo\bod\bde\be, and s\bst\btr\bru\buc\bct\btu\bur\bre\be.
p\bpw\bwd\bd Print the name of the current working directory on the remote
machine.
q\bqu\bui\bit\bt A synonym for b\bby\bye\be.
q\bqu\buo\bot\bte\be _\ba_\br_\bg_\b1 _\ba_\br_\bg_\b2 _\b._\b._\b.
The arguments specified are sent, verbatim, to the remote FTP
server.
r\bre\bec\bcv\bv _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
A synonym for get.
r\bre\beg\bge\bet\bt _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
Reget acts like get, except that if _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be exists and is
smaller than _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be, _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be is presumed to be a par-
tially transferred copy of _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be and the transfer is
continued from the apparent point of failure. This command
is useful when transferring very large files over networks
that are prone to dropping connections.
r\bre\bem\bmo\bot\bte\beh\bhe\bel\blp\bp [_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b-_\bn_\ba_\bm_\be]
Request help from the remote FTP server. If a _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b-_\bn_\ba_\bm_\be
is specified it is supplied to the server as well.
r\bre\bem\bmo\bot\bte\bes\bst\bta\bat\btu\bus\bs [_\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be]
With no arguments, show status of remote machine. If _\bf_\bi_\bl_\be_\b-
_\bn_\ba_\bm_\be is specified, show status of _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be on remote ma-
chine.
r\bre\ben\bna\bam\bme\be [_\bf_\br_\bo_\bm] [_\bt_\bo]
Rename the file _\bf_\br_\bo_\bm on the remote machine, to the file _\bt_\bo.
r\bre\bes\bse\bet\bt Clear reply queue. This command re-synchronizes com-
mand/reply sequencing with the remote ftp server. Resynchro-
nization may be necessary following a violation of the ftp
protocol by the remote server.
r\bre\bes\bst\bta\bar\brt\bt _\bm_\ba_\br_\bk_\be_\br
Restart the immediately following g\bge\bet\bt or p\bpu\but\bt at the indicated
_\bm_\ba_\br_\bk_\be_\br. On UNIX systems, marker is usually a byte offset into
the file.
r\brm\bmd\bdi\bir\br _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by_\b-_\bn_\ba_\bm_\be
Delete a directory on the remote machine.
r\bru\bun\bni\biq\bqu\bue\be Toggle storing of files on the local system with unique file-
names. If a file already exists with a name equal to the
target local filename for a g\bge\bet\bt or m\bmg\bge\bet\bt command, a ".1" is
appended to the name. If the resulting name matches another
existing file, a ".2" is appended to the original name. If
this process continues up to ".99", an error message is
printed, and the transfer does not take place. The generated
unique filename will be reported. Note that r\bru\bun\bni\biq\bqu\bue\be will not
affect local files generated from a shell command (see be-
low). The default value is off.
s\bse\ben\bnd\bd _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be]
A synonym for put.
s\bse\ben\bnd\bdp\bpo\bor\brt\bt Toggle the use of PORT commands. By default, f\bft\btp\bp will at-
tempt to use a PORT command when establishing a connection
for each data transfer. The use of PORT commands can prevent
delays when performing multiple file transfers. If the PORT
command fails, f\bft\btp\bp will use the default data port. When the
use of PORT commands is disabled, no attempt will be made to
use PORT commands for each data transfer. This is useful for
certain FTP implementations which do ignore PORT commands
but, incorrectly, indicate they've been accepted.
s\bsi\bit\bte\be _\ba_\br_\bg_\b1 _\ba_\br_\bg_\b2 _\b._\b._\b.
The arguments specified are sent, verbatim, to the remote FTP
server as a SITE command.
s\bsi\biz\bze\be _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
Return size of _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be on remote machine.
s\bst\bta\bat\btu\bus\bs Show the current status of f\bft\btp\bp.
s\bst\btr\bru\buc\bct\bt [_\bs_\bt_\br_\bu_\bc_\bt_\b-_\bn_\ba_\bm_\be]
Set the file transfer _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be to _\bs_\bt_\br_\bu_\bc_\bt_\b-_\bn_\ba_\bm_\be. By default
``stream'' structure is used.
s\bsu\bun\bni\biq\bqu\bue\be Toggle storing of files on remote machine under unique file
names. Remote ftp server must support ftp protocol STOU com-
mand for successful completion. The remote server will re-
port unique name. Default value is off.
s\bsy\bys\bst\bte\bem\bm Show the type of operating system running on the remote ma-
chine.
t\bte\ben\bne\bex\bx Set the file transfer type to that needed to talk to TENEX
machines.
t\btr\bra\bac\bce\be Toggle packet tracing.
t\bty\byp\bpe\be [_\bt_\by_\bp_\be_\b-_\bn_\ba_\bm_\be]
Set the file transfer t\bty\byp\bpe\be to _\bt_\by_\bp_\be_\b-_\bn_\ba_\bm_\be. If no type is speci-
fied, the current type is printed. The default type is net-
work ASCII.
u\bum\bma\bas\bsk\bk [_\bn_\be_\bw_\bm_\ba_\bs_\bk]
Set the default umask on the remote server to _\bn_\be_\bw_\bm_\ba_\bs_\bk. If
_\bn_\be_\bw_\bm_\ba_\bs_\bk is ommitted, the current umask is printed.
u\bus\bse\ber\br _\bu_\bs_\be_\br_\b-_\bn_\ba_\bm_\be [_\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd] [_\ba_\bc_\bc_\bo_\bu_\bn_\bt]
Identify yourself to the remote FTP server. If the _\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd
is not specified and the server requires it, f\bft\btp\bp will prompt
the user for it (after disabling local echo). If an _\ba_\bc_\bc_\bo_\bu_\bn_\bt
field is not specified, and the FTP server requires it, the
user will be prompted for it. If an _\ba_\bc_\bc_\bo_\bu_\bn_\bt field is speci-
fied, an account command will be relayed to the remote server
after the login sequence is completed if the remote server
did not require it for logging in. Unless f\bft\btp\bp is invoked
with ``auto-login'' disabled, this process is done automati-
cally on initial connection to the FTP server.
v\bve\ber\brb\bbo\bos\bse\be Toggle verbose mode. In verbose mode, all responses from the
FTP server are displayed to the user. In addition, if ver-
bose is on, when a file transfer completes, statistics re-
garding the efficiency of the transfer are reported. By de-
fault, verbose is on.
?\b? [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
A synonym for help.
Command arguments which have embedded spaces may be quoted with quote `"'
marks.
A\bAB\bBO\bOR\bRT\bTI\bIN\bNG\bG A\bA F\bFI\bIL\bLE\bE T\bTR\bRA\bAN\bNS\bSF\bFE\bER\bR
To abort a file transfer, use the terminal interrupt key (usually Ctrl-
C). Sending transfers will be immediately halted. Receiving transfers
will be halted by sending a ftp protocol ABOR command to the remote serv-
er, and discarding any further data received. The speed at which this is
accomplished depends upon the remote server's support for ABOR process-
ing. If the remote server does not support the ABOR command, an `ftp>'
prompt will not appear until the remote server has completed sending the
requested file.
The terminal interrupt key sequence will be ignored when f\bft\btp\bp has complet-
ed any local processing and is awaiting a reply from the remote server.
A long delay in this mode may result from the ABOR processing described
above, or from unexpected behavior by the remote server, including viola-
tions of the ftp protocol. If the delay results from unexpected remote
server behavior, the local f\bft\btp\bp program must be killed by hand.
F\bFI\bIL\bLE\bE N\bNA\bAM\bMI\bIN\bNG\bG C\bCO\bON\bNV\bVE\bEN\bNT\bTI\bIO\bON\bNS\bS
Files specified as arguments to f\bft\btp\bp commands are processed according to
the following rules.
1. If the file name `-\b-' is specified, the _\bs_\bt_\bd_\bi_\bn (for reading) or _\bs_\bt_\bd_\bo_\bu_\bt
(for writing) is used.
2. If the first character of the file name is `|', the remainder of the
argument is interpreted as a shell command. F\bFt\btp\bp then forks a shell,
using popen(3) with the argument supplied, and reads (writes) from
the stdout (stdin). If the shell command includes spaces, the argu-
ment must be quoted; e.g. ``" ls -lt"''. A particularly useful ex-
ample of this mechanism is: ``dir more''.
3. Failing the above checks, if ``globbing'' is enabled, local file
names are expanded according to the rules used in the csh(1); c.f.
the g\bgl\blo\bob\bb command. If the f\bft\btp\bp command expects a single local file
(.e.g. p\bpu\but\bt), only the first filename generated by the "globbing"
operation is used.
4. For m\bmg\bge\bet\bt commands and g\bge\bet\bt commands with unspecified local file
names, the local filename is the remote filename, which may be al-
tered by a c\bca\bas\bse\be, n\bnt\btr\bra\ban\bns\bs, or n\bnm\bma\bap\bp setting. The resulting filename
may then be altered if r\bru\bun\bni\biq\bqu\bue\be is on.
5. For m\bmp\bpu\but\bt commands and p\bpu\but\bt commands with unspecified remote file
names, the remote filename is the local filename, which may be al-
tered by a n\bnt\btr\bra\ban\bns\bs or n\bnm\bma\bap\bp setting. The resulting filename may then
be altered by the remote server if s\bsu\bun\bni\biq\bqu\bue\be is on.
F\bFI\bIL\bLE\bE T\bTR\bRA\bAN\bNS\bSF\bFE\bER\bR P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
The FTP specification specifies many parameters which may affect a file
transfer. The t\bty\byp\bpe\be may be one of ``ascii'', ``image'' (binary),
``ebcdic'', and ``local byte size'' (for PDP-10's and PDP-20's mostly).
F\bFt\btp\bp supports the ascii and image types of file transfer, plus local byte
size 8 for t\bte\ben\bne\bex\bx mode transfers.
F\bFt\btp\bp supports only the default values for the remaining file transfer pa-
rameters: m\bmo\bod\bde\be, f\bfo\bor\brm\bm, and s\bst\btr\bru\buc\bct\bt.
T\bTH\bHE\bE .\b.n\bne\bet\btr\brc\bc F\bFI\bIL\bLE\bE
The _\b._\bn_\be_\bt_\br_\bc file contains login and initialization information used by the
auto-login process. It resides in the user's home directory. The fol-
lowing tokens are recognized; they may be separated by spaces, tabs, or
new-lines:
m\bma\bac\bch\bhi\bin\bne\be _\bn_\ba_\bm_\be
Identify a remote machine _\bn_\ba_\bm_\be. The auto-login process searches
the _\b._\bn_\be_\bt_\br_\bc file for a m\bma\bac\bch\bhi\bin\bne\be token that matches the remote ma-
chine specified on the f\bft\btp\bp command line or as an o\bop\bpe\ben\bn command
argument. Once a match is made, the subsequent _\b._\bn_\be_\bt_\br_\bc tokens
are processed, stopping when the end of file is reached or an-
other m\bma\bac\bch\bhi\bin\bne\be or a d\bde\bef\bfa\bau\bul\blt\bt token is encountered.
d\bde\bef\bfa\bau\bul\blt\bt This is the same as m\bma\bac\bch\bhi\bin\bne\be _\bn_\ba_\bm_\be except that d\bde\bef\bfa\bau\bul\blt\bt matches
any name. There can be only one d\bde\bef\bfa\bau\bul\blt\bt token, and it must be
after all m\bma\bac\bch\bhi\bin\bne\be tokens. This is normally used as:
default login anonymous password user@site
thereby giving the user _\ba_\bu_\bt_\bo_\bm_\ba_\bt_\bi_\bc anonymous ftp login to ma-
chines not specified in _\b._\bn_\be_\bt_\br_\bc. This can be overridden by using
the -\b-n\bn flag to disable auto-login.
l\blo\bog\bgi\bin\bn _\bn_\ba_\bm_\be
Identify a user on the remote machine. If this token is pre-
sent, the auto-login process will initiate a login using the
specified _\bn_\ba_\bm_\be.
p\bpa\bas\bss\bsw\bwo\bor\brd\bd _\bs_\bt_\br_\bi_\bn_\bg
Supply a password. If this token is present, the auto-login
process will supply the specified string if the remote server
requires a password as part of the login process. Note that if
this token is present in the _\b._\bn_\be_\bt_\br_\bc file for any user other
than _\ba_\bn_\bo_\bn_\by_\bm_\bo_\bu_\bs, f\bft\btp\bp will abort the auto-login process if the
_\b._\bn_\be_\bt_\br_\bc is readable by anyone besides the user.
a\bac\bcc\bco\bou\bun\bnt\bt _\bs_\bt_\br_\bi_\bn_\bg
Supply an additional account password. If this token is pre-
sent, the auto-login process will supply the specified string
if the remote server requires an additional account password,
or the auto-login process will initiate an ACCT command if it
does not.
m\bma\bac\bcd\bde\bef\bf _\bn_\ba_\bm_\be
Define a macro. This token functions like the f\bft\btp\bp m\bma\bac\bcd\bde\bef\bf com-
mand functions. A macro is defined with the specified name;
its contents begin with the next _\b._\bn_\be_\bt_\br_\bc line and continue until
a null line (consecutive new-line characters) is encountered.
If a macro named i\bin\bni\bit\bt is defined, it is automatically executed
as the last step in the auto-login process.
E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
F\bFt\btp\bp utilizes the following environment variables.
HOME For default location of a _\b._\bn_\be_\bt_\br_\bc file, if one exists.
SHELL For default shell.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
ftpd(8)
H\bHI\bIS\bST\bTO\bOR\bRY\bY
The f\bft\btp\bp command appeared in 4.2BSD.
B\bBU\bUG\bGS\bS
Correct execution of many commands depends upon proper behavior by the
remote server.
An error in the treatment of carriage returns in the 4.2BSD ascii-mode
transfer code has been corrected. This correction may result in incor-
rect transfers of binary files to and from 4.2BSD servers using the ascii
type. Avoid this problem by using the binary image type.
4.2 Berkeley Distribution June 6, 1993 10