Catalog / FTP Commands Cheatsheet
FTP Commands Cheatsheet
A quick reference guide to commonly used FTP (File Transfer Protocol) commands. This cheat sheet covers basic commands for connecting to FTP servers, navigating directories, uploading, and downloading files. It's designed for users interacting with FTP through a command-line interface.
Basic FTP Commands
Connection and Authentication
|
Connects to the specified FTP server. |
|
Opens a connection to the specified host. |
|
Specifies the username for login. |
|
Specifies the password for the user. |
|
Sends a supplemental account password required by some systems. |
|
Closes the current FTP connection. |
|
Terminates the FTP session and exits. |
Navigation
|
Prints the current working directory on the remote server. |
|
Lists the files and directories in the current remote directory. |
|
Changes the current directory on the remote server. |
|
Changes to the parent directory on the remote server. |
|
Generates a listing of the specified remote files. |
File Transfer Commands
Downloading Files
|
Downloads a single file from the remote server. If |
|
Downloads multiple files from the remote server using wildcard characters. |
|
Alias for |
Uploading Files
|
Uploads a single file to the remote server. If |
|
Uploads multiple files to the remote server using wildcard characters. |
|
Alias for |
|
Appends a local file to a remote file. If the remote file doesn’t exist, it will be created. |
|
Upload multiple files using wildcards. |
File Management
|
Deletes a file on the remote server. |
|
Deletes multiple files on the remote server using wildcard characters. |
|
Renames a file on the remote server. |
|
Creates a new directory on the remote server. |
|
Removes a directory on the remote server. |
Advanced FTP Commands
Transfer Modes
|
Sets the transfer mode to ASCII (text) mode. |
|
Sets the transfer mode to binary mode. Essential for non-text files like images or executables. |
|
Alias for |
|
Sets the file transfer type. Use |
Other Useful Commands
|
Displays the current status of the FTP connection. |
|
Shows the type of operating system running on the remote server. |
|
Displays help information for the specified FTP command. |
|
Escapes to the local shell. |
|
Toggles prompting during multiple file transfers. Useful to turn off for automated scripts. |
|
Toggles verbose mode. When on, displays more detailed output. |
Passive and Active Modes
Understanding Transfer Modes
FTP can operate in two modes: Active and Passive. These modes define how the data connection (used for transferring files) is established. The choice of mode is often determined by firewall configurations. |
Active Mode
How it Works: |
The client initiates the control connection (port 21). The server initiates the data connection back to the client (port > 1023). |
Problems: |
Firewalls often block incoming connections to the client, making active mode problematic. |
Passive Mode
How it Works: |
The client initiates both the control connection (port 21) and the data connection (port > 1023) to the server. |
Advantages: |
More firewall-friendly as the client initiates all connections. |
Command: |
|