ftp
Quick Reference
Command Name:
ftp
Category:
networking
Platform:
Linux/Unix/Windows
Basic Usage:
Common Use Cases
- 1
Interactive file transfer
Transfer files using an interactive command-line interface
- 2
Website management
Upload and manage files on web hosting servers
- 3
Automated transfers
Use script files to automate file transfer operations
- 4
Remote file management
Create, delete, and organize files on remote FTP servers
Syntax
ftp [options] [host [port]]
Options
Option | Description |
---|---|
-4 | Use IPv4 addresses only |
-6 | Use IPv6 addresses only |
-a | Use anonymous login |
-d | Enable debugging mode |
-e | Disable command line editing |
-i | Turn off interactive prompting during multiple file transfers |
-n | Do not attempt auto-login upon initial connection |
-p | Use passive mode for data transfers |
-s | Enable secure data connection |
-t | Enable packet tracing |
-u | Specify username for connection |
-v | Show all responses from the remote server |
Common Interactive Commands:
Command | Description |
---|---|
ascii | Set transfer mode to ASCII |
binary | Set transfer mode to binary |
bye | Exit FTP session |
cd | Change remote directory |
delete | Delete remote file |
dir | List remote directory contents (verbose) |
get | Download a file |
help | Display help information |
lcd | Change local directory |
ls | List remote directory contents |
mget | Download multiple files |
mkdir | Create remote directory |
mput | Upload multiple files |
passive | Toggle passive mode |
prompt | Toggle interactive prompting |
put | Upload a file |
pwd | Show current remote directory |
quit | Exit FTP session |
rmdir | Remove remote directory |
status | Show current status |
Examples
How to Use These Examples
The examples below show common ways to use the ftp
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
ftp example.com
Connect to an FTP server and enter interactive mode.
ftp -u user@example.com
Connect to a server with a specified username.
ftp example.com 2121
Connect to a server on a non-standard port.
Interactive Mode Commands:
ls
List files in the current remote directory.
cd remote_directory
Change to a different directory on the remote server.
get remote_file [local_file]
Download a file from the remote server to your local machine.