zl程序教程

您现在的位置是:首页 >  其他

当前栏目

【lrzsz】安装lrzsz工具实现Linux和Windows系统之间文件便捷上传与下载

2023-02-18 16:27:08 时间

文章目录

一、参考链接

阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区

centos镜像-centos下载地址-centos安装教程-阿里巴巴开源镜像站

lrzsz | Sail

二、lrzsz功能介绍

lrzsz是一款在linux里可代替ftp上传和下载的程序。使用这个软件程序只需要一个命令就可以快速解决Windows端和Linux端的文件上传和下载问题。十分方便。

注意事项:该软件适合传输小文件,超过4GB的大文件无法进行传输。

三、安装操作步骤

1、Linux端

说明:本实验室基于CentOS 7.9系统安装使用的。

[root@centos ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

查找lrzsz包

# yum provides lrzsz
[root@centos ~]# yum provides lrzsz
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * epel: ftp-stud.hs-esslingen.de
lrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programs
Repo        : base



lrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programs
Repo        : @base



[root@centos ~]# 

安装lrzsz包

# yum install -y  lrzsz
[root@centos ~]# yum install -y  lrzsz
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * epel: ftp-stud.hs-esslingen.de
Package lrzsz-0.12.20-36.el7.x86_64 already installed and latest version
Nothing to do

2、Windows端

注意:使用Xshel、SecureCRT远程连接软件,通过ssh/telnet连接Linux端服务器可以支持使用。

3、测试使用

sz

从Linux端下载文件至Windows端

rz

从Windows端上传文件至Linux端

更多详细信息,执行man sz/rz命令进行查看

从Linux端下载文件至Windows端

#在Linux端创建一个名为xybdiy的配置文件
# vim xybdiy 
添加如下内容:
Hello World!
xybdiy
按:wq保存退出。

#执行如下命令从Linux端下载此配置文件至Windows端
# sz xybdiy 
出现如下"浏览文件夹"的选项框,选择存放位置。

选择下载文件存放的位置。

下载完成,至Windows端查看。

在Windows端打开此配置文件查看。

从Windows端上传文件至Linux端

在Windows端,修改刚才下载的配置文件名称和添加内容。

在Linux端,执行rz命令,选择需要从Windows上传的文件。

传送成功。

在Linux端查看配置文件xybdiy-windows

[root@centos ~]# ll
total 16
-rw-------. 1 root root 1531 Feb  9 11:55 anaconda-ks.cfg
-rw-r--r--  1 root root  219 Feb 15 17:17 cook
-rw-r--r--  1 root root   20 Feb 19 14:55 xybdiy
-rw-r--r--  1 root root   66 Feb 19 15:01 xybdiy-windows
[root@centos ~]# cat xybdiy-windows 
Hello World!
xybdiy

# Windows端上传至Linux端
Hello xybDIY!
[root@centos ~]# 

至此,lrzsz工具测试完成。