scp file from local to remote code example
Example 1: scp send file
scp ./file.txt remote_username@remote_ip:/remote/directory
Example 2: bash How To Transfer Files From a Remote Server to another Remote Server
scp source destination
scp /Users/name/Downloads/*.txt [email protected]:/path/to/directory
scp [email protected]:/path/to/directory/*png /Users/name/Downloads
scp [email protected]:/path/to/directory/my_favorite_file.txt [email protected]:/path/to/directory
scp -r [email protected]:/path/to/directory /Users/name/Downloads
Example 3: using scp
scp [email protected]:/remote/file.txt /local/directory
Example 4: scp local to remote
scp -i <private_key> ./file.txt remote_username@remote_ip:/remote/directory
Example 5: how to scp from remote machine to local machine
scp [email protected]:/path/to/file /path/to/store/file
scp [email protected]:/root/test.tar /home/tom/