Linux scp 命令用于 Linux 之间复制文件和目录。
scp 是 secure copy 的缩写, scp 是 linux 系统下基于 ssh 登陆进行安全的远程文件拷贝命令。
scp 是加密的,rcp 是不加密的,scp 是 rcp 的加强版。
将本地复制到对端
scp /server/a.txt root@10.20.2.1:/home/
将本地的a 复制到对端的home里
/server/a.txt 本地文件路径
root@10.20.2.1 对端账号和ip
/home/ 对端目录
从对端复制到本地
scp root@10.20.2.2:/home/a.sh /server/
将对端的a.sh复制到本地