Catalog / SFTP Command Cheat Sheet
SFTP Command Cheat Sheet
A quick reference guide for Secure File Transfer Protocol (SFTP) commands, covering basic operations, file management, permissions, and advanced usage.
Basic SFTP Commands
Connecting to a Server
|
Connect to |
|
Connect to |
|
Connect using the key specified by |
|
Connect to |
|
Terminate the SFTP session. |
Navigating the SFTP Environment
|
Print working directory on the remote host. |
|
Print working directory on the local host. |
|
Change remote directory to |
|
Change local directory to |
|
List files in the current remote directory. |
|
List files in the current local directory. |
|
Show more details about files in the current remote directory. |
File Transfer Operations
|
Download |
|
Download |
|
Upload |
|
Upload |
|
Download multiple |
|
Upload multiple |
File Management
Basic File Operations
|
Create a new directory on the remote server. |
|
Remove a directory on the remote server (must be empty). |
|
Remove a file on the remote server. |
|
Rename a file or directory on the remote server. |
|
Create a symbolic link on the remote server. |
File Permissions
|
Change permissions of a file or directory on the remote server. |
|
Change the owner of a file or directory on the remote server. |
|
Change the group of a file or directory on the remote server. |
|
Display file or directory attributes. |
File Transfer Options
|
Resume downloading |
|
Resume uploading |
|
Example: |
|
Download with preservation of modification times, access times, and modes. |
|
Upload with preservation of modification times, access times, and modes. |
Advanced SFTP Usage
Command Execution
|
Execute a local shell command. Example: |
|
Display the SFTP version. |
|
Get help on SFTP commands. If no command is given, it prints general help. |
Batch Processing
|
Run SFTP commands from a |
Example batch file: |
|
|
Read commands from standard input. |
Configuration
|
You can pre-define connection settings in your SSH configuration file. This allows you to use shorthand commands. Example:
Then connect with: |
Troubleshooting and Tips
Common Errors
Permission Denied: |
Connection Refused: |
File Not Found: |
SFTP Tips
Tab Completion: |
Wildcards: |
Quoting: |
Batch Scripting: |