man-pages/man1/netkit-ftp.1.html
2021-03-31 01:06:50 +01:00

1981 lines
30 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of FTP</TITLE>
</HEAD><BODY>
<H1>FTP</H1>
Section: User Commands (1)<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<BR>BSD mandoc<BR>
Linux NetKit (0.17)
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
<B>ftp</B>
- <B>Internet</B>
file transfer program
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>ftp</B>
[-<B>46pinegvd</B>
]
[<I>host </I>[<I>port</I>
]
]
<BR><B>pftp</B>
[-<B>46inegvd</B>
]
[<I>host </I>[<I>port</I>
]
]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>Ftp</B>
is the user interface to the
<B>Internet</B>
standard File Transfer Protocol.
The program allows a user to transfer files to and from a
remote network site.
<P>
Options may be specified at the command line, or to the
command interpreter.
<DL COMPACT>
<P>
<DT id="1"><B>-4</B>
<DD>
Use only IPv4 to contact any host.
<DT id="2"><B>-6</B>
<DD>
Use IPv6 only.
<DT id="3"><B>-p</B>
<DD>
Use passive mode for data transfers. Allows use of ftp in environments
where a firewall prevents connections from the outside world back to
the client machine. Requires that the ftp server support the PASV
command. This is the default if invoked as
<B>pftp.</B>
<DT id="4"><B>-i</B>
<DD>
Turns off interactive prompting during multiple file transfers.
<DT id="5"><B>-n</B>
<DD>
Restrains
<B>ftp</B>
from attempting &ldquo;auto-login&rdquo; upon initial connection.
If auto-login is enabled,
<B>ftp</B>
will check the
.netrc
(see
<A HREF="/cgi-bin/man/man2html?5+netrc">netrc</A>(5))
file in the user's home directory for an entry describing
an account on the remote machine.
If no entry exists,
<B>ftp</B>
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.
<DT id="6"><B>-e</B>
<DD>
Disables command editing and history support, if it was compiled into
the
<B>ftp</B>
executable. Otherwise, does nothing.
<DT id="7"><B>-g</B>
<DD>
Disables file name globbing.
<DT id="8"><B>-v</B>
<DD>
Verbose option forces
<B>ftp</B>
to show all responses from the remote server, as well
as report on data transfer statistics.
<DT id="9"><B>-d</B>
<DD>
Enables debugging.
</DL>
<P>
<P>
The client host and an optional port number with which
<B>ftp</B>
is to communicate may be specified on the command line.
If this is done,
<B>ftp</B>
will immediately attempt to establish a connection to an
<B>FTP</B>
server on that host; otherwise,
<B>ftp</B>
will enter its command interpreter and await instructions
from the user.
When
<B>ftp</B>
is awaiting commands from the user the prompt
`ftp&gt;'
is provided to the user.
The following commands are recognized
by
<B>ftp </B>
<DL COMPACT>
<P>
<DT id="10"><B>! </B>[<I>command </I>[<I>args</I>
]
]
<DD>
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.
<DT id="11"><B>$ </B><I>macro-name </I>[<I>args</I>
]
<DD>
Execute the macro
<I>macro-name</I>
that was defined with the
<B>macdef</B>
command.
Arguments are passed to the macro unglobbed.
<DT id="12"><B>account </B>[<I>passwd</I>
]
<DD>
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.
<DT id="13"><B>append </B><I>local-file </I>[<I>remote-file</I>
]
<DD>
Append a local file to a file on the remote machine.
If
<I>remote-file</I>
is left unspecified, the local file name is used in naming the
remote file after being altered by any
<B>ntrans</B>
or
<B>nmap</B>
setting.
File transfer uses the current settings for
<B>type </B>
<B>format</B>
<B>mode </B>
and
<B>structure</B>
<DT id="14"><B>ascii</B>
<DD>
Set the file transfer
<B>type</B>
to network
<B>ASCII</B>
This is the default type.
<DT id="15"><B>bell</B>
<DD>
Arrange that a bell be sounded after each file transfer
command is completed.
<DT id="16"><B>binary</B>
<DD>
Set the file transfer
<B>type</B>
to support binary image transfer.
<DT id="17"><B>bye</B>
<DD>
Terminate the
<B>FTP</B>
session with the remote server
and exit
<B>ftp </B>
An end of file will also terminate the session and exit.
<DT id="18"><B>case</B>
<DD>
Toggle remote computer file name case mapping during
<B>mget</B>
commands.
When
<B>case</B>
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.
<DT id="19"><B>cd </B><I>remote-directory</I>
<DD>
Change the working directory on the remote machine
to
<I>remote-directory </I>
<DT id="20"><B>cdup</B>
<DD>
Change the remote machine working directory to the parent of the
current remote machine working directory.
<DT id="21"><B>chmod </B><I>mode file-name</I>
<DD>
Change the permission modes of the file
<I>file-name</I>
on the remote
system to
<I>mode </I>
<DT id="22"><B>close</B>
<DD>
Terminate the
<B>FTP</B>
session with the remote server, and
return to the command interpreter.
Any defined macros are erased.
<DT id="23"><B>cr</B>
<DD>
Toggle carriage return stripping during
ascii type file retrieval.
Records are denoted by a carriage return/linefeed sequence
during ascii type file transfer.
When
<B>cr</B>
is on (the default), carriage returns are stripped from this
sequence to conform with the
UNIX
single linefeed record
delimiter.
Records on
non- <B>UNIX
</B>
remote systems may contain single linefeeds;
when an ascii type transfer is made, these linefeeds may be
distinguished from a record delimiter only when
<B>cr</B>
is off.
<DT id="24"><B>qc</B>
<DD>
Toggle the printing of control characters in the output of
<B>ASCII</B>
type commands. When this is turned on, control characters
are replaced with a question mark if the output file is the
standard output. This is the default when the standard
output is a tty.
<DT id="25"><B>delete </B><I>remote-file</I>
<DD>
Delete the file
<I>remote-file</I>
on the remote machine.
<DT id="26"><B>debug </B>[<I>debug-value</I>
]
<DD>
Toggle debugging mode.
If an optional
<I>debug-value</I>
is specified it is used to set the debugging level.
When debugging is on,
<B>ftp</B>
prints each command sent to the remote machine, preceded
by the string
`--&gt;'
<DT id="27"><B>
</B>
<B>dir</B>
[<I>remote-directory</I>
]
[<I>local-file</I>
]
<DD>
<DD>Print a listing of the directory contents in the
directory,
<I>remote-directory </I>
and, optionally, placing the output in
<I>local-file </I>
If interactive prompting is on,
<B>ftp</B>
will prompt the user to verify that the last argument is indeed the
target local file for receiving
<B>dir</B>
output.
If no directory is specified, the current working
directory on the remote machine is used.
If no local
file is specified, or
<I>local-file</I>
is
-<B>,</B>
output comes to the terminal.
<DT id="28"><B>disconnect</B>
<DD>
A synonym for
<I>close </I>
<DT id="29"><B>form </B><I>format</I>
<DD>
Set the file transfer
<B>form</B>
to
<I>format </I>
The default format is &ldquo;file&rdquo;.
<DT id="30"><B>get </B><I>remote-file </I>[<I>local-file</I>
]
<DD>
Retrieve the
<I>remote-file</I>
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
<B>case </B>
<B>ntrans</B>
and
<B>nmap</B>
settings.
The current settings for
<B>type </B>
<B>form</B>
<B>mode </B>
and
<B>structure</B>
are used while transferring the file.
<DT id="31"><B>glob</B>
<DD>
Toggle filename expansion for
<B>mdelete </B>
<B>mget</B>
and
<B>mput </B>
If globbing is turned off with
<B>glob </B>
the file name arguments
are taken literally and not expanded.
Globbing for
<B>mput</B>
is done as in
<A HREF="/cgi-bin/man/man2html?1+csh">csh</A>(1).
For
<B>mdelete</B>
and
<B>mget </B>
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:
<B>mget</B>
and
<B>mput</B>
are not meant to transfer
entire directory subtrees of files.
That can be done by
transferring a
<A HREF="/cgi-bin/man/man2html?1+tar">tar</A>(1)
archive of the subtree (in binary mode).
<DT id="32"><B>hash </B>[<I>increment</I>
]
<DD>
Toggle hash-sign (``#'') printing for each transferred
data block, but only in the absence of an argument.
The size of a data block is set to 1024 bytes by default,
but can be changed by the argument
<I>increment</I>
which also accepts the suffixed multipliers 'k' and 'K' for
kilobytes, 'm' and 'M' for Megabytes, and finally 'g' and 'G'
for Gigabytes.
Setting a size activates hash printing unconditionally.
<DT id="33"><B>help </B>[<I>command</I>
]
<DD>
Print an informative message about the meaning of
<I>command </I>
If no argument is given,
<B>ftp</B>
prints a list of the known commands.
<DT id="34"><B>idle </B>[<I>seconds</I>
]
<DD>
Set the inactivity timer on the remote server to
<I>seconds</I>
seconds.
If
<I>seconds</I>
is omitted, the current inactivity timer is printed.
<DT id="35"><B>ipany</B>
<DD>
Allow the address resolver to return any address family.
<DT id="36"><B>ipv4</B>
<DD>
Restrict the address resolver to look only for IPv4 addresses.
<DT id="37"><B>ipv6</B>
<DD>
Restrict host adressing to IPv6 only.
<DT id="38"><B>lcd </B>[<I>directory</I>
]
<DD>
Change the working directory on the local machine.
If
no
<I>directory</I>
is specified, the user's home directory is used.
<DT id="39"><B>
</B>
<B>ls</B>
[<I>remote-directory</I>
]
[<I>local-file</I>
]
<DD>
<DD>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
systems will produce
output from the command
`ls'
-l .
(See also
<B>nlist .</B>
If
<I>remote-directory</I>
is left unspecified, the current working directory is used.
If interactive prompting is on,
<B>ftp</B>
will prompt the user to verify that the last argument is indeed the
target local file for receiving
<B>ls</B>
output.
If no local file is specified, or if
<I>local-file</I>
is
`-
'
the output is sent to the terminal.
<DT id="40"><B>macdef </B><I>macro-name</I>
<DD>
Define a macro.
Subsequent lines are stored as the macro
<I>macro-name </I>
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
<B>close</B>
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 `$'.
<DT id="41"><B>mdelete </B>[<I>remote-files</I>
]
<DD>
Delete the
<I>remote-files</I>
on the remote machine.
<DT id="42"><B>mdir </B><I>remote-files local-file</I>
<DD>
Like
<B>dir </B>
except multiple remote files may be specified.
If interactive prompting is on,
<B>ftp</B>
will prompt the user to verify that the last argument is indeed the
target local file for receiving
<B>mdir</B>
output.
<DT id="43"><B>mget </B><I>remote-files</I>
<DD>
Expand the
<I>remote-files</I>
on the remote machine
and do a
<B>get</B>
for each file name thus produced.
See
<B>glob</B>
for details on the filename expansion.
Resulting file names will then be processed according to
<B>case </B>
<B>ntrans</B>
and
<B>nmap</B>
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 .
<DT id="44"><B>mkdir </B><I>directory-name</I>
<DD>
Make a directory on the remote machine.
<DT id="45"><B>mls </B><I>remote-files local-file</I>
<DD>
Like
<B>nlist </B>
except multiple remote files may be specified,
and the
<I>local-file</I>
must be specified.
If interactive prompting is on,
<B>ftp</B>
will prompt the user to verify that the last argument is indeed the
target local file for receiving
<B>mls</B>
output.
<DT id="46"><B>mode </B>[<I>mode-name</I>
]
<DD>
Set the file transfer
<B>mode</B>
to
<I>mode-name </I>
The default mode is &ldquo;stream&rdquo; mode.
<DT id="47"><B>modtime </B><I>file-name</I>
<DD>
Show the last modification time of the file on the remote machine.
<DT id="48"><B>mput </B><I>local-files</I>
<DD>
Expand wild cards in the list of local files given as arguments
and do a
<B>put</B>
for each file in the resulting list.
See
<B>glob</B>
for details of filename expansion.
Resulting file names will then be processed according to
<B>ntrans</B>
and
<B>nmap</B>
settings.
<DT id="49"><B>newer </B><I>file-name </I>[<I>local-file</I>
]
<DD>
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
<B>newer </B>
Otherwise, this command is identical to
<I>get </I>
<DT id="50"><B>
</B>
<B>nlist</B>
[<I>remote-directory</I>
]
[<I>local-file</I>
]
<DD>
<DD>Print a list of the files in a
directory on the remote machine.
If
<I>remote-directory</I>
is left unspecified, the current working directory is used.
If interactive prompting is on,
<B>ftp</B>
will prompt the user to verify that the last argument is indeed the
target local file for receiving
<B>nlist</B>
output.
If no local file is specified, or if
<I>local-file</I>
is
-<B>,</B>
the output is sent to the terminal.
<DT id="51"><B>nmap </B>[<I>inpattern outpattern</I>
]
<DD>
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
<B>mput</B>
commands and
<B>put</B>
commands issued without a specified remote target filename.
If arguments are specified, local filenames are mapped during
<B>mget</B>
commands and
<B>get</B>
commands issued without a specified local target filename.
This command is useful when connecting to a
<B>non- UNIX
</B>
remote computer
with different file naming conventions or practices.
The mapping follows the pattern set by
<I>inpattern</I>
and
<I>outpattern </I>
[<I>Inpattern</I>
]
is a template for incoming filenames (which may have already been
processed according to the
<B>ntrans</B>
and
<B>case</B>
settings).
Variable templating is accomplished by including the
sequences `$1', `$2', ..., `$9' in
<I>inpattern </I>
Use `\' to prevent this special treatment of the `$' character.
All other characters are treated literally, and are used to determine the
<B>nmap</B>
[<I>inpattern</I>
]
variable values.
For example, given
<I>inpattern</I>
$1.$2 and the remote file name &quot;mydata.data&quot;, $1 would have the value
&quot;mydata&quot;, and $2 would have the value &quot;data&quot;.
The
<I>outpattern</I>
determines the resulting mapped filename.
The sequences `$1', `$2', ...., `$9' are replaced by any value resulting
from the
<I>inpattern</I>
template.
The sequence `$0' is replace by the original filename.
Additionally, the sequence
`[<I>seq1</I>
]
'
, Ar seq2
is replaced by
[<I>seq1</I>
]
if
<I>seq1</I>
is not a null string; otherwise it is replaced by
<I>seq2</I>
For example, the command
<P>
<BLOCKQUOTE>
<PRE>
nmap $1.$2.$3 [$1,$2].[$2,file]
</PRE>
</BLOCKQUOTE>
<P>
would yield
the output filename &quot;myfile.data&quot; for input filenames &quot;myfile.data&quot; and
&quot;myfile.data.old&quot;, &quot;myfile.file&quot; for the input filename &quot;myfile&quot;, and
&quot;myfile.myfile&quot; for the input filename &quot;.myfile&quot;.
Spaces may be included in
<I>outpattern </I>
as in the example: `nmap $1 sed &quot;s/ *$//&quot; &gt; $1' .
Use the `\' character to prevent special treatment
of the `$','[','[', and `,' characters.
<DT id="52"><B>ntrans </B>[<I>inchars </I>[<I>outchars</I>
]
]
<DD>
Set or unset the filename character translation mechanism.
If no arguments are specified, the filename character
translation mechanism is unset.
If arguments are specified, characters in
remote filenames are translated during
<B>mput</B>
commands and
<B>put</B>
commands issued without a specified remote target filename.
If arguments are specified, characters in
local filenames are translated during
<B>mget</B>
commands and
<B>get</B>
commands issued without a specified local target filename.
This command is useful when connecting to a
<B>non- UNIX
</B>
remote computer
with different file naming conventions or practices.
Characters in a filename matching a character in
<I>inchars</I>
are replaced with the corresponding character in
<I>outchars </I>
If the character's position in
<I>inchars</I>
is longer than the length of
<I>outchars </I>
the character is deleted from the file name.
<DT id="53"><B>open </B><I>host </I>[<I>port</I>
]
<DD>
Establish a connection to the specified
<I>host</I>
<B>FTP</B>
server.
An optional port number may be supplied,
in which case,
<B>ftp</B>
will attempt to contact an
<B>FTP</B>
server at that port.
If the
<B>auto-login</B>
option is on (default),
<B>ftp</B>
will also attempt to automatically log the user in to
the
<B>FTP</B>
server (see below).
<DT id="54"><B>prompt</B>
<DD>
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
<B>mget</B>
or
<B>mput</B>
will transfer all files, and any
<B>mdelete</B>
will delete all files.
<DT id="55"><B>proxy </B><I>ftp-command</I>
<DD>
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
<B>proxy</B>
command should be an
<B>open </B>
to establish the secondary control connection.
Enter the command &quot;proxy ?&quot; to see other ftp commands executable on the
secondary connection.
The following commands behave differently when prefaced by
<B>proxy </B>
<B>open</B>
will not define new macros during the auto-login process,
<B>close</B>
will not erase existing macro definitions,
<B>get</B>
and
<B>mget</B>
transfer files from the host on the primary control connection
to the host on the secondary control connection, and
<B>put </B>
<B>mput</B>
and
<B>append</B>
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
<B>PASV</B>
command by the server on the secondary control connection.
<DT id="56"><B>put </B><I>local-file </I>[<I>remote-file</I>
]
<DD>
Store a local file on the remote machine.
If
<I>remote-file</I>
is left unspecified, the local file name is used
after processing according to any
<B>ntrans</B>
or
<B>nmap</B>
settings
in naming the remote file.
File transfer uses the
current settings for
<B>type </B>
<B>format</B>
<B>mode </B>
and
<B>structure </B>
<DT id="57"><B>pwd</B>
<DD>
Print the name of the current working directory on the remote
machine.
<DT id="58"><B>quit</B>
<DD>
A synonym for
<B>bye </B>
<DT id="59"><B>quote </B><I>arg1 arg2 ...</I>
<DD>
The arguments specified are sent, verbatim, to the remote
<B>FTP</B>
server.
<DT id="60"><B>recv </B><I>remote-file </I>[<I>local-file</I>
]
<DD>
A synonym for get.
<DT id="61"><B>reget </B><I>remote-file </I>[<I>local-file</I>
]
<DD>
Reget acts like get, except that if
<I>local-file</I>
exists and is
smaller than
<I>remote-file </I>
<I>local-file</I>
is presumed to be
a partially transferred copy of
<I>remote-file</I>
and the transfer
is continued from the apparent point of failure.
If
<I>local-file</I>
does not exist ftp won't fetch the file.
This command
is useful when transferring very large files over networks that
are prone to dropping connections.
<DT id="62"><B>remotehelp </B>[<I>command-name</I>
]
<DD>
Request help from the remote
<B>FTP</B>
server.
If a
<I>command-name</I>
is specified it is supplied to the server as well.
<DT id="63"><B>remotestatus </B>[<I>file-name</I>
]
<DD>
With no arguments, show status of remote machine.
If
<I>file-name</I>
is specified, show status of
<I>file-name</I>
on remote machine.
<DT id="64"><B>
</B>
<B>rename</B>
[<I>from</I>
]
[<I>to</I>
]
<DD>
<DD>Rename the file
<I>from</I>
on the remote machine, to the file
<I>to </I>
<DT id="65"><B>reset</B>
<DD>
Clear 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.
<DT id="66"><B>restart </B><I>marker</I>
<DD>
Restart the immediately following
<B>get</B>
or
<B>put</B>
at the
indicated
<I>marker </I>
On
UNIX
systems, marker is usually a byte
offset into the file.
<DT id="67"><B>rmdir </B><I>directory-name</I>
<DD>
Delete a directory on the remote machine.
<DT id="68"><B>runique</B>
<DD>
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
<B>get</B>
or
<B>mget</B>
command, a &quot;.1&quot; is appended to the name.
If the resulting name matches another existing file,
a &quot;.2&quot; is appended to the original name.
If this process continues up to &quot;.99&quot;, an error
message is printed, and the transfer does not take place.
The generated unique filename will be reported.
Note that
<B>runique</B>
will not affect local files generated from a shell command
(see below).
The default value is off.
<DT id="69"><B>send </B><I>local-file </I>[<I>remote-file</I>
]
<DD>
A synonym for put.
<DT id="70"><B>sendport</B>
<DD>
Toggle the use of
<B>PORT</B>
commands.
By default,
<B>ftp</B>
will attempt to use a
<B>PORT</B>
command when establishing
a connection for each data transfer.
The use of
<B>PORT</B>
commands can prevent delays
when performing multiple file transfers.
If the
<B>PORT</B>
command fails,
<B>ftp</B>
will use the default data port.
When the use of
<B>PORT</B>
commands is disabled, no attempt will be made to use
<B>PORT</B>
commands for each data transfer.
This is useful
for certain
<B>FTP</B>
implementations which do ignore
<B>PORT</B>
commands but, incorrectly, indicate they've been accepted.
<DT id="71"><B>site </B><I>arg1 arg2 ...</I>
<DD>
The arguments specified are sent, verbatim, to the remote
<B>FTP</B>
server as a
<B>SITE</B>
command.
<DT id="72"><B>size </B><I>file-name</I>
<DD>
Return size of
<I>file-name</I>
on remote machine.
<DT id="73"><B>status</B>
<DD>
Show the current status of
<B>ftp </B>
<DT id="74"><B>struct </B>[<I>struct-name</I>
]
<DD>
Set the file transfer
<I>structure</I>
to
<I>struct-name</I>
By default &ldquo;stream&rdquo; structure is used.
<DT id="75"><B>sunique</B>
<DD>
Toggle storing of files on remote machine under unique file names.
Remote ftp server must support ftp protocol
<B>STOU</B>
command for
successful completion.
The remote server will report unique name.
Default value is off.
<DT id="76"><B>system</B>
<DD>
Show the type of operating system running on the remote machine.
<DT id="77"><B>tenex</B>
<DD>
Set the file transfer type to that needed to
talk to
<B>TENEX</B>
machines.
<DT id="78"><B>trace</B>
<DD>
Toggle packet tracing.
<DT id="79"><B>type </B>[<I>type-name</I>
]
<DD>
Set the file transfer
<B>type</B>
to
<I>type-name </I>
If no type is specified, the current type
is printed.
The default type is network
<B>ASCII</B>
<DT id="80"><B>umask </B>[<I>newmask</I>
]
<DD>
Set the default umask on the remote server to
<I>newmask </I>
If
<I>newmask</I>
is omitted, the current umask is printed.
<DT id="81"><B>
</B>
<B>user </B><I>user-name</I>
[<I>password</I>
]
[<I>account</I>
]
<DD>
<DD>Identify yourself to the remote
<B>FTP</B>
server.
If the
<I>password</I>
is not specified and the server requires it,
<B>ftp</B>
will prompt the user for it (after disabling local echo).
If an
<I>account</I>
field is not specified, and the
<B>FTP</B>
server
requires it, the user will be prompted for it.
If an
<I>account</I>
field is specified, 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
<B>ftp</B>
is invoked with &ldquo;auto-login&rdquo; disabled, this
process is done automatically on initial connection to
the
<B>FTP</B>
server.
<DT id="82"><B>verbose</B>
<DD>
Toggle verbose mode.
In verbose mode, all responses from
the
<B>FTP</B>
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.
<DT id="83"><B>? </B>[<I>command</I>
]
<DD>
A synonym for help.
</DL>
<P>
<P>
Command arguments which have embedded spaces may be quoted with
quote `&quot;' marks.
<A NAME="lbAE">&nbsp;</A>
<H2>ABORTING A FILE TRANSFER</H2>
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
<B>ABOR</B>
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
<B>ABOR</B>
processing.
If the remote server does not support the
<B>ABOR</B>
command, an
`ftp&gt;'
prompt will not appear until the remote server has completed
sending the requested file.
<P>
The terminal interrupt key sequence will be ignored when
<B>ftp</B>
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
violations of the ftp protocol.
If the delay results from unexpected remote server behavior, the local
<B>ftp</B>
program must be killed by hand.
<A NAME="lbAF">&nbsp;</A>
<H2>FILE NAMING CONVENTIONS</H2>
Files specified as arguments to
<B>ftp</B>
commands are processed according to the following rules.
<OL><P>
<LI>
If the file name
`-
'
is specified, the
<I>stdin</I>
(for reading) or
<I>stdout</I>
(for writing) is used.
<LI>
If the first character of the file name is
`|'
the
remainder of the argument is interpreted as a shell command.
<B>Ftp</B>
then forks a shell, using
<A HREF="/cgi-bin/man/man2html?3+popen">popen</A>(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.
&ldquo;&quot; ls -lt&quot;&rdquo;.
A particularly
useful example of this mechanism is: &ldquo;dir more&rdquo;.
<LI>
Failing the above checks, if ``globbing'' is enabled,
local file names are expanded
according to the rules used in the
<A HREF="/cgi-bin/man/man2html?1+csh">csh</A>(1);
c.f. the
<B>glob</B>
command.
If the
<B>ftp</B>
command expects a single local file (.e.g.
<B>put )</B>
only the first filename generated by the &quot;globbing&quot; operation is used.
<LI>
For
<B>mget</B>
commands and
<B>get</B>
commands with unspecified local file names, the local filename is
the remote filename, which may be altered by a
<B>case </B>
<B>ntrans</B>
or
<B>nmap</B>
setting.
The resulting filename may then be altered if
<B>runique</B>
is on.
<LI>
For
<B>mput</B>
commands and
<B>put</B>
commands with unspecified remote file names, the remote filename is
the local filename, which may be altered by a
<B>ntrans</B>
or
<B>nmap</B>
setting.
The resulting filename may then be altered by the remote server if
<B>sunique</B>
is on.
</OL><P>
<A NAME="lbAG">&nbsp;</A>
<H2>FILE TRANSFER PARAMETERS</H2>
The FTP specification specifies many parameters which may
affect a file transfer.
The
<B>type</B>
may be one of &ldquo;ascii&rdquo;, &ldquo;image&rdquo; (binary),
&ldquo;ebcdic&rdquo;, and &ldquo;local byte size&rdquo; (for
<B>PDP -10's</B>
and
<B>PDP -20's</B>
mostly).
<B>Ftp</B>
supports the ascii and image types of file transfer,
plus local byte size 8 for
<B>tenex</B>
mode transfers.
<P>
<B>Ftp</B>
supports only the default values for the remaining
file transfer parameters:
<B>mode </B>
<B>form</B>
and
<B>struct </B>
<A NAME="lbAH">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<B>Ftp</B>
utilizes the following environment variables.
<DL COMPACT>
<P>
<DT id="84"><B>HOME</B>
<DD>
For default location of a
.netrc
file, if one exists.
<DT id="85"><B>SHELL</B>
<DD>
For default shell.
</DL>
<P>
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
<A HREF="/cgi-bin/man/man2html?8+ftpd">ftpd</A>(8),
<A HREF="/cgi-bin/man/man2html?5+netrc">netrc</A>(5),
RFC 959
<A NAME="lbAJ">&nbsp;</A>
<H2>HISTORY</H2>
The
<B>ftp</B>
command appeared in
BSD 4.2
<A NAME="lbAK">&nbsp;</A>
<H2>BUGS</H2>
Correct execution of many commands depends upon proper behavior
by the remote server.
<P>
An error in the treatment of carriage returns
in the
BSD 4.2
ascii-mode transfer code
has been corrected.
This correction may result in incorrect transfers of binary files
to and from
BSD 4.2
servers using the ascii type.
Avoid this problem by using the binary image type.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="86"><A HREF="#lbAB">NAME</A><DD>
<DT id="87"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="88"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="89"><A HREF="#lbAE">ABORTING A FILE TRANSFER</A><DD>
<DT id="90"><A HREF="#lbAF">FILE NAMING CONVENTIONS</A><DD>
<DT id="91"><A HREF="#lbAG">FILE TRANSFER PARAMETERS</A><DD>
<DT id="92"><A HREF="#lbAH">ENVIRONMENT</A><DD>
<DT id="93"><A HREF="#lbAI">SEE ALSO</A><DD>
<DT id="94"><A HREF="#lbAJ">HISTORY</A><DD>
<DT id="95"><A HREF="#lbAK">BUGS</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:20 GMT, March 31, 2021
</BODY>
</HTML>