使用sftp在Linux(MacOS)之间进行文件传输

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/LucasXu01/article/details/83864143

1. 打开终端,连接远程Linux

sftp user@host
例如:sftp [email protected]

2. 上传文件

put local_path remote_path
例如:put -r /home/share/read.txt /home/root


3. 上传文件夹以文件夹里的所有内容

比如上传文件夹 folder,首先需要在远程机上创建这个文件夹,然后使用下面命令 put

put -r /home/share/folder/* /home/root/folder


4. 下载文件

get remote_path local_path
例如:get -r /usr/local/some.zip /home/share


5. 下载文件夹以文件夹里的所有内容

比如下载文件夹 folder,首先需要在本机上创建这个文件夹,然后使用下面命令 get

get -r /usr/local/folder/* /home/share/folder


6. 退出

exit
 

猜你喜欢

转载自blog.csdn.net/LucasXu01/article/details/83864143