FTP Commands: Client & Protocol Reference
Every FTP command in one place - the command-line client commands you type into Windows ftp.exe, macOS, or Linux (get, put, mget, bye), and the raw RFC 959 protocol commands they translate into on the wire.
Updated July 2026
Command-line FTP client commands
These commands work in the interactive FTP clients built into Windows (ftp.exe), macOS, and Linux. Start a session with ftp hostname (or open hostname from the ftp> prompt), then use the commands below. For a full Windows walkthrough with scripting, see the guide FTP from the Command Line on Windows.
Session & connection
| Command | What it does | Example |
|---|---|---|
open | Connect to an FTP server (prompts for username and password). | open ftp.example.com |
user | Log in again or as a different user on the open connection. | user alice |
close / disconnect | End the server connection but stay in the FTP program. | close |
bye / quit | Close the connection and exit the FTP program. | bye |
status | Show current session settings (mode, type, toggles). | status |
! | Drop to the local shell; type exit to return to ftp>. | !dir |
Downloading & uploading
| Command | What it does | Example |
|---|---|---|
get / recv | Download one file from the server. | get report.pdf |
put / send | Upload one file to the server. | put backup.zip |
mget | Download multiple files (wildcards allowed). | mget *.log |
mput | Upload multiple files (wildcards allowed). | mput *.html |
append | Append a local file to a file on the server. | append part2.txt log.txt |
delete | Delete one file on the server. | delete old.bak |
mdelete | Delete multiple files on the server (wildcards allowed). | mdelete *.tmp |
rename | Rename a file on the server. | rename a.txt b.txt |
Browsing directories
| Command | What it does | Example |
|---|---|---|
dir / ls | List files in the current remote directory. | dir |
cd | Change the remote directory. | cd /public_html |
lcd | Change the local directory used for transfers. | lcd C:\Downloads |
pwd | Print the current remote directory. | pwd |
mkdir | Create a directory on the server. | mkdir images |
rmdir | Remove an empty directory on the server. | rmdir old-site |
Transfer settings & toggles
| Command | What it does | Example |
|---|---|---|
binary | Switch to binary (image) mode - use for zip, images, executables, media. Always set this before downloading non-text files. | binary |
ascii | Switch to ASCII text mode (line-ending conversion). Default in many clients. | ascii |
prompt | Toggle per-file confirmation for mget/mput/mdelete. | prompt |
hash | Print a # for each block transferred - a poor man's progress bar. | hash |
verbose | Toggle display of server responses. | verbose |
literal / quote | Send a raw protocol command (see the table below) directly to the server. | literal SYST |
remotehelp | Ask the server which protocol commands it supports. | remotehelp |
help / ? | List client commands, or explain one. | help mget |
A typical session
C:\> ftp ftp.example.com Connected to ftp.example.com. User: alice Password: ******** ftp> binary 200 Type set to I. ftp> cd /backups 250 CWD command successful. ftp> hash Hash mark printing On. ftp> get site-backup.zip 226 Transfer complete. ftp> mput *.log mput access.log? y 226 Transfer complete. ftp> bye 221 Goodbye.
Working over SSH instead? The OpenSSH sftp client uses a similar but distinct command set - see the SFTP Command Reference. And if the server refuses to connect at all, rule out network issues first with the FTP Connection Tester.
Raw FTP protocol commands (RFC 959)
These are the commands FTP clients actually send over the control connection - useful when reading server logs, debugging with literal/quote, or implementing FTP yourself. Search or filter by category.
About FTP commands
FTP protocol commands are sent by the client to the server over the control connection (port 21 by default). The server responds with a 3-digit status code. The core protocol is defined in RFC 959, with extensions defined in RFCs 2228, 2389, 2640, 3659, and 4217.
Looking for what server response codes mean? Check the FTP Response Code Lookup tool.
Common questions
Yes. The classic command-line FTP client ships with Windows 11 and Windows 10 - open Command Prompt or PowerShell and type ftp to start it. It supports plain FTP only, so it cannot connect to SFTP or FTPS servers.
Windows ftp.exe only supports active mode, where the server connects back to your PC for every data transfer. Most home routers and corporate firewalls block those incoming connections, so directory listings and transfers hang after login. Clients that support passive mode (PASV) - including virtually every graphical FTP client - avoid the problem.
Client commands like get, put, mget, and bye are what you type into a command-line FTP program. The program translates them into raw protocol commands (RETR, STOR, PASV, QUIT) defined by RFC 959, which are what actually travel over the wire to the server. For example, typing get report.pdf sends TYPE I, PASV or PORT, and RETR report.pdf behind the scenes.
No. Windows ftp.exe speaks plain, unencrypted FTP only. For SFTP you need the OpenSSH sftp command (also built into Windows 10 and 11) or a client that supports it. For FTPS (FTP over TLS) you need a client with explicit or implicit TLS support - ftp.exe has neither.
Put one command per line in a text file and run ftp -s:commands.txt hostname. The file typically starts with the username and password on separate lines, followed by transfer commands like binary, get or put, and bye. Note that the password is stored in plain text and the connection is unencrypted, so scheduled or unattended jobs are better served by a tool with SFTP/FTPS support and a real scheduler.
Prefer not to memorize commands?
FTPie is a modern FTP & FTPS client for Windows with drag-and-drop transfers, passive mode that just works through firewalls, and SFTP, WebDAV, and 10+ cloud services in the same app - free for up to 3 server connections.
Download FTPie Free