Linux服务器之间文件传输命令SCP

SCP命令可以实现远程主机之间的文件复制。scp使用ssh协议,如果需要免密进行复制,需要发送秘钥给相应的节点。

scp使用格式:

scp [可选参数] file_source file_target 

常用参数:
  -r: 递归处理。复制目录时使用
  -C:允许压缩。
  -P:指定端口

例子

scp [email protected]:/home/getfile.txt .   //获取对方主机文件
scp sendfile.txt [email protected]:/home  //传送文件到对方主机
scp -r [email protected]:/home/getfolder .  //获取对方主机夹
scp -r sendfolder [email protected]:/home   //传送文件夹到对方主机
发布了73 篇原创文章 · 获赞 27 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/sitebus/article/details/103728218