linux跨主机复制文件或文件夹

复制文件基本格式:(本地到远程)

scp 文件名 用户名@ip:文件全目录

如果是文件夹加上参数 -r

scp -r 基础目录 用户名@ip:目录

 

栗子:

scp local_file remote_username@remote_ip:remote_file

 

如果是远程到本地则对调参数:

栗子:

scp remote_username@remote_ip:remote_file local_file 

 

如果需要制定端口复制:参数 -p

栗子:

scp -p 8888 remote_username@remote_ip:remote_file local_file 

posted @ 2016-06-30 19:22  但行好事-莫问前程  阅读(2278)  评论(0编辑  收藏  举报