- Connect to an FTP server:ftp [ftp.example.com]- Switch to binary transfer mode (graphics, compressed files, etc):binary- Transfer multiple files without prompting for confirmation on every file:prompt off- Download multiple files (glob expression):mget [*.png]- Upload multiple files (glob expression):mput [*.zip]- Delete multiple files on the remote server:mdelete [*.txt]- Rename a file on the remote server:rename [original_filename] [new_filename]
ftp [-46pinegvd ] [host [port ] ] pftp [-46inegvd ] [host [port ] ]
Ftp is the user interface to the Internet 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 interpreter.
The client host and an optional port number with which ftp is to communicate may be specified on the command line. If this is done, ftp will immediately attempt to establish a connection to an FTP server on that host; otherwise, ftp will enter its command interpreter and await instructions from the user. When ftp is awaiting commands from the user the prompt `ftp>' is provided to the user. The following commands are recognized by ftp
nmap $1.$2.$3 [$1,$2].[$2,file]
nmap $1.$2.$3 [$1,$2].[$2,file]
would yield the output 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 outpattern as in the example: `nmap $1 sed "s/ *$//" > $1' . Use the `\' character to prevent special treatment of the `$','[','[', and `,' characters.
Command arguments which have embedded spaces may be quoted with quote `"' marks.
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 ftp 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 ftp program must be killed by hand.
Files specified as arguments to ftp commands are processed according to the following rules.
The FTP specification specifies many parameters which may affect a file transfer. The type may be one of “ascii”, “image” (binary), “ebcdic”, and “local byte size” (for PDP -10's and PDP -20's mostly). Ftp supports the ascii and image types of file transfer, plus local byte size 8 for tenex mode transfers.
Ftp supports only the default values for the remaining file transfer parameters: mode form and struct
Ftp utilizes the following environment variables.
ftpd(8), netrc(5), RFC 959
The ftp command appeared in BSD 4.2
Correct execution of many commands depends upon proper behavior by the remote server.
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.