FTP Commands
These commands can be used in a file transfer protocol (FTP) command-line interface.
| Command | Function | Example(s) |
|---|---|---|
| ftp | Connect to an FTP server (type this command in the terminal window to begin an FTP session) |
ftp ftp ftp.servername.com ftp 123.456.789.012 |
| open | Opens a connection with an FTP server |
open ftp.servername.com |
| help OR ? | Display a list of commands | help |
| ? [command] | Display helpful information about a command | ? chmod |
| pwd | Display the current directory on the FTP server | pwd |
| cd | Change the directory on the FTP server | cd www (open the "www" directory) cd .. (move up one directory) |
| lcd | Chage the directory on your local computer | lcd Documents |
| ls OR dir | List the contents of a directory | ls |
| rename | Rename a file | rename test1.html test2.html |
| delete | Delete a file | delete test.html |
| mkdir | Create a new directory | mkdir testing |
| rmdir | Remove an existing directory | rmdir testing |
| ascii | Set the file transfer mode to ASCII text | ascii |
| binary | Set the file transfer mode to Binary | binary |
| get | Retrieves a file from the FTP server | get test1.php Documents/test2.php |
| put | Sends a file to the FTP server | put Documents/test1.php test2.php |
| mget | Retrieves multiple files from the FTP server (requires "Y" or "N" before downloading each file) |
mget test1.php test2.php test3.php |
| mput | Sends multiple files to the FTP server (requires "Y" or "N" before sending each file) |
mput test1.php test2.php test3.php |
| close | Close the current FTP session | close |
| quit, exit, or bye | Exit the FTP program | quit |