Some of the following common commands may be used in a typical FTP session:
ascii Sets an ASCII file transfer type for the FTP session. You use this command before file transfers when sending or receiving text files.
bin Sets a binary file-type transfer for the FTP session. Use it before file transfers to send or receive binary files such as graphics images or compressed archives.
ciose Closes a connection to a remote server during an FTP session. Use this command instead of quit to return to the ftp command prompt.
get Initiates a transfer of a single file from the FTP server to the user's local machine. Use this command to retrieve a single file (such as get cartoon.jpg).
hash Sets use of a hash mark (#) during file transfer. Use this command to get a visual indication of the progress of a transfer.
mget Initiates a transfer of multiple files from the FTP server to the user's local machine. Use this command to download (receive) multiple files with a single command (such as mget *.jpg).
mput Initiates a transfer of multiple files from the user's local machine to the FTP server. Use this command to upload (send) multiple files with a single command (such as mput *.jpg).
open Opens a connection to a remote server using an IP address or hostname. Use this command when working at the ftp command prompt (such as open ftp.redhat.com).
prompt Is an interactive command that asks the user for input on whether to get a specific file when the mput or mget command is issued. If the user initiates an mget *, with prompting on, the FTP client will prompt the user to transfer each file that the * wildcard matches. This can be particularly useful when several files in a directory need to be transferred, with one or two files that are unwanted. By default, prompting is turned on.
put Initiates the transfer of a single file from the user's local machine to the FTP server. Use this command to upload (send) a single file (such as put inventory.doc).
quit Use this command to close the FTP connection and quit the ftp command.
These are just some of the commands available during an FTP session. By typing help, the user can see a full list of valid commands. Typing help command-name displays a brief description of what that command does. Listing 23.1 shows the help output.
Was this article helpful?