Skip to content

Instantly share code, notes, and snippets.

@amiteshore
Last active September 6, 2022 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amiteshore/c3e8d4ae952327aaf558df5e010d6541 to your computer and use it in GitHub Desktop.
Save amiteshore/c3e8d4ae952327aaf558df5e010d6541 to your computer and use it in GitHub Desktop.
quick `scp` cheatsheet

scp <source> <destination>

example

copy file/directory from local machine to remote server

scp /path/to/file user@host:/path/to/destination

scp -r ~/project/src joe@example.com:~/project

scp ~/project/src/app.js joe@example.com:~/project

scp app.js joe@example.com:~/project

copy file/directory from remote server to locale machine

scp user@host:/path/to/file /path/to/destination

scp -r joe@example.com:~/project/src ~/project

scp joe@example.com:~/project/src/index.js .

scp joe@example.com:~/project/src/index.js ~/foo

scp joe@example.com:~/project/src/index.js /home/jane/foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment