目录
在Windows本地端命令窗口中转到需要上传的文件地址
- [D:\]$ cd dat
- [D:\dat]$ scp -r day1 root@192.168.30.128:/root/Desktop
day1 需上传到Linux的目录文件
root@192.168.30.128:/root/Desktop 远程账号下的存储地址

同样需转到需下载的文件目录地址下
与上传不同的是两个地址的位置转变
- [D:\dat\day1]$ cd ..
- [D:\dat]$ scp -r root@192.168.30.128:/root/Desktop day1/

上传/下载目录的时候需要在get/put后面添加-r选项
- # 远程登陆
- [D:\dat]$ sftp root@192.168.30.128
-
- # 查看在远程服务器上的工作路
- sftp:/root> pwd
- Remote working directory: /root
-
- # 查看在本地工作目录(local)
- sftp:/root> lpwd
- Local directory is D:\dat
-
- # 上传文件
- sftp:/root> put D:\dat\day1\a.txt Desktop
- sftp: D:\dat\Desktop does not exist
- Uploading a.txt to remote:/root/a.txt
- sftp: sent 0 字节 in 0.00 seconds
-
- # 下载文件
- sftp:/root> get Desktop/a.txt
- Fetching /root/Desktop/a.txt to a.txt
- sftp: received 0 字节 in 0.00 seconds
-
在xshell中打开xftp


