-->
Page 152
rmdir directory-name | Delete a directory on the remote machine. |
runique | 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 get or mget 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 runique will not affect local files generated from a shell command. The default value is off. |
send local-file [remote-file] | A synonym for put. |
sendport | Toggle the use of PORT commands. By default, ftp will 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, ftp 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. |
site arg1 arg2... | The arguments specified are sent, verbatim, to the remote FTP server as a SITE command. |
size file-name | Return size of file-name on remote machine. |
status | Show the current status of ftp. |
struct [struct-name] | Set the file transfer structure to struct-name. By default stream structure is used. |
sunique | Toggle storing of files on remote machine under unique filenames. Remote FTP server must support ftp protocol STOU command for successful completion. The remote server will report unique name. Default value is off. |
system | Show the type of operating system running on the remote machine. |
tenex | Set the file transfer type to that needed to talk to TENEX machines. |
trace | Toggle packet tracing. |
type [type-name] | Set the file transfer type to type-name. If no type is specified, the current type is printed. The default type is network ASCII. |
umask [newmask] | Set the default umask on the remote server to newmask. If newmask is omitted, the current umask is printed. |
user user-name [password] [account] | Identify yourself to the remote FTP server. If the password is not specified and the server requires it, ftp 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 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 ftp is invoked with auto-login disabled, this process is done automatically on initial connection to the FTP server. |
verbose | 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 completes, statistics regarding the efficiency of the transfer are reported. By default, verbose is on. |
? [command] | A synonym for help. |
Command arguments which have embedded spaces may be quoted with quotation marks (").
ABORTING A FILE TRANSFER
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 an 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.
Page 153
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 earlier in this section, 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.
FILE NAMING CONVENTIONS
Files specified as arguments to ftp commands are processed according to the following rules:
If the filename - is specified, the stdin (for reading) or stdout (for writing) is used.
If the first character of the filename is j, the remainder of the argument is interpreted as a shell command. ftp 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 argument must be quoted; for example, ls -lt. A particularly useful example of this mechanism is: dir more.
Failing the preceding checks, if "globbing" is enabled, local filenames are expanded according to the rules used in the csh 1; c.f. the glob command. If the ftp command expects a single local file (for example, put), only the first filename generated by the "globbing" operation is used.
For mget commands and get commands with unspecified local filenames, the local filename is the remote filename, which may be altered by a case, ntrans, or nmap setting. The resulting filename may then be altered if runique is on.
For mput commands and put commands with unspecified remote filenames, the remote filename is the local filename, which may be altered by an ntrans or nmap setting. The resulting filename may then be altered by the remote server if sunique is on.
FILE TRANSFER PARAMETERS
The FTP specification specifies many parameters that may affect a file transfer. The type may be one of ASCII, image (binary), ebcdic, and local byte size (for PDP Ns -10s and PDP Ns -20s 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.
THE .NETRC FILE
The 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 newlines:
machine name | Identify a remote machine name. The auto-login process searches the file for a machine token that matches the remote machine specified on the ftp command line or as an open command argument. When a match is made, the subsequent tokens are processed, stopping when the end of file is reached or another machine or a default token is encountered. |
default | This is the same as machine name except that default matches any name. There can be only one default token, and it must be after all machine tokens. This is normally used as default login anonymous password user@site, thereby giving the user automatic anonymous ftp login to machines not specified. This can be overridden by using the -n flag to disable auto-login. |
login name | Identify a user on the remote machine. If this token is present, the auto-login process will initiate a login using the specified name. |
password string | 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 file for any user other than anonymous, ftp will abort the auto-login process if the is readable by anyone besides the user. |
account string | 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. |