FTP Cheatsheet
Quick reference for Linux FTP client commands and file transfer workflows
FTP is a classic file transfer protocol and command-line client used to upload and download files from remote servers. This cheatsheet covers common FTP commands for login, navigation, transfers, and session management.
Connect and Login
Start an FTP session and authenticate.
| Command | Description |
|---|---|
ftp hostname | Connect to server |
ftp 192.168.1.10 | Connect by IP |
ftp hostname 21 | Connect to a custom port |
user username | Log in with username (prompts for password) |
user username password | Log in with username and password |
quit | Quit session |
bye | Quit session (alias for quit) |
Local and Remote Paths
Navigate directories on both sides.
| Command | Description |
|---|---|
pwd | Show remote working directory |
!pwd | Show local working directory |
cd /remote/path | Change remote directory |
lcd /local/path | Change local directory |
ls | List remote files |
!ls | List local files |
Download Files
Transfer files from remote server to local system.
| Command | Description |
|---|---|
get file.txt | Download one file |
get remote.txt local.txt | Download and rename locally |
mget *.log | Download multiple files |
prompt | Toggle interactive prompt for mget |
reget large.iso | Resume interrupted download |
Upload Files
Transfer local files to remote server.
| Command | Description |
|---|---|
put file.txt | Upload one file |
put local.txt remote.txt | Upload with remote name |
mput *.txt | Upload multiple files |
append file.txt | Append local file to remote file |
Transfer Modes
Select ASCII or binary mode as needed.
| Command | Description |
|---|---|
binary | Set binary transfer mode |
ascii | Set text transfer mode |
type | Show current transfer mode |
hash | Show transfer progress marks |
status | Display session and transfer status |
Remote File Management
Manage files and directories on the FTP server.
| Command | Description |
|---|---|
mkdir dirname | Create remote directory |
rmdir dirname | Remove remote directory |
delete file.txt | Delete remote file |
mdelete *.tmp | Delete multiple remote files |
rename old.txt new.txt | Rename remote file |
size file.iso | Show remote file size |
Connection and Safety
Useful options to avoid transfer issues.
| Command | Description |
|---|---|
passive | Toggle passive mode |
debug | Toggle protocol debug output |
verbose | Toggle verbose transfer output |
close | Close connection, keep FTP shell |
open hostname | Reconnect to another host |
!command | Run a local shell command |
help | List available FTP commands |
Batch and Non-Interactive
Run FTP commands from scripts.
| Command | Description |
|---|---|
ftp -n hostname | Disable auto-login |
ftp -inv hostname | Script-friendly mode |
ftp hostname < commands.txt | Run commands from file |