Skip to main content

FTP Cheatsheet

By Dejan Panovski Updated on Download PDF

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.

CommandDescription
ftp hostnameConnect to server
ftp 192.168.1.10Connect by IP
ftp hostname 21Connect to a custom port
user usernameLog in with username (prompts for password)
user username passwordLog in with username and password
quitQuit session
byeQuit session (alias for quit)

Local and Remote Paths

Navigate directories on both sides.

CommandDescription
pwdShow remote working directory
!pwdShow local working directory
cd /remote/pathChange remote directory
lcd /local/pathChange local directory
lsList remote files
!lsList local files

Download Files

Transfer files from remote server to local system.

CommandDescription
get file.txtDownload one file
get remote.txt local.txtDownload and rename locally
mget *.logDownload multiple files
promptToggle interactive prompt for mget
reget large.isoResume interrupted download

Upload Files

Transfer local files to remote server.

CommandDescription
put file.txtUpload one file
put local.txt remote.txtUpload with remote name
mput *.txtUpload multiple files
append file.txtAppend local file to remote file

Transfer Modes

Select ASCII or binary mode as needed.

CommandDescription
binarySet binary transfer mode
asciiSet text transfer mode
typeShow current transfer mode
hashShow transfer progress marks
statusDisplay session and transfer status

Remote File Management

Manage files and directories on the FTP server.

CommandDescription
mkdir dirnameCreate remote directory
rmdir dirnameRemove remote directory
delete file.txtDelete remote file
mdelete *.tmpDelete multiple remote files
rename old.txt new.txtRename remote file
size file.isoShow remote file size

Connection and Safety

Useful options to avoid transfer issues.

CommandDescription
passiveToggle passive mode
debugToggle protocol debug output
verboseToggle verbose transfer output
closeClose connection, keep FTP shell
open hostnameReconnect to another host
!commandRun a local shell command
helpList available FTP commands

Batch and Non-Interactive

Run FTP commands from scripts.

CommandDescription
ftp -n hostnameDisable auto-login
ftp -inv hostnameScript-friendly mode
ftp hostname < commands.txtRun commands from file

Safer and encrypted alternatives when possible.

ToolDescription
sftpSSH-based secure file transfer
scpSecure copy over SSH
rsyncEfficient sync and incremental transfer