资讯详情

Linux rz的使用

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

让我们测试一下参数:

先准备一份文件,叫做test.txt内容如下:

one line

rz - 若已存在上传的文件,则将内容添加到现有文件中。

[root@test tmp]# rz -y

rz waiting to receive.

zmodem trl C ?100% 13 bytes 13 bytes/s 00:00:01 0Errors

[root@test tmp]#moretest.txt

one line

[root@test tmp]# rz- rz waiting to receive.

zmodem trl C ?100% 13 bytes 13 bytes/s 00:00:01 0Errors

[root@test tmp]#moretest.txt

one line

one line

[root@test 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 上传前,重命名已存在的文件,防止覆盖。

[root@test tmp]# rz -y

rz waiting to receive.

zmodem trl C ?100% 11 bytes 11 bytes/s 00:00:01 0Errors

[root@test tmp]# ll

total4

-rw-r--r-- 1 root root 11 Jan 4 16:25test.txt

[root@test tmp]# rz-E

rz waiting to receive.

zmodem trl C ?100% 11 bytes 11 bytes/s 00:00:01 0Errors

[root@test tmp]# ll

total8

-rw-r--r-- 1 root root 11 Jan 4 16:25test.txt-rw-r--r-- 1 root root 11 Jan 4 16:25 test.txt.0[root@test 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协议。

标签: rz3a60d40固态继电器

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台