[1mSYNOPSIS[0m
[1mftp [22m[[1m-v[22m] [[1m-d[22m] [[1m-i[22m] [[1m-n[22m] [[1m-g[22m] [[1m-k [4m[22mrealm[24m] [[1m-f[22m] [[1m-x[22m] [[1m-u[22m] [[1m-t[22m] [[4mhost[24m]
[1mDESCRIPTION[0m
[1mFTP [22mis the user interface to the ARPANET standard File Transfer Proto-
col. The program allows a user to transfer files to and from a remote
network site.
[1mOPTIONS[0m
Options may be specified at the command line, or to the command inter-
preter.
[1m-v [22mVerbose option forces [1mftp [22mto show all responses from the remote
server, as well as report on data transfer statistics.
[1m-n [22mRestrains [1mftp [22mfrom attempting ``auto-login'' upon initial con-
nection. If auto-login is enabled, [1mftp [22mwill check the [4m.netrc[0m
(see below) file in the user's home directory for an entry
describing an account on the remote machine. If no entry
exists, [1mftp [22mwill 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.
[1m-u [22mRestrains [1mftp [22mfrom attempting ``auto-authentication'' upon ini-
tial connection. If auto-authentication is enabled, [1mftp[0m
attempts to authenticate to the FTP server by sending the AUTH
command, using whichever authentication types are locally sup-
ported. Once an authentication type is accepted, an authentica-
tion protocol will proceed by issuing ADAT commands. This
option also disables auto-login.
[1m-i [22mTurns off interactive prompting during multiple file transfers.
[1m-d [22mEnables debugging.
[1m-g [22mDisables file name globbing.
[1m-f [22mCauses credentials to be forwarded to the remote host.
[1m-x [22mCauses the client to attempt to negotiate encryption (data and
command protection levels ``private'') immediately after suc-
cessfully authenticating.
[1m-t [22mEnables packet tracing.
[1mCOMMANDS[0m
The client host with which [1mftp [22mis to communicate may be specified on
the command line. If this is done, [1mftp [22mwill immediately attempt to
establish a connection to an FTP server on that host; otherwise, [1mftp[0m
will enter its command interpreter and await instructions from the
user. When [1mftp [22mis awaiting commands from the user the prompt ``ftp>''
pleted. If no argument is included, the user will be prompted
for an account password in a non-echoing input mode.
[1mappend [4m[22mlocal-file[24m [[4mremote-file[24m]
Append a local file to a file on the remote machine. If [4mremote-[0m
[4mfile[24m is left unspecified, the local file name is used in naming
the remote file after being altered by any [1mntrans [22mor [1mnmap [22mset-
ting. File transfer uses the current settings for [1mtype[22m, [1mformat[22m,
[1mmode[22m, and [1mstructure[22m.
[1mascii [22mSet the file transfer [1mtype [22mto network ASCII . This is the
default type.
[1mbell [22mArrange that a bell be sounded after each file transfer command
is completed.
[1mbinary [22mSet the file transfer [1mtype [22mto support binary file transfer.
[1mbye [22mTerminate the FTP session with the remote server and exit [1mftp[22m.
An end of file will also terminate the session and exit.
[1mcase [22mToggle remote computer file name case mapping during [1mmget [22mcom-
mands. When [1mcase [22mis 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.
[1mccc [22mTurn off integrity protection on the command channel. This com-
mand must be sent integrity protected, and must be proceeded by
a successful ADAT command. Since turning off integrity protec-
tion potentially allows an attacker to insert commands onto the
command channel, some FTP servers may refuse to honor this com-
mand.
[1mcd [4m[22mremote-directory[0m
Change the working directory on the remote machine to [4mremote-[0m
[4mdirectory[24m.
[1mcdup [22mChange the remote machine working directory to the parent of the
current remote machine working directory.
[1mchmod [4m[22mmode[24m [4mfile-name[0m
Change the permission modes of the file [4mfile-name[24m on the remote
system to [4mmode[24m.
[1mclear [22mSet the protection level on data transfers to ``clear''. If no
ADAT command succeeded, then this is the default protection
level.
[1mclose [22mTerminate the FTP session with the remote server, and return to
the command interpreter. Any defined macros are erased.
[1mcprotect [22m[[4mprotection-level[24m]
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 distin-
guished from a record delimiter only when [1mcr [22mis off.
[1mdelete [4m[22mremote-file[0m
Delete the file [4mremote-file[24m on the remote machine.
[1mdebug [22m[[4mdebug-value[24m]
Toggle debugging mode. If an optional [4mdebug-value[24m is specified
it is used to set the debugging level. When debugging is on,
[1mftp [22mprints each command sent to the remote machine, preceded by
the string `-->'
[1mdir [22m[[4mremote-directory[24m] [[4mlocal-file[24m]
Print a listing of the directory contents in the directory,
[4mremote-directory[24m, and, optionally, placing the output in [4mlocal-[0m
[4mfile[24m. If interactive prompting is on, [1mftp [22mwill prompt the user
to verify that the last argument is indeed the target local file
for receiving [1mdir [22moutput. If no directory is specified, the
current working directory on the remote machine is used. If no
local file is specified, or [4mlocal-file[24m is `[1m-[22m', output comes to
the terminal.
[1mdisconnect[0m
A synonym for [4mclose[24m.
[1mform [4m[22mformat[0m
Set the file transfer [1mform [22mto [4mformat[24m. The default format is
``file''.
[1mget [4m[22mremote-file[24m [[4mlocal-file[24m]
Retrieve the file [4mremote-file[24m 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 [1mcase[22m, [1mntrans[22m, and [1mnmap [22msettings. The current settings
for [1mtype[22m, [1mform[22m, [1mmode[22m, and [1mstructure [22mare used while transferring
the file.
[1mglob [22mToggle filename expansion for [1mmdelete[22m, [1mmget[22m, and [1mmput[22m. If glob-
bing is turned off with [1mglob[22m, the file name arguments are taken
literally and not expanded. Globbing for [1mmput [22mis done as in
[4mcsh[24m(1). For [1mmdelete [22mand [1mmget[22m, 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: [1mmget [22mand [1mmput[0m
are not meant to transfer entire directory subtrees of files.
That can be done by transferring a [4mtar[24m(1) archive of the subtree
(in binary mode).
[4mtory[24m is specified, the user's home directory is used.
[1mls [22m[[4mremote-directory[24m] [[4mlocal-file[24m]
Print a listing of the contents of a directory on the remote
machine. The listing includes any system-dependent information
that the server chooses to include; for example, most UNIX sys-
tems will produce output from the command `ls -l'. (See also
[1mnlist[22m.) If [4mremote-directory[24m is left unspecified, the current
working directory is used. If interactive prompting is on, [1mftp[0m
will prompt the user to verify that the last argument is indeed
the target local file for receiving [1mls [22moutput. If no local file
is specified, or if [4mlocal-file[24m is `[1m-[22m', the output is sent to the
terminal.
[1mmacdef[4m[22mmacro-name[0m
Define a macro. Subsequent lines are stored as the macro [4mmacro-[0m
[4mname[24m; 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 until a [1mclose [22mcommand 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 `$'.
[1mmdelete [22m[[4mremote-files[24m]
Delete [4mremote-files[24m on the remote machine.
[1mmdir [4m[22mremote-files[24m [4mlocal-file[0m
Like [1mdir[22m, except multiple remote files may be specified. If
interactive prompting is on, [1mftp [22mwill prompt the user to verify
that the last argument is indeed the target local file for
receiving [1mmdir [22moutput.
[1mmget [4m[22mremote-files[0m
Expand the [4mremote-files[24m on the remote machine and do a [1mget [22mfor
each file name thus produced. See [1mglob [22mfor details on the file-
name expansion. Resulting file names will then be processed
according to [1mcase[22m, [1mntrans[22m, and [1mnmap [22msettings. Files are trans-
ferred into the local working directory, which can be changed
with `lcd directory'; new local directories can be created with
`! mkdir directory'.
[1mmkdir [4m[22mdirectory-name[0m
Make a directory on the remote machine.
[1mmput [4m[22mlocal-files[0m
Expand wild cards in the list of local files given as arguments
and do a [1mput [22mfor each file in the resulting list. See [1mglob [22mfor
details of filename expansion. Resulting file names will then
be processed according to [1mntrans [22mand [1mnmap [22msettings.
[1mnewer [4m[22mfile-name[0m
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 consid-
ered [1mnewer[22m. Otherwise, this command is identical to [1mget[22m.
[1mnlist [22m[[4mremote-directory[24m] [[4mlocal-file[24m]
Print a list of the files in a directory on the remote machine.
If [4mremote-directory[24m is left unspecified, the current working
directory is used. If interactive prompting is on, [1mftp [22mwill
prompt the user to verify that the last argument is indeed the
target local file for receiving [1mnlist [22moutput. If no local file
is specified, or if [4mlocal-file[24m is `[1m-[22m', the output is sent to the
terminal.
[1mnmap [22m[[4minpattern[24m [4moutpattern[24m]
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 [1mmput[0m
commands and [1mput [22mcommands issued without a specified remote tar-
get filename. If arguments are specified, local filenames are
mapped during [1mmget [22mcommands and [1mget [22mcommands issued without a
specified local target filename. This command is useful when
connecting to non-UNIX remote computer with different file nam-
ing conventions or practices. The mapping follows the pattern
set by [4minpattern[24m and [4moutpattern[24m. [[4mInpattern[24m] is a template for
incoming filenames (which may have already been processed
according to the [1mntrans [22mand [1mcase [22msettings). Variable templating
is accomplished by including the sequences `$1', `$2', ..., `$9'
in [4minpattern[24m. Use `\' to prevent this special treatment of the
`$' character. All other characters are treated literally, and
are used to determine the [1mnmap [22m[[4minpattern[24m] variable values. For
example, given [4minpattern[24m $1.$2 and the remote file name
"mydata.data", $1 would have the value "mydata", and $2 would
have the value "data". The [4moutpattern[24m determines the resulting
mapped filename. The sequences `$1', `$2', ..., `$9' are
replaced by any value resulting from the [4minpattern[24m template.
The sequence `$0' is replace by the original filename. Addi-
tionally, the sequence `[[4mseq1[24m, [4mseq2[24m]' is replaced by [[4mseq1[24m] if
[4mseq1[24m is not a null string; otherwise it is replaced by [4mseq2[24m.
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
a specified local target filename. This command is useful when
connecting to a non-UNIX remote computer with different file
naming conventions or practices. Characters in a filename
matching a character in [4minchars[24m are replaced with the corre-
sponding character in [4moutchars[24m. If the character's position in
[4minchars[24m is longer than the length of [4moutchars[24m, the character is
deleted from the file name.
[1mopen [4m[22mhost[24m [[4mport[24m] [[1m-forward[22m]
Establish a connection to the specified [4mhost[24m FTP server. An
optional port number may be supplied, in which case, [1mftp [22mwill
attempt to contact an FTP server at that port. If the [1mauto-[0m
[1mauthenticate [22moption is on (default), [1mftp [22mwill attempt to authen-
ticate to the FTP server by sending the AUTH command, using
whichever authentication types which are locally supported.
Once an authentication type is accepted, an authentication pro-
tocol will proceed by issuing ADAT commands. If the [1mauto-login[0m
option is on (default), [1mftp [22mwill also attempt to automatically
log the user in to the FTP server (see below). If the [1m-forward[0m
option is specified, [1mftp [22mwill forward a copy of the user's Ker-
beros tickets to the remote host.
[1mpassive[0m
Toggle passive data transfer mode. In passive mode, the client
initiates the data connection by listening on the data port.
Passive mode may be necessary for operation from behind fire-
walls which do not permit incoming connections.
[1mprivate[0m
Set the protection level on data transfers to ``private''. Data
transmissions are confidentiality and integrity protected by
encryption. If no ADAT command succeeded, then the only possi-
ble level is ``clear''.
[1mprompt [22mToggle interactive prompting. Interactive prompting occurs dur-
ing multiple file transfers to allow the user to selectively
retrieve or store files. If prompting is turned off (default is
on), any [1mmget [22mor [1mmput [22mwill transfer all files, and any [1mmdelete[0m
will delete all files.
[1mprotect [22m[[4mprotection-level[24m]
Set the protection level on data transfers to [4mprotection-level[24m.
The valid protection levels are ``clear'' for unprotected data
transmissions, ``safe'' for data transmissions integrity pro-
tected by cryptographic checksum, and ``private'' for data
transmissions confidentiality and integrity protected by encryp-
tion. If no ADAT command succeeded, then the only possible
level is ``clear''. If no level is specified, the current level
is printed. The default protection level is ``clear''.
[1mproxy [4m[22mftp-command[0m
Execute an ftp command on a secondary control connection. This
[1mput [4m[22mlocal-file[24m [[4mremote-file[24m]
Store a local file on the remote machine. If [4mremote-file[24m is
left unspecified, the local file name is used after processing
according to any [1mntrans [22mor [1mnmap [22msettings in naming the remote
file. File transfer uses the current settings for [1mtype[22m, [1mformat[22m,
[1mmode[22m, and [1mstructure[22m.
[1mpwd [22mPrint the name of the current working directory on the remote
machine.
[1mquit [22mA synonym for [1mbye[22m.
[1mquote [4m[22marg1[24m [[4marg2[24m] [[4m...[24m]
The arguments specified are sent, verbatim, to the remote FTP
server.
[1mrecv [4m[22mremote-file[24m [[4mlocal-file[24m]
A synonym for get.
[1mreget [4m[22mremote-file[24m [[4mlocal-file[24m]
Reget acts like get, except that if [4mlocal-file[24m exists and is
smaller than [4mremote-file[24m, [4mlocal-file[24m is presumed to be a par-
tially transferred copy of [4mremote-file[24m and the transfer is con-
tinued from the apparent point of failure. This command is use-
ful when transferring very large files over networks that are
prone to dropping connections.
[1mremotehelp [22m[[4mcommand-name[24m]
Request help from the remote FTP server. If a [4mcommand-name[24m is
specified it is supplied to the server as well.
[1mremotestatus [22m[[4mfile-name[24m]
With no arguments, show status of remote machine. If [4mfile-name[0m
is specified, show status of [4mfile-name[24m on remote machine.
[1mrename [22m[[4mfrom[24m] [[4mto[24m]
Rename the file [4mfrom[24m on the remote machine, to the file [4mto[24m.
[1mreset [22mClear reply queue. This command re-synchronizes command/reply
sequencing with the remote ftp server. Resynchronization may be
necessary following a violation of the ftp protocol by the
remote server.
[1mrestart [4m[22mmarker[0m
Restart the immediately following [1mget [22mor [1mput [22mat the indicated
[4mmarker[24m. On UNIX systems, marker is usually a byte offset into
the file.
[1mrmdir [4m[22mdirectory-name[0m
Delete a directory on the remote machine.
If no ADAT command succeeded, then the only possible level is
``clear''.
[1msend [4m[22mlocal-file[24m [[4mremote-file[24m]
A synonym for put.
[1msendport[0m
Toggle the use of PORT commands. By default, [1mftp [22mwill attempt
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,
[1mftp [22mwill use the default data port. When the use of PORT com-
mands is disabled, no attempt will be made to use PORT commands
for each data transfer. This is useful for certain FTP imple-
mentations which do ignore PORT commands but, incorrectly, indi-
cate they've been accepted.
[1msite [4m[22marg1[24m [[4marg2[24m] [[4m...[24m]
The arguments specified are sent, verbatim, to the remote FTP
server as a SITE command.
[1msize [4m[22mfile-name[0m
Return size of [4mfile-name[24m on remote machine.
[1mstatus [22mShow the current status of [1mftp[22m.
[1mstruct [4m[22mstruct-name[0m
Set the file transfer [4mstructure[24m to [4mstruct-name[24m. By default
``stream'' structure is used.
[1msunique[0m
Toggle storing of files on remote machine under unique file
names. Remote ftp server must support ftp protocol STOU command
for successful completion. The remote server will report unique
name. Default value is off.
[1msystem [22mShow the type of operating system running on the remote machine.
[1mtenex [22mSet the file transfer type to that needed to talk to TENEX
machines.
[1mtrace [22mToggle packet tracing.
[1mtype [22m[[4mtype-name[24m]
Set the file transfer [1mtype [22mto [4mtype-name[24m. If no type is speci-
fied, the current type is printed. The default type is network
ASCII.
[1mumask [22m[[4mnewmask[24m]
Set the default umask on the remote server to [4mnewmask[24m. If [4mnew-[0m
[4mmask[24m is omitted, the current umask is printed.
FTP server are displayed to the user. In addition, if verbose
is on, when a file transfer completes, statistics regarding the
efficiency of the transfer are reported. By default, verbose is
on.
[1m? [[4m[22mcommand[24m[1m][0m
A synonym for help.
Command arguments which have embedded spaces may be quoted with quote
`"' marks.
[1mABORTING A FILE TRANSFER[0m
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 [1mftp [22mhas com-
pleted 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 violations of the ftp protocol. If the delay results from
unexpected remote server behavior, the local [1mftp [22mprogram must be killed
by hand.
[1mFILE NAMING CONVENTIONS[0m
Files specified as arguments to [1mftp [22mcommands are processed according to
the following rules.
1. If the file name `[1m-[22m' is specified, [4mstdin[24m (for reading) or [4mstdout[0m
(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. [1mFtp [22mthen forks
a shell, using [4mpopen[24m(3) with the argument supplied, and reads
from (writes to) stdout (stdin). If the shell command includes
spaces, the argument must be quoted; e.g. ``" ls -lt"''. A
particularly 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 [4mcsh[24m(1); c.f.
the [1mglob [22mcommand. If the [1mftp [22mcommand expects a single local
file (.e.g. [1mput[22m), only the first filename generated by the
``globbing'' operation is used.
4. For [1mmget [22mcommands and [1mget [22mcommands with unspecified local file
names, the local filename is the remote filename, which may be
altered by a [1mcase[22m, [1mntrans[22m, or [1mnmap [22msetting. The resulting file-
[1mFtp [22msupports only the default values for the remaining file transfer
parameters: [1mmode[22m, [1mform[22m, and [1mstruct[22m.
[1mTHE .netrc FILE[0m
The [4m.netrc[24m file contains login and initialization information 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:
[1mmachine [4m[22mname[0m
Identify a remote machine [4mname[24m. The auto-login process searches
the [4m.netrc[24m file for a [1mmachine [22mtoken that matches the remote
machine specified on the [1mftp [22mcommand line or as an [1mopen [22mcommand
argument. Once a match is made, the subsequent [4m.netrc[24m tokens
are processed, stopping when the end of file is reached or
another [1mmachine [22mor a [1mdefault [22mtoken is encountered.
[1mdefault[0m
This is the same as [1mmachine [4m[22mname[24m except that [1mdefault [22mmatches any
name. There can be only one [1mdefault [22mtoken, and it must be after
all [1mmachine [22mtokens. This is normally used as:
default login anonymous password user@site
thereby giving the user [4mautomatic[24m anonymous ftp login to
machines not specified in [4m.netrc[24m. This can be overridden by
using the [1m-n [22mflag to disable auto-login.
[1mlogin [4m[22mname[0m
Identify a user on the remote machine. If this token is
present, the auto-login process will initiate a login using the
specified [4mname[24m.
[1mpassword [4m[22mstring[0m
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 [4m.netrc[24m file for any user other than
[4manonymous[24m, [1mftp [22mwill abort the auto-login process if the [4m.netrc[0m
is readable by anyone besides the user.
[1maccount [4m[22mstring[0m
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 additional account password, or
the auto-login process will initiate an ACCT command if it does
not.
[1mmacdef [4m[22mname[0m
Define a macro. This token functions like the [1mftp macdef [22mcom-
mand functions. A macro is defined with the specified name; its
contents begin with the next [4m.netrc[24m line and continue until a
Lunt, S. J., FTP Security Extensions, Internet Draft, November 1993.
[1mHISTORY[0m
The [1mftp [22mcommand appeared in 4.2BSD.
[1mBUGS[0m
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.
FTP(1)
Man(1) output converted with
man2html