linux 本地与远程文件互传

1.文件复制:本机->远程服务器:

scp /home/shaoxiaohu/test1.txt [email protected]:/home/test2.txt 

其中,test1为源文件,test2为目标文件,[email protected]为远程服务器的用户名和ip地址

2.文件复制:远程服务器->本机

scp [email protected]:/home/test2.txt /home/shaoxiaohu/test1.txt 

其中,[email protected]为远程服务器的用户名和ip地址, test2为源文件,test1为目标路径

3.文件夹复制

scp -r [email protected]:/home/ /home/

4. 端口号

如果端口号有更改,需在scp 后输入:-P 端口号 (注意是大写,ssh的命令中 -p是小写)

发布了38 篇原创文章 · 获赞 9 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_42260789/article/details/88863633
今日推荐