-->

Previous | Table of Contents | Next

Page 150

mdir remote-files local-file Like dir, except multiple remote files may be specified. If interactive prompting is on, ftp will prompt the user to verify that the last argument is indeed the target local file for receiving mdir output.
mget remote-files Expand the remote-files on the remote machine and do a get for each filename thus produced. See glob for details on the filename expansion. Resulting filenames will then be processed according to case, ntrans, and nmap 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.
mkdir directory-name Make a directory on the remote machine.
mls remote-files local-file Like nlist, except multiple remote files may be specified, and the local-file must be specified. If interactive prompting is on, ftp will prompt the user to verify that the last argument is indeed the target local file for receiving mls output.
mode [mode-name] Set the file transfer mode to mode-name. The default mode is stream mode.
modtime file-name Show the last modification time of the file on the remote machine.
mput local-files Expand wildcards in the list of local files given as arguments and do a put for each file in the resulting list. See glob for details of filename expansion. Resulting filenames will then be processed according to ntrans and nmap settings.
newer file-name 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 newer. Otherwise, this command is identical to get.
nlist [remote-directory] [local-file] Print a list of the files in a directory on the remote machine. If remote-directory is left unspecified, the current working directory is used. If interactive prompting is on, ftp will prompt the user to verify that the last argument is indeed the target local file for receiving nlist output. If no local file is specified, or if local-file is -, the output is sent to the terminal.
nmap [inpattern] outpattern 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 mput commands and put commands issued without a specified remote target filename. If arguments are specified, local filenames are mapped during mget commands and get commands issued without a specified local target filename. This command is useful when connecting to a non-UNIX remote computer with different file naming conventions or practices. The mapping follows the pattern set by inpattern and outpattern. Inpattern is a template for incoming filenames (which may have already been processed according to the ntrans and case settings). Variable templating is accomplished by including the sequences $1, $2,..., $9 in inpattern. Use \ to prevent this special treatment of the $ character. All other characters are treated literally, and are used to determine the nmap inpattern variable values. For example, given inpattern $1.$2 and the remote filename mydata.data, $1 would have the value mydata, and $2 would have the value "data". The outpattern determines the resulting mapped filename. The sequences $1, $2,...., $9 are replaced by any value resulting from the inpattern template. The sequence $0 is replaced by the original filename. Additionally, the sequence seq1, seq2 is replaced by seq1 if seq1 is not a null string; otherwise, it is replaced by seq2. For example, the command nmap $1.$2.$3 [$1,$2].[$2,file] would yield the output filename myfile.data for input filenames my-file. data and myfile.data.old, myfile.file for the input filename my-file, 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.
ntrans [inchars] [outchars] 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 mput commands and

Page 151

put commands issued without a specified remote target filename. If arguments are specified, characters in local filenames are translated during mget commands and get commands issued without 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 inchars are replaced with the corresponding character in outchars. If the character's position in inchars is longer than the length of outchars, the character is deleted from the filename.
open host [port] Establish a connection to the specified host FTP server. An optional port number may be supplied, in which case, ftp will attempt to contact an FTP server at that port. If the auto-login option is on (default), ftp will also attempt to automatically log the user in to the FTP server (see below).
prompt 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 mget or mput will transfer all files, and any mdelete will delete all files.
proxy ftp-command 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 proxy command should be an open, 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 proxy :, open will not define new macros during the auto-login process, close will not erase existing macro definitions, get and mget transfer files from the host on the primary control connection to the host on the secondary control connection, and put, mput, and append 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.
put local-file [remote-file] Store a local file on the remote machine. If remote-file is left unspecified, the local filename is used after processing according to any ntrans or nmap settings in naming the remote file. File transfer uses the current settings for type, format, mode, and structure.
pwd Print the name of the current working directory on the remote machine.
quit A synonym for bye.
quote arg1 arg2... The arguments specified are sent, verbatim, to the remote FTP server.
recv remote-file [local-file] A synonym for get.
reget remote-file [local-file] Reget acts like get, except that if local-file exists and is smaller than remote-file, local-file is presumed to be a partially transferred copy of remote-file and the transfer is continued from the apparent point of failure. This command is useful when transferring very large files over networks that are prone to dropping connections.
remotehelp [command-name] Request help from the remote FTP server. If a command-name is specified, it is supplied to the server as well.
remotestatus [file-name] With no arguments, show status of remote machine. If file-name is specified, show status of file-name on remote machine.
rename [from] [to] Rename the file from on the remote machine, to the file to.
reset Clear reply queue. This command resynchronizes command/reply sequencing with the remote FTP server. Resynchronization may be necessary following a violation of the FTP protocol by the remote server.
restart marker Restart the immediately following get or put at the indicated marker. On UNIX systems, marker is usually a byte offset into the file.

Previous | Table of Contents | Next