当前位置: 首页 > news >正文

使用Xshell中自带的传输新建文件功能实现上传下载文件

Xshell在窗口菜单下,有个“传输新建文件”的选项,可以实现在没安装或不方便安装一些Windows2Linux文件传输工具,如:

  • Xftp
  • FileZilla
  • MobaXterm

的情况下,快速的实现Windows2Linux的文件上传和下载操作。
在这里插入图片描述
打开后,弹出自家Xftp的下载页面:
在这里插入图片描述
我们不用下载,直接点击“取消”,在弹出的如下sftp操作页中也能完成文件的上传、下载操作。
在这里插入图片描述
让看一看sftp都提供了哪些命令?

Host 'k8s-master' resolved to 192.168.10.202.
Connecting to 192.168.10.202:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.Your current local directory is
D:\Documents\NetSarang Computer\6\Xshell\SessionsType `help' to browse available commnands.
sftp:/home/david> help
bye     finish your SFTP session
cd      change your remote working directory
clear   clear screen
exit    finish your SFTP session
explore explore your local directory
get     download a file from the server to your local machine
help    give help
lcd     change and/or print local working directory
lls     list contents of a local directory
lpwd    print your local working directory
ls      list contents of a remote directory
mkdir   create a directory on the remote server
mv      move or rename a file on the remote server
put     upload a file from your local machine to the server
pwd     print your remote working directory
quit    finish your SFTP session
rename  move or rename a file on the remote server
rm      delete a file
rmdir   remove a directory on the remote server

可以看到,sftp工具提供了丰富的命令,涉及远程目录跳转、本地目录浏览、跳转本地目录、直接呼出文件夹、远程进行文件重命名等操作。

我们看看浏览本地文件、上传、下载文件怎么操作:

# 浏览本地文件
sftp:/home/david> explore# 上传本地文件到服务器
sftp:/home/david> put
Uploading apache-zookeeper-3.7.2-bin.tar.gz to remote:/home/david/apache-zookeeper-3.7.2-bin.tar.gz
sftp: sent 13.5 MB in 0.11 seconds# 下载服务器文件到本地
# lcd命令触发弹出浏览文件夹选项,选择一个希望将远程服务器上的文件,下载到本地的存储位置,如样例中指定到D盘根目录下
sftp:/home/david> lcd
Local directory is now D:\# 打印本地目录
sftp:/home/david> lpwd
Local directory is D:\# 打印远程服务器上当前目录(样例中为/home/david)下的文件列表 
sftp:/home/david> ls
drwx------   27 david    david        4096 Apr 26 21:34 .
drwxr-xr-x    3 root     root           19 Aug 13  2022 ..
-rw-rw-r--    1 david    david          58 Jul  1  2023 person
-rw-rw-r--    1 david    david    14198607 Apr 26 21:34 apache-zookeeper-3.7.2-bin.tar.gz
-rw-rw-r--    1 david    david    65475915 Nov  8  2023 maxwell_v2023u1108.zip# 执行下载命令 "get 远程文件1 远程文件2 远程文件n",如这里下载刚刚上传的一个文件
sftp:/home/david> get apache-zookeeper-3.7.2-bin.tar.gz
Fetching /home/david/apache-zookeeper-3.7.2-bin.tar.gz to apache-zookeeper-3.7.2-bin.tar.gz
sftp: received 13.5 MB in 0.27 seconds
http://www.dtcms.com/a/157780.html

相关文章:

  • PCL点云处理之基于FPFH特征的SAC-IA全局配准算法 (二百四十六)
  • gin框架学习笔记
  • C++篇——继承
  • 04_jQuery
  • 4-26记录(学习通排序测试)
  • TDengine 中的压缩设计
  • springboot入门-repository数据访问层JPA和mybatis
  • NtripShare 2025第一季度主要技术进展
  • Python循环结构深度解析与高效应用实践
  • 2.4goweb项目上传到csdn的git仓库
  • SinSR模型剪枝实验报告
  • 蓝桥杯赛场反思:技术与心态的双重修炼
  • 基于大模型对先天性幽门肥厚性狭窄预测及临床方案的研究报告
  • 【Linux】环境监控系统软件框架
  • AQS条件队列源码详细剖析
  • 从零实现 registry.k8s.io/pause:3.8 镜像的导出与导入
  • 002 六自由度舵机机械臂——姿态解算理论
  • 2007-2022年 上市公司-企业税负数据-社科数据
  • C#里使用libxl来创建EXCEL文件然后发送到网络
  • Nuxt3中使用UnoCSS指南
  • 论人际关系发展的阶段
  • 树莓派学习专题<9>:使用V4L2驱动获取摄像头数据--设定分辨率和帧率
  • Go设计模式-观察者模式
  • 【量化交易笔记】17.多因子的线性回归模型策略
  • JAVA---字符串
  • docker配置mysql遇到的问题:网络连接超时、启动mysql失败、navicat无法远程连接mysql
  • Nginx技术培训文档
  • 【Linux网络#1】:网络基础知识
  • strings.TrimLeft 使用详解
  • ssm乡村合作社商贸网站设计与实现(源码+lw+部署文档+讲解),源码可白嫖!