FTP Example

There are many commands that can be used at the ftp prompt and users should refer to the manual page for full descriptions of all ftp interpreter commands.

Listing a Directory. Usually, the first command after making a connection is to list the contents of the directory. At the ftp prompt, type `ls' for a short-format listing or `dir' for a long-format listing.

Changing Directories. The next action you may want to take is to change to a subdirectory, which can be accomplished by typing `cd remote-directory' where `remote-directory' is the desired directory.

Transferring Files. Other important commands are the get and put commands, for example `get remote-filename local-filename' gets a file named `remote-filename' from the remote machine and stores it as `local-filename' on the local machine. If the file is not just plain text (an executable for example), you may want to change to binary mode by entering the `binary' command before your file tranfer. To transfer multiple files, type `prompt off' and use the `mput' or `mget' commands with a file specification to match files, for example `mget *.c' to get all files with a `.c' extension. To abort a file transfer, use the terminal interrupt key (usually CTRL-C). Once you have ftp'ed files from remote system(s), you can view or edit
text file(s) using your editor, run binaries for Sun Sparcstations from the Unix shell, or download file(s) to your home computer.

Exiting. To terminate the ftp connection with the reomte server and exit ftp, type `bye' or `quit'.

0 comments