buymeasoda RefDocs
  • Overview
  • General
    • Android
    • Apache
    • Fish
    • Git
    • Github
    • Gmail
    • Homebrew
    • iOS
    • iTerm
    • MacOS
    • MacPorts
    • Mamp
    • Media
    • Mercurial
    • MySQL
    • Node
    • npm
    • nvm
    • Obsidian
    • PHP
    • React Native
    • Rust
    • Server
    • Slack
    • Sourcegraph
    • Tools
    • Vim
    • VS Code
    • Yarn
  • Unix
    • Checksum and hash utilities
    • Command line history
    • Command line keyboard shortcuts
    • Compress files and folders
    • Crontab
    • Diff files and folders
    • Disk usage and file sizes
    • Find and search files
    • Firewall configuration
    • Help and manual pages
    • HostName and Local HostName for Mac OSX
    • Navigating the file system
    • Network, domains and routing
    • Run and manage background tasks
    • Secure FTP SFTP and Secure Copy SCP
    • Secure Shell SSH
    • Sync files and folders
    • System and process management
    • System and user information
    • Useful characters
    • Useful commands
    • User, file and group permissions
    • Working with cURL
    • Working with files and directories
    • Working with text
Powered by GitBook
On this page
  • SFTP
  • SCP
  • SCP Current directory / files
  • SCP Examples
  1. Unix

Secure FTP SFTP and Secure Copy SCP

SFTP

Connect to remote server using sftp (add -oPort=<port> if port is required)

sftp <user>@<host>

A subset of standard unix commands are available while connected.

Upload a file

put <local> <remote>

Download a file

get <remote> <local>

Quit sftp

bye
exit

SCP

Secure copy files to or from remote server (with custom port -P <port>)

scp <source> <destination>

For destination, specify the remote server, then remote path/file separated by a colon

<user>@<host>:<path/file>

Specify local file using local system path. Use a single dot to indicate current directory. Use lowercase r for recursive copy.

SCP Current directory / files

Copy all files in the current directory to a remote directory

scp * <user>@<host>:<path>

Recursively copy files and directories from current directory to remote directory

scp -r * <user>@<host>:<path>

Quote source / destination paths when using wildcards for Fish Shell

"/path/with/wildcard/*"

SCP Examples

Copy a remote file on server user@host, located at path/file, to the local path

scp <user>@<host>:<path/file> <local path>

Copy a local file at path/file to another remote server

scp <local path/file> <user>@<host>:<path>

Recursively copy the files and folders from local dir to the remote server home directory

scp -r <local dir> <user>@<host>:~
PreviousRun and manage background tasksNextSecure Shell SSH

Last updated 3 years ago