copy from remote to local
# Basic syntax:
scp source destination
# Note, usually one or both of "source" and "destination" are remote
# (otherwise you'd just use cp for a local copy)
# To specify a local source or destination, just use the directory path
# To specify a remote destination, the format is:
# [email protected]:/path/to/directory
# Example usage:
scp /Users/name/Downloads/*.txt [email protected]:/path/to/directory
# In this example, you'd be uploading all text files from your downloads
# to the remote server
scp [email protected]:/path/to/directory/*png /Users/name/Downloads
# In this example, you'd be downloading all png files from the remote
# server to your downloads directory
scp [email protected]:/path/to/directory/my_favorite_file.txt [email protected]:/path/to/directory
# In this example, you'd be moving a file from one remote server to
# another remote server
scp -r [email protected]:/path/to/directory /Users/name/Downloads
# In this example the -r flag is used to state that this is a recursive
# download, meaning that all files and subdirectories in the directory
# will be downloaded to the local Downloads directory
Are there any code examples left?
New code examples in category Shell/Bash
-
Shell/Bash 2022-03-27 22:30:33 wise highlight ubuntu
-
Shell/Bash 2022-03-27 22:25:19 how to send a pull request in git
-
Shell/Bash 2022-03-27 21:55:06 how to open terminal in sublime text ubuntu
-
Shell/Bash 2022-03-27 21:25:19 how to switch branch
-
Shell/Bash 2022-03-27 21:20:25 python
-
Shell/Bash 2022-03-27 21:20:04 set user as admin gitlab
-
Shell/Bash 2022-03-27 21:10:09 apache2 mod_jk proxy to tomcat connector
-
Shell/Bash 2022-03-27 20:35:12 chown
-
Shell/Bash 2022-03-27 20:15:08 awk last match