首先,打开远程连接工具xshell或SecureCRT,连接资源所在的服务器
其次,在资源服务器找到需要拷贝的文件或文件夹
最后,进行文件传输
命令: scp -r {文件夹绝对路径}/ {目标服务器登录名}@{目标服务器IP地址}😕{文件夹绝对路径}
- 递归拷贝文件(包括文件夹本身)
scp -r /home/test/ root@10.xxx.xxx.25:/home/test - 拷贝文件夹下的所有文件(不包括)
scp -r /home/test/* root@10.xxx.xxx.25:/home/test - 拷贝文件并重命名
scp /home/test/1.txt root@10.xxx.xxx.25:/home/test/2.txt - 命令解释
/home/test/1.txt :要传输的文件
root :目标服务器ssh账号名
@10.xxx.xxx.25:目标服务器IP地址
:/home/test :要传输到目标服务器的文件保存目录