SCP
Syntax
scp [OPTION] [user@]SRC:]file1 [user@]DEST:]file2where is
OPTION – options which accept the command: ssh configuration, recursively, etc
SRC – is a source source host
DEST – is a destination host
SCP copy local file to remote system
SCP copy local file to remote with output path
scp /mnt/test/test.txt [email protected]:/home/ubuntu/test_folder/myfile.txtThis command will copy test.txt to the remote file, you could provide another name filename for remote system
SCP copy local file under remote folder
scp /mnt/test/test.txt [email protected]:/home/ubuntu/test_folderThis command will copy the test.txt under the test_folder on remote machine with the same filename as original
SCP copy local folder to remote folder
scp /mnt/test [email protected]:/home/ubuntu/test_folderAll files from /mnt/test will be copied recursively under the test_folder
SCP copy remote file to local system
scp [email protected]:/home/ubuntu/test_folder/myfile.txt /mnt/test/remote_file.txtSCP copy files between two remote systems
scp [email protected]:/opt/my_folder/test.txt [email protected]:/home/ubuntu/myfile.txtSCP options
-r– copy recursively-P– specifying the SSH port (default: 22)
Last updated