加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux命令rz

发布时间:2020-12-14 01:42:39 所属栏目:Linux 来源:网络整理
导读:rz :上传文件; sz: 下载文件; 在linux 系统中,使用rz(或 sz) 命令是,提示 -bash: rz(或者是sz): command not found 。 这个时候,说明没有安装 lrzsz ,这时,输入命令 yum -y install lrzsz 进行下载安装。 此时,若当前登录的不是 root 用户 ,会报错

rz :上传文件;
sz: 下载文件;

在linux 系统中,使用rz(或 sz) 命令是,提示 -bash: rz(或者是sz): command not found 。
这个时候,说明没有安装 lrzsz ,这时,输入命令

yum -y install lrzsz

进行下载安装。

此时,若当前登录的不是 root 用户 ,会报错,需要切换到 root用户,

切换到 root 用户命令: su
回车,然后输入root 密码,回车即可

?

RZ是Linux提供的上传的命令,基于XMODEM/YMODEM/ZMODEM协议。

让我们来测试一下参数吧:

先准备一个文件,就叫test.txt吧,内容如下:

one line


rz -+? 如果上传的文件已经存在,把内容追加到已存在的文件后面。

[[email?protected] tmp]# rz -y
rz waiting to receive.
 zmodem trl+C ?

  100%      13 bytes   13 bytes/s 00:00:01       0 Errors

[[email?protected] tmp]# more test.txt 
one line
[[email?protected] tmp]# rz -+
rz waiting to receive.
 zmodem trl+C ?

  100%      13 bytes   13 bytes/s 00:00:01       0 Errors

[[email?protected] tmp]# more test.txt 
one line
one line
[[email?protected] tmp]# 

rz -B 使用rz上传时,文件是先写入缓冲区,然后再写入硬盘的。-B后面跟着的数字就是修改这个缓冲区大小的,单位是Bytes。如:rz -B 10

rz -C 找到的解释是这样的:

allow remote command execution ( insecure ). This allows the sender to execute an arbitrary command through system () or execl (). Default is to disable this feature (?). This option is ignored if running in restricted mode.

大体意思是:允许执行远程命令(不安全)。允许发送者通过system()和execl()执行任意的命令。因为不安全所以默认是禁止的。这个参数在严谨模式下是不成立的。

rz -D 把所上传的数据导向/dev/null,这是用于测试的。

rz -e 转化所有的控制字符。

rz -E 上传之前先,重命名已经存在的文件,防止覆盖。

[[email?protected] tmp]# rz -y
rz waiting to receive.
 zmodem trl+C ?

  100%      11 bytes   11 bytes/s 00:00:01       0 Errors

[[email?protected] tmp]# ll
total 4
-rw-r--r-- 1 root root 11 Jan  4 16:25 test.txt
[[email?protected] tmp]# rz -E
rz waiting to receive.
 zmodem trl+C ?

  100%      11 bytes   11 bytes/s 00:00:01       0 Errors

[[email?protected] tmp]# ll
total 8
-rw-r--r-- 1 root root 11 Jan  4 16:25 test.txt
-rw-r--r-- 1 root root 11 Jan  4 16:25 test.txt.0
[[email?protected] tmp]# 

rz -m N? 当上传速度小于N bps的时候,停止上传。

rz -p 保护模式,保证不覆盖同名文件。

rz -q 安静模式,不显示上传进度等信息。(估计理解错误,测试没有效果)。

rz -R 安全模式,还记得上面的-C参数吗?

rz -U 非安全模式与-R对应

rz -u 保持文件大小写(这个好像是默认的,不加一样保持 )

rz -X -Y -Z 分别表示使用xmodem/ymodem/zmodem协议。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读