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

CommandWhat it doesExample
openConnect to an FTP server (prompts for username and password).open ftp.example.com
userLog in again or as a different user on the open connection.user alice
close / disconnectEnd the server connection but stay in the FTP program.close
bye / quitClose the connection and exit the FTP program.bye
statusShow current session settings (mode, type, toggles).status
!Drop to the local shell; type exit to return to ftp>.!dir

Downloading & uploading

CommandWhat it doesExample
get / recvDownload one file from the server.get report.pdf
put / sendUpload one file to the server.put backup.zip
mgetDownload multiple files (wildcards allowed).mget *.log
mputUpload multiple files (wildcards allowed).mput *.html
appendAppend a local file to a file on the server.append part2.txt log.txt
deleteDelete one file on the server.delete old.bak
mdeleteDelete multiple files on the server (wildcards allowed).mdelete *.tmp
renameRename a file on the server.rename a.txt b.txt

Browsing directories

CommandWhat it doesExample
dir / lsList files in the current remote directory.dir
cdChange the remote directory.cd /public_html
lcdChange the local directory used for transfers.lcd C:\Downloads
pwdPrint the current remote directory.pwd
mkdirCreate a directory on the server.mkdir images
rmdirRemove an empty directory on the server.rmdir old-site

Transfer settings & toggles

CommandWhat it doesExample
binarySwitch to binary (image) mode - use for zip, images, executables, media. Always set this before downloading non-text files.binary
asciiSwitch to ASCII text mode (line-ending conversion). Default in many clients.ascii
promptToggle per-file confirmation for mget/mput/mdelete.prompt
hashPrint a # for each block transferred - a poor man's progress bar.hash
verboseToggle display of server responses.verbose
literal / quoteSend a raw protocol command (see the table below) directly to the server.literal SYST
remotehelpAsk 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

Is ftp.exe still included in Windows 11?

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.

Why does ftp.exe fail behind a firewall or router?

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.

What is the difference between FTP client commands and FTP protocol commands?

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.

Can ftp.exe connect to SFTP or FTPS servers?

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.

How do I script FTP transfers on Windows?

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