SCP
scp [OPTION] [[email protected]]SRC:]file1 [[email protected]]DEST:]file2
where is
- OPTION – options which accept the command: ssh configuration, recursively, etc
- SRC – is a source source host
- DEST – is a destination host
scp /mnt/test/test.txt [email protected]:/home/ubuntu/test_folder/myfile.txt
This command will copy
test.txt
to the remote file, you could provide another name filename for remote systemscp /mnt/test/test.txt [email protected]:/home/ubuntu/test_folder
This command will copy the
test.txt
under the test_folder
on remote machine with the same filename as originalscp /mnt/test [email protected]:/home/ubuntu/test_folder
All files from
/mnt/test
will be copied recursively under the test_folder
scp [email protected]:/home/ubuntu/test_folder/myfile.txt /mnt/test/remote_file.txt
scp [email protected]:/opt/my_folder/test.txt [email protected]:/home/ubuntu/myfile.txt
-r
– copy recursively-P
– specifying the SSH port (default: 22)
Last modified 1yr ago