Scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. Scp will ask for passwords or passphrases if they are needed for authentication

# copy data from local to remote using port 22222
# if port is not specified it uses 22
[user@localhost] scp -P 22222 /path/file.ext user@remotehost:/path/
# copy data from remote to local
[user@localhost] scp -P 22222 user@remotehost:/remotepath/remotefile.txt /localpath/

You can copy single or multiple files using * wild card

For more info type “man scp” on your local shell

Categories: Bash

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.