Command line FTP

The ftp command can be used to copy files to and from a remote machine. Command line FTP is one way of using FTP. There are others, like using your browser's FTP capabilities (Link opens in this window Using Netscape for FTP), or using one of the freeware programs available on the net.

Switching to MS-DOS

If you're using Windows, you'll have to switch to DOS first. Click the 'Start' button at the bottom left corner of your screen. Select 'programs'. Select 'MS-DOS prompt'. This will blank out your screen, except for a directory name at the bottom of the screen (usually C:\Windows) followed by a >. This is the so-called command line. You can't use your mouse here. Anything you want to do here needs to be accomplished by typing commands at the command line and hitting enter.

Starting from the right directory

When you start up MS-DOS, you will probably be in a directory called C:\Windows. Your command line prompt will show you your current directory.

If you want to use FTP to upload files, you need to go to the directory where your files are. It is easiest to do this before starting up the actual FTP session. For this purpose, you can use the following commands. The commands are not case-sensitive.

cd .. will take you one level upwards in the directory structure;
cd directoryname will take you one level downwards in the directory structure, to the directory with the specified name;
dir will show you a list of subdirectories and files in your current directory.

Starting the FTP session

Start FTP by typing ftp servername.com at the command line and hitting enter, replacing 'servername' with the name of the server you want to access. Enter your user-id and password when asked to do so (some servers allow anonymous FTP access, often requiring you to enter 'anonymous' as your user-id and a valid email address as your password).

Navigation

If you need to navigate from one directory to another on your local machine, you can use lcd .. and lcd directoryname. Note that these commands slightly differ from the ones you had to use before starting the FTP session.

On the remote machine, you can use cd .. and cd directory name to navigate. To see your current directory on the remote machine, enter pwd.

File transfer

Before downloading or uploading files, you'll need to specify the kind of files you will be transferring. You either enter ascii, for text and HTML files, or binary, for other file types, like graphics.

Enter get filename.extension to download a file. Enter put filename.extension to upload one file. Enter mput *.* to upload all files in your current directory. Enter mkdir to make a directory, and rmdir to remove one. Enter delete filename.extension to remove a file from your current directory.

Ending the FTP session

Enter quit to end the FTP session. This wil sever your connection with the remote machine.

Returning to Windows

If you're using Windows on your local machine, enter exit to return to Windows.



With the exceptions listed here, all content © 2001-2004 D9D1E2.COM. Please read the disclaimer, copyright information and terms of use. On this page Transitional HTML 4.01 and CSS 1 are used. If you're seeing this text you either have CSS switched off in your browser, or you're using a browser that can't handle CSS. If you're using an older browser version, you might want to consider upgrading.