Linux Transfer File between Remote and Local
作者:XD / 发表: 2021年12月17日 03:09 / 更新: 2022年1月30日 09:16 / 编程笔记 / 阅读量:2693
Example 1: Copy a file from a remote server location to a local PC or server directory
$scp root@10.1.2.123:/opt/soft/test.zip /opt/soft/
Note: Download the test.zip file from the /opt/soft/
directory on 10.1.2.123
to the /opt/soft/
directory
Example 2: Remote to local copy
$scp -r root@10.1.2.123:/opt/soft/test /opt/soft/
Note: Download the test directory from /opt/soft/
on 10.1.2.123
to the local /opt/soft/
directory.
Example 3: Upload a local file to a specified directory on a remote machine
$scp /opt/soft/test.zip root@10.1.2.123:/opt/soft/scptest
Copy the test.zip file in the /opt/soft/
directory on the local computer to the /opt/soft/scptest
directory on the remote machine 10.1.2.123
Example 4: Upload a local directory to a specified directory on a remote machine
$scp -r /opt/soft/test root@10.1.2.123:/opt/soft/scptest
Note: Upload the local directory /opt/soft/test
to the directory /opt/soft/scptest
on the remote machine 10.1.2.123
相关标签