ftp



Copyright Phillip Farrell. Last revision May 10, 2007

Ftp is the original Internet standard file transfer program. It sends your password over the network in plain text format. Use the ssh family of programs instead to encrypt your password and data when transferring files. The ftp protocol is really only appropriate now for file distribution via anonymous ftp.

This web page describes basic usage instructions for the ftp program that is built-in to all Unix and Linux systems and accessed from a shell command-line window.

PCs running the Windows or Mac OS X operating systems also have a built-in command line ftp program that can be used the same way as the Unix version described here. On Windows, open a Command Prompt window by selecting the Run command from the Start menu, and then typing cmd.exe and pressing the RETURN key. On Mac OS X, open the Terminal application in the Utilities subfolder of the Applications folder. Then follow the instructions below. There are also many ftp programs available for Windows and Mac OS X that use a graphical interface.

Start an ftp file transfer session to a remote computer by typing the command

ftp hostname

You substitute the IP hostname or address of the remote computer for hostname.

You will be prompted to enter a user account and password on the remote system. Some machines that serve as "public archives" have an account named anonymous that requires no password - you type in your email address (for identification only) in response to the password prompt.

Once connected to the remote system, you give commands to the ftp program to manipulate the files on the remote system or copy files between the two systems. You specify directory and file names in the syntax specific to each system. For example, if using ftp to go from a Unix to a VMS system, your local (Unix) directories and filenames are specified in the normal Unix style, for example, /home/ges/joe/file, but your remote (VMS) directories and filenames are specified in the VMS style, for example, disk1:[dir.sub]file.type;1

Your file manipulations are limited by the normal file permissions of your account on each system. For anonymous ftp, you are normally allowed only read access to the remote site, and only to specific directories (usually, the pub or public directory trees).

The actual ftp commands are the same regardless of type of system. Most commonly used commands:

Other commands within ftp give you more control of the method of transfer, let you delete or rename files on the remote system, or even connect to two remote systems and do a third party transfer between them. Check man ftp on pangea for more information.