FTP is a standard protocol used to transfer files between a client and server. The ftp program is a command-line interface for this protocol, letting users upload, download, and manage files on remote servers.
ftp abc.xyz.edu
Use the above command to connect to a server. Log in using your credentials or:
anonymousftp> help
Lists all available commands in the FTP session.
ls # List remote files cd [directory] # Change remote directory cd .. # Go to parent directory lcd [directory] # Change local directory pwd # Show current remote directory
ascii # Use for text files binary # Use for binary files (images, zips, etc.)
get image1.jpg # Download a single file mget *.jpg # Download multiple files
put image2.jpg # Upload a single file mput *.jpg # Upload multiple files
delete image.jpg # Delete a remote file mdelete *.jpg # Delete multiple files mkdir newfolder # Create a remote directory rmdir oldfolder # Remove a remote directory
!ls # Run local system command
prompt # Toggle confirmation for multiple transfers
quit # Exit FTP session
| Option | Description |
|---|---|
| -p | Use passive mode (default) |
| -n | Disable auto-login |
| -i | Disable prompts for multiple file transfers |
| -e | Disable command editing |
| -g | Disable filename globbing |
| -v | Verbose mode: show all server replies |
| -d | Enable debug mode |
| Command | Description |
|---|---|
| append | Append a local file to a remote file |
| bell | Ring a bell after each transfer |
| case | Convert UPPERCASE remote filenames to lowercase |
| chmod | Change file permissions on the remote server |
| dir | List directory contents with details |
| glob | Toggle wildcard expansion for file lists |
| macdef | Define a macro for batch commands |
| rename | Rename a file on the remote server |
| status | Show current FTP status |
| type | Show or set file transfer type |
| user | Change login user |
To cancel a transfer, press Ctrl + C. For uploads, transfer stops immediately. For downloads, the remote server must support the ABOR command to stop quickly.
- as filename = use standard input/output|command = pipe to shell command (e.g., dir | more)case, nmap, ntrans, or runiqueThe FTP client is a powerful command-line tool for transferring and managing files remotely. With a mix of basic and advanced features, it remains useful for automated scripts, server maintenance, and managing legacy systems.
Add Comment