BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / ftp.0
FTP(1C) UNIX Programmer's Manual FTP(1C)
N\bNA\bAM\bME\bE
ftp - 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 ] [ h\bho\bos\bst\bt ]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bF_\bt_\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.
The client host with which _\bf_\bt_\bp is to communicate may be
specified on the command line. If this is done, _\bf_\bt_\bp will
immediately attempt to establish a connection to an FTP
server on that host; otherwise, _\bf_\bt_\bp will enter its command
interpreter and await instructions from the user. When _\bf_\bt_\bp
is awaiting commands from the user the prompt "ftp>" is pro-
vided to the user. The following commands are recognized by
_\bf_\bt_\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-_\bn_\ba_\bm_\be [ _\ba_\br_\bg_\bs ]
Execute the macro _\bm_\ba_\bc_\br_\bo-_\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-_\bf_\bi_\bl_\be [ _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be ]
Append a local file to a file on the remote machine.
If _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be is left unspecified, the local file name
is used in naming the remote file after being altered
by any _\bn_\bt_\br_\ba_\bn_\bs or _\bn_\bm_\ba_\bp setting. File transfer uses the
current settings for _\bt_\by_\bp_\be, _\bf_\bo_\br_\bm_\ba_\bt, _\bm_\bo_\bd_\be, and _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be.
a\bas\bsc\bci\bii\bi
Set the file transfer _\bt_\by_\bp_\be to network ASCII. This is
the default type.
b\bbe\bel\bll\bl Arrange that a bell be sounded after each file transfer
command is completed.
Printed 7/9/88 April 29, 1985 1
FTP(1C) UNIX Programmer's Manual FTP(1C)
b\bbi\bin\bna\bar\bry\by
Set the file transfer _\bt_\by_\bp_\be to support binary image
transfer.
b\bby\bye\be Terminate the FTP session with the remote server and
exit _\bf_\bt_\bp. An end of file will also terminate the ses-
sion 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-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
Change the working directory on the remote machine to
_\br_\be_\bm_\bo_\bt_\be-_\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\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
retrieval. 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-UNIX remote systems may contain single linefeeds;
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-_\bf_\bi_\bl_\be
Delete the file _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be on the remote machine.
d\bde\beb\bbu\bug\bg [ _\bd_\be_\bb_\bu_\bg-_\bv_\ba_\bl_\bu_\be ]
Toggle debugging mode. If an optional _\bd_\be_\bb_\bu_\bg-_\bv_\ba_\bl_\bu_\be is
specified it is used to set the debugging level. When
debugging is on, _\bf_\bt_\bp prints each command sent to the
remote machine, preceded by the string "-->".
d\bdi\bir\br [ _\br_\be_\bm_\bo_\bt_\be-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by ] [ _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be ]
Print a listing of the directory contents in the direc-
tory, _\br_\be_\bm_\bo_\bt_\be-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by, and, optionally, placing the
output in _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be. If interactive prompting is on,
_\bf_\bt_\bp will prompt the user to verify that the last argu-
ment is indeed the target local file for receiving d\bdi\bir\br
Printed 7/9/88 April 29, 1985 2
FTP(1C) UNIX Programmer's Manual FTP(1C)
output. If no directory is specified, the current
working directory on the remote machine is used. If no
local file is specified, or _\bl_\bo_\bc_\ba_\bl-_\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 c\bcl\blo\bos\bse\be.
f\bfo\bor\brm\bm _\bf_\bo_\br_\bm_\ba_\bt
Set the file transfer _\bf_\bo_\br_\bm to _\bf_\bo_\br_\bm_\ba_\bt. The default for-
mat is "file".
g\bge\bet\bt _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be [ _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be ]
Retrieve the _\br_\be_\bm_\bo_\bt_\be-_\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 _\bc_\ba_\bs_\be, _\bn_\bt_\br_\ba_\bn_\bs, and
_\bn_\bm_\ba_\bp settings. The current settings for _\bt_\by_\bp_\be, _\bf_\bo_\br_\bm,
_\bm_\bo_\bd_\be, and _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\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. Glob-
bing for m\bmp\bpu\but\bt is done as in c\bcs\bsh\bh(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
`m\bml\bls\bs _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be_\bs -\b-'. Note: m\bmg\bge\bet\bt and m\bmp\bpu\but\bt are not
meant to transfer entire directory subtrees of files.
That can be done by transferring a t\bta\bar\br(1) archive of
the subtree (in binary mode).
h\bha\bas\bsh\bh Toggle hash-sign (``#'') printing for each data block
transferred. 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_\b-
_\bm_\ba_\bn_\bd. If no argument is given, _\bf_\bt_\bp prints a list of
the known commands.
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-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by ] [ _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be ]
Print an abbreviated listing of the contents of a
directory on the remote machine. If _\br_\be_\bm_\bo_\bt_\be-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
Printed 7/9/88 April 29, 1985 3
FTP(1C) UNIX Programmer's Manual FTP(1C)
is left unspecified, the current working directory is
used. If interactive prompting is on, _\bf_\bt_\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-_\bf_\bi_\bl_\be is -\b-, the output is
sent to the terminal.
m\bma\bac\bcd\bde\bef\bf _\bm_\ba_\bc_\br_\bo-_\bn_\ba_\bm_\be
Define a macro. Subsequent lines are stored as the
macro _\bm_\ba_\bc_\br_\bo-_\bn_\ba_\bm_\be; a null line (consecutive newline
characters in a file or carriage returns from the ter-
minal) terminates macro input mode. There is a limit
of 16 macros and 4096 total characters in all defined
macros. Macros remain defined until a c\bcl\blo\bos\bse\be command is
executed. The macro processor interprets '$' 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 character. Use the '\'
to prevent special treatment of the '$'.
m\bmd\bde\bel\ble\bet\bte\be [ _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be_\bs ]
Delete the _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be_\bs on the remote machine.
m\bmd\bdi\bir\br _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be_\bs _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be
Like d\bdi\bir\br, except multiple remote files may be speci-
fied. If interactive prompting is on, _\bf_\bt_\bp will prompt
the user to verify 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-_\bf_\bi_\bl_\be_\bs
Expand the _\br_\be_\bm_\bo_\bt_\be-_\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 _\bc_\ba_\bs_\be, _\bn_\bt_\br_\ba_\bn_\bs,
and _\bn_\bm_\ba_\bp settings. Files are transferred into the
local working directory, which can be changed with
`l\blc\bcd\bd directory'; new local directories can be created
with `!\b! mkdir directory'.
m\bmk\bkd\bdi\bir\br _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by-_\bn_\ba_\bm_\be
Make a directory on the remote machine.
m\bml\bls\bs _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be_\bs _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be
Like l\bls\bs, except multiple remote files may be specified.
If interactive prompting is on, _\bf_\bt_\bp will prompt the
user to verify that the last argument is indeed the
Printed 7/9/88 April 29, 1985 4
FTP(1C) UNIX Programmer's Manual FTP(1C)
target local file for receiving m\bml\bls\bs output.
m\bmo\bod\bde\be [ _\bm_\bo_\bd_\be-_\bn_\ba_\bm_\be ]
Set the file transfer _\bm_\bo_\bd_\be to _\bm_\bo_\bd_\be-_\bn_\ba_\bm_\be. The default
mode is "stream" mode.
m\bmp\bpu\but\bt _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be_\bs
Expand wild cards in the list of local files given as
arguments 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 _\bn_\bt_\br_\ba_\bn_\bs and _\bn_\bm_\ba_\bp settings.
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 remote target filename. If argu-
ments are specified, local filenames are mapped during
m\bmg\bge\bet\bt commands and g\bge\bet\bt commands issued without a speci-
fied local target filename. This command is useful
when connecting to a non-UNIX remote computer with dif-
ferent file naming conventions or practices. The map-
ping follows the pattern set by _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn and _\bo_\bu_\bt_\bp_\ba_\bt_\b-
_\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 spe-
cial treatment of the '$' character. All other charac-
ters are treated literally, and are used to determine
the n\bnm\bma\bap\bp _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn variable values. For exmaple, 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 filename. The sequences '$1', '$2', ...., '$9'
are replaced by any value resulting from the _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn
template. The sequence '$0' is replace by the original
filename. Additionally, 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; other-
wise it is replaced by _\bs_\be_\bq_\b2. For example, the command
"nmap $1.$2.$3 [$1,$2].[$2,file]" would yield the out-
put filename "myfile.data" for input filenames
"myfile.data" and "myfile.data.old", "myfile.file" for
the input filename "myfile", and "myfile.myfile" for
the input 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 ] ]
Printed 7/9/88 April 29, 1985 5
FTP(1C) UNIX Programmer's Manual FTP(1C)
Set or unset the filename character translation mechan-
ism. If no arguments are specified, the filename char-
acter translation mechanism is unset. If arguments are
specified, characters in remote filenames are
translated during m\bmp\bpu\but\bt commands and p\bpu\but\bt commands issued
without a specified remote target filename. If argu-
ments are specified, characters in local filenames are
translated 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-UNIX remote
computer with different file naming conventions or
practices. Characters in a filename matching a charac-
ter 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, _\bf_\bt_\bp will attempt to contact an FTP server
at that port. If the _\ba_\bu_\bt_\bo-_\bl_\bo_\bg_\bi_\bn option is on
(default), _\bf_\bt_\bp will also attempt to automatically 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 selectively 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-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
Execute an ftp command on a secondary control connec-
tion. 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 secondary control connection.
Enter the command "proxy ?" to see other ftp commands
executable on the secondary connection. The following
commands behave differently when prefaced by p\bpr\bro\box\bxy\by:
o\bop\bpe\ben\bn will not define new macros during the auto-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
primary 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 depend upon support of the ftp
protocol PASV command by the server on the secondary
control connection.
Printed 7/9/88 April 29, 1985 6
FTP(1C) UNIX Programmer's Manual FTP(1C)
p\bpu\but\bt _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be [ _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be ]
Store a local file on the remote machine. If _\br_\be_\bm_\bo_\bt_\be-
_\bf_\bi_\bl_\be is left unspecified, the local file name is used
after processing according to any _\bn_\bt_\br_\ba_\bn_\bs or _\bn_\bm_\ba_\bp set-
tings in naming the remote file. File transfer uses
the current settings for _\bt_\by_\bp_\be, _\bf_\bo_\br_\bm_\ba_\bt, _\bm_\bo_\bd_\be, and _\bs_\bt_\br_\bu_\bc_\b-
_\bt_\bu_\br_\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 ...
The arguments specified are sent, verbatim, to the
remote FTP server.
r\bre\bec\bcv\bv _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be [ _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be ]
A synonym for get.
r\bre\bem\bmo\bot\bte\beh\bhe\bel\blp\bp [ _\bc_\bo_\bm_\bm_\ba_\bn_\bd-_\bn_\ba_\bm_\be ]
Request help from the remote FTP server. If a
_\bc_\bo_\bm_\bm_\ba_\bn_\bd-_\bn_\ba_\bm_\be is specified it is supplied to the server
as well.
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
command/reply sequencing with the remote ftp server.
Resynchronization may be neccesary following a viola-
tion of the ftp protocol by the remote server.
r\brm\bmd\bdi\bir\br _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by-_\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
filenames. 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 below).
The default value is off.
s\bse\ben\bnd\bd _\bl_\bo_\bc_\ba_\bl-_\bf_\bi_\bl_\be [ _\br_\be_\bm_\bo_\bt_\be-_\bf_\bi_\bl_\be ]
Printed 7/9/88 April 29, 1985 7
FTP(1C) UNIX Programmer's Manual FTP(1C)
A synonym for put.
s\bse\ben\bnd\bdp\bpo\bor\brt\bt
Toggle the use of PORT commands. By default, _\bf_\bt_\bp will
attempt to use a PORT command when establishing a con-
nection for each data transfer. The use of PORT com-
mands can prevent delays when performing multiple file
transfers. If the PORT command fails, _\bf_\bt_\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\bst\bta\bat\btu\bus\bs
Show the current status of _\bf_\bt_\bp.
s\bst\btr\bru\buc\bct\bt [ _\bs_\bt_\br_\bu_\bc_\bt-_\bn_\ba_\bm_\be ]
Set the file transfer _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be to _\bs_\bt_\br_\bu_\bc_\bt-_\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 proto-
col STOU command for successful completion. The remote
server will report unique name. Default value is off.
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-_\bn_\ba_\bm_\be ]
Set the file transfer _\bt_\by_\bp_\be to _\bt_\by_\bp_\be-_\bn_\ba_\bm_\be. If no type is
specified, the current type is printed. The default
type is network ASCII.
u\bus\bse\ber\br _\bu_\bs_\be_\br-_\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
password is not specified and the server requires it,
_\bf_\bt_\bp will prompt the user for it (after disabling local
echo). If an account field is not specified, and the
FTP server requires it, the user will be prompted for
it. If an account field is specified, an account com-
mand 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 _\bf_\bt_\bp is invoked
with "auto-login" disabled, this process is done
automatically on initial connection to the FTP server.
Printed 7/9/88 April 29, 1985 8
FTP(1C) UNIX Programmer's Manual FTP(1C)
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 verbose is on, when a file transfer com-
pletes, statistics regarding the efficiency of the
transfer are reported. By default, 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 server, and discarding
any further data received. The speed at which this is
accomplished depends upon the remote server's support for
ABOR processing. 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 _\bf_\bt_\bp
has completed 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 unex-
pected remote server behavior, the local _\bf_\bt_\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 _\bf_\bt_\bp commands are processed
according to the following rules.
1) If the file name "-" is specified, the s\bst\btd\bdi\bin\bn (for read-
ing) or s\bst\btd\bdo\bou\but\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. _\bF_\bt_\bp then forks a shell, using _\bp_\bo_\bp_\be_\bn(3) with
the argument supplied, and reads (writes) from the
stdout (stdin). If the shell command includes spaces,
the argument must be quoted; e.g. ""| ls -lt"". A par-
ticularly useful example 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 _\bc_\bs_\bh(1); c.f. the _\bg_\bl_\bo_\bb command. If the _\bf_\bt_\bp
Printed 7/9/88 April 29, 1985 9
FTP(1C) UNIX Programmer's Manual FTP(1C)
command expects a single local file ( .e.g. p\bpu\but\bt), only
the first filename generated by the "globbing" opera-
tion 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 altered 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 altered by a n\bnt\btr\bra\ban\bns\bs or n\bnm\bma\bap\bp set-
ting. 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 _\bt_\by_\bp_\be may be one of "ascii",
"image" (binary), "ebcdic", and "local byte size" (for PDP-
10's and PDP-20's mostly). _\bF_\bt_\bp supports the ascii and image
types of file transfer, plus local byte size 8 for t\bte\ben\bne\bex\bx
mode transfers.
_\bF_\bt_\bp supports only the default values for the remaining file
transfer parameters: _\bm_\bo_\bd_\be, _\bf_\bo_\br_\bm, and _\bs_\bt_\br_\bu_\bc_\bt.
O\bOP\bPT\bTI\bIO\bON\bNS\bS
Options may be specified at the command line, or to the com-
mand interpreter.
The -\b-v\bv (verbose on) option forces _\bf_\bt_\bp to show all responses
from the remote server, as well as report on data transfer
statistics.
The -\b-n\bn option restrains _\bf_\bt_\bp from attempting "auto-login"
upon initial connection. If auto-login is enabled, _\bf_\bt_\bp will
check the ._\bn_\be_\bt_\br_\bc (see below) file in the user's home direc-
tory for an entry describing an account on the remote
machine. If no entry exists, _\bf_\bt_\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.
The -\b-i\bi option turns off interactive prompting during multi-
ple file transfers.
The -\b-d\bd option enables debugging.
The -\b-g\bg option disables file name globbing.
Printed 7/9/88 April 29, 1985 10
FTP(1C) UNIX Programmer's Manual FTP(1C)
T\bTH\bHE\bE .\b.n\bne\bet\btr\brc\bc F\bFI\bIL\bLE\bE
The .netrc file contains login and initialization informa-
tion used by the auto-login process. It resides in the
user's home directory. The following 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 name. The auto-login process
searches the .netrc file for a m\bma\bac\bch\bhi\bin\bne\be token that
matches the remote machine specified on the _\bf_\bt_\bp command
line or as an o\bop\bpe\ben\bn command argument. Once a match is
made, the subsequent .netrc tokens are processed, stop-
ping when the end of file is reached or another m\bma\bac\bch\bhi\bin\bne\be
token is encountered.
l\blo\bog\bgi\bin\bn _\bn_\ba_\bm_\be
Identify a user on the remote machine. If this token
is present, the auto-login process will initiate a
login using the specified name.
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 .netrc file, _\bf_\bt_\bp will abort the auto-login process
if the .netrc 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 present, the auto-login process will supply the
specified string if the remote server requires an addi-
tional 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 _\bf_\bt_\bp m\bma\bac\bc-\b-
d\bde\bef\bf command functions. A macro is defined with the
specified name; its contents begin with the next .netrc
line and continue until a null line (consecutive new-
line characters) is encountered. If a macro named _\bi_\bn_\bi_\bt
is defined, it is automatically executed as the last
step in the auto-login process.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
ftpd(8)
B\bBU\bUG\bGS\bS
Correct execution of many commands depends upon proper
behavior by the remote server.
Printed 7/9/88 April 29, 1985 11
FTP(1C) UNIX Programmer's Manual FTP(1C)
An error in the treatment of carriage returns in the 4.2BSD
UNIX ascii-mode transfer code has been corrected. This
correction may result in incorrect transfers of binary files
to and from 4.2BSD servers using the ascii type. Avoid this
problem by using the binary image type.
Printed 7/9/88 April 29, 1985 12