ftp (file transfer protocol)

The ftp file transfer protocol allows you to see the directory on the remote Unix machine, put a directory listing of the files on the remote machine into a file on the machine you are working on, and even delete files on the remote machine (useful if you find there is not room to upload that vital file.

Starting ftp

Running ftp involves signing into an account on the remote computer. This only works if the local and remote computers are netwroked. ftp attempts to log in on the remote machine using the same login ID you are currently using on the local machine. To disable automatic login, use the -n flag.

% ftp hostname or
% ftp Start ftp with automatic login to hostname.
% open hostname

% ftp -n hostname or
% ftp -n Start ftp without automatic login.
% open hostname

Usable flags are:
-d enable debugging on ftp itself.
-g disable file name globbing.
-i turn off interactive prompt during multiple file transfers.
-n disable automiatic login.
-v show all responses from remote server.
Filename conventions: A hyphen is stdin or stdout. If the first character of a filename is |, the remainder of the argument is seen as a shell command. Input/output from the shell command is assumed to be stdin or stdout. Example:
ftp> dir | more Use more on the output from the ftp dir command.
If the shell command has spaces, use " as delimiters, as in "/ls -lt". If globbing is enabled, file names are expanded as they are by csh(1)glob.

Simple file transfer

ftp> send local-file remote-file Send local-file to remote computer, where it will be called remote-file. If no remote-file is named, the file will have the local-file name on the remote system.
ftp> get remote-file local-file Receive remote-file from remote computer, calling is given, call it remote-file in the current directory on the local machine.

Other commands

! Make a new shell on the local machine.
append local-file remote-file Add local-file to the end of remote-file.
ascii Set the file transfer type to network ASCII. (default)
bell Ring the bell when each transfer is completed.
binary Set the file transfer type to binary.
bye End the remote login session; return to ftp> prompt.
cd remote-directory Change directories on the remote machine.
close End the remote login session; return to ftp> prompt.
delete remote-file Delete a file on the remote machine.
debug debug-value Turn debugging mode on and off. The integer debug-value controls the debugging level.
dir remote-directory local-file Print directory listing to local-file (terminal, if no loacl-file specified).
form format Change transfer from default file to format.
get remote-file local-file Copy remote-file on the remote machine to local-file.
glob set glob on/off. When enabled, filenames are processed for csh(1) metacharacters such as ? [ ] { }.
hash Print a # for each block of 1024 bytes transferred.
help or help command Give on-line explanations.
lcd directory Change local working directory.
ls remote-directory local-file Make a new shell on the local machine.
mdelete remote-files Delete files on the remote machine.
mdir remote-files local-file Print directory for multiple files.
mget remote-files Copy several remote files to current local directory.
mkdir directory-name Make a new directory on the remote machine.
mls remote-files local file Do an ls on multiple files.
mode mode-name Default mode is stream.
mput local-files Transfer multiple local files to remote machine.
open hostname Connect to hostname.
prompt Enable/disable interactive prompting on mget and mput commands.
put local-file remote-file Copy local-file to remote-file on the remote machine.
pwd Give the current working directory on the remote machine.
quit Same as bye.
quote arg1 arg2... Send the arguments exactly as given to the remote ftp server.
recv remote-file local-file Same as get.
remotehelp command-name Online help on the remote machine.
rename fromfile tofile Change a filename on the remote machine.
rmdir directory name Delete a remote directory.
send local-file remote-file Same as put.
sendport Enable/disable use of PORT command.
status Show current ftp status.
strct struct-name Set file transfer structure. Default is stream.
tenex Set the file transfer type to work with TENEX machines.
trace Enable/disable packet tracing.
type type-name Change transfer type. If none specified, show the current type. Default is network ASCII.
user username password account Login to remote server. If account or password is needed and not supplied, you will be prompted.
verbose Set verbose on/off. When on, all ftp responses are displayed. On is default.
? Same as help.


Previous Page
Index