To connect to a remote computer using FTP, type ftp hostname. Hostname can be an IP address or a hostname (usually referenced in a DNS server).

Common commands for FTP:

  • open
    Opens a connection to a specified host.

  • close
    Closes the currently open connection.

  • quit
    Close the current open session and exit FTP.

  • binary
    Change the file representation type to binary. Useful for downloading non-text files.

  • ascii
    Change the file representation type to ASCII. Useful for transferring text files.

  • put
    Transfer a single file from your machine to a remote machine.

  • mput
    Transfer multiple files from your machine to the remote machine.

  • get
    Transfer a single file from a remote machine to yours.

  • mget
    Transfer multiple files from a remote machine to yours.

  • cd
    Change the remote machine's current directory.

  • lcd
    Change the local machine's current directory.

  • cdup
    Change the remote machine's current directory up one to the parent directory. Same as UNIX cd .. command.

  • dir
    List the remote machine's current directory. Same as UNIX ls command.

  • pwd
    Display the remote machine's present working directory.

  • mkdir
    Make a new directory on the remote machine.

  • rmdir
    Remove a directory on the remote machine.

  • rename
    Change the name of a file or directory on a remote machine.

  • delete
    Delete a file on a remote machine. Note: see rmdir for removing a directory.

  • mdelete
    Delete multiple files on a remote machine.

  • ?
    Obtain help about FTP. Usually displays listing of commands. Typing ? and a command name will display info about that command.

  • !
    Escape the shell.

    If you are having problems executing files that you download with FTP, check your transfer type. It may be set to ASCII.

    To save time in UNIX, you can set up a .netrc file that contains your logon, password and account to use. Make sure that it is in your home directory and is unreadable by other folks. Remember, Mr. Root can see and play with everything, so don't include sensitive passwords.

    Even if you are using a Windows program to transfer files via FTP, the interface just makes things easier by associating commands to icons. The GUI interface just hides the scary command-line interface. For all the pretty graphics, the thing still runs on commands issued for the FTP protocol.