...> ftp <hostname> [<scriptfile>]
The ftp command establishes a new FTP client session and makes a TCP connection with the FTP server at <hostname>. This uses File Transfer Protocol to exchange data between the systems.
<hostname> must be provided in either IP number or DNS resolvable name.
If <scriptfile> is provided, all subcommands are obtained from the indicated file, otherwise subcommands are read from the console.
The ftp command responds with several status lines acknowledging the process of establishing a new session followed by a request to login on the remote host. After the session is established, the new command prompt is: "FTP>". Once the session is established, a small set of commands is used to manage the file exchange. Some of the commands are executed locally, others are sent to the remote host for execution. The following are JNOS FTP client and server subcommands, however be aware that the server at <hostname> need not be a jnos variety server and may support a slightly different vocabulary:
FTP Subcommands
?Same as "help".
ascii Treat the data to be transferred as ASCII text, so that line endings are used suitable to the receiving system.
batch [y|n] Display the state of the command batching flag when "y/n" is not given. If <y|n> is given, then set the flag appropriately. Batching involves sending as many commands as possible before waiting for responses from <hostname>.
binary Treat the data to be transferred as binary data, that is, verbatim data not to be changed while storing on the receiving system.
cd path Change to directory <path> on system <hostname>.
cdup Change to immediately-superior directory on system <hostname>.
dele file Delete <file> on the remote system.
dir [<spec>] List the contents of the current directory on the remote system, in a verbose manner. If <spec> is given, the subset that matches this file specification is listed. Example:
dir *.exe
get file Transfer <file> from remote system TO the local system.
hash [y|n] Query the state of the hashmark flag, or set it if <y|n> is given. Hashmarks are written to the screen for each 1000 bytes written to the local file system.
help Display all available command names. Same as "?"
lcd path Change to directory <path> on the local system.
ldir spec Same as the dir command, but applied to the local system.
list Same as dir command.
lmkdir dir Create directory <dir> on the local system.
ls spec List just the names in the current directory on the remote system. If <spec> is given, the subset that matches this file specification is listed. Example:
ls *.exe
mdtm file Display the modified-time in GMT for <file> as yyyymmddhhmmss.
mget spec Transfer all files matching <spec> from the remote system TO the local system.
mkdir dir Create directory <dir> on the remote system.
mput spec Transfer all files matching <spec> to the remote system FROM the local system.
nlst Same as ls command.
put file Transfer <file> to the remote system FROM the local system.
quit Close the TCP connection to <hostname> and exit the ftp cmd. See also the JNOS abort command.
reclzw [y|n] Query the state of the ftp client LZW-supported flag, or set it if <y|n> is supplied. LZW compression is only supported for ASCII-type transfers.
rename from to Rename the file named <from> to the name <to> on the remote system.
reget file The RFC959-endorsed way to restart an interrupted get. No check is made to assure the file is consistent between systems; the size of the local <file> is provided to the remote system and a get is issued relative to this point.
restart pos The RFC959-endorsed way to restart a transfer is to first establish a starting offset position and then issue a transfer command to resume at that position. The dir command would be useful to obtain the offset to specify in the restart command, and then a put <file> would cause <file> to be sent starting from the given position.
resume file Restart an interrupted transfer of <file> from the remote system to the local system. Checks are made to assure the file is consistent between systems. This is a JNOS extension to the FTP standard. Other non-compatible equivalents exist in other implementations (c.f. wu-ftpd).
rmdir dir Delete (remove) directory <dir> on the remote system.
rput file Resume an interrupted transfer of <file> to the remote system FROM the local system. Checks are made to assure the file is consistent between systems. This is a JNOS extension to the FTP standard. Other non-compatible equivalents exist in other implementations (c.f. wu-ftpd).
sendlzw [y|n] Query the state of the ftp server LZW-supported flag, or set it if <y|n> is supplied. LZW compression is only supported for ASCII-type transfers.
type [a|b|l] Query the current transfer type value, or set it if <a|b|l> is given. Use
<ascii>,
<binary> (or <image>).
<logical 8> is supported.
view file Transfer <file> from the remote system TO the local system's console screen. The file is assumed to be an ASCII file!
verbose [n] Query verbosity of error handler, or set it if integer <n> is given.
0 => error msgs only
1 => final msg only
2 => control msgs too
3 => control msgs + hash marks
4 => control msgs + byte counts
FTP Syntax & Configuration Rules
Since unrecognized subcommands are sent to the remote ftp server for execution, additional commands may be available depending upon the remote ftp server implementation. For example, the WU-FTPD may accept site-written extensions, and thus allow: site exec <extended_cmd> <cmd_args>.
The remote jnos ftp server will require a login name and password. These values may be provided by NetRcFile by default (see also "Hostfile" in NosCfgFile). The file entry for password may be omitted to instead have the client ftp prompt for it.
Many systems, including JNOS, will reduce the amount of extraneous messages sent, if the password is prepended with a '-'. However, JNOS does not support this when an anonymous login occurs via an MD5 authentication exchange.
