zoukankan      html  css  js  c++  java
  • 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       0 Errors
    
    [root@test tmp]# more test.txt 
    one line
    [root@test tmp]# rz -+
    rz waiting to receive.
     zmodem trl+C ȡ
    
      100%      13 bytes   13 bytes/s 00:00:01       0 Errors
    
    [root@test tmp]# more test.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       0 Errors
    
    [root@test tmp]# ll
    total 4
    -rw-r--r-- 1 root root 11 Jan  4 16:25 test.txt
    [root@test tmp]# rz -E
    rz waiting to receive.
     zmodem trl+C ȡ
    
      100%      11 bytes   11 bytes/s 00:00:01       0 Errors
    
    [root@test 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
    [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协议。

  • 相关阅读:
    hosts.deny hosts.allow防止ssh暴力破解密码
    linux查看当前ssh登陆的ip
    ubuntu下如何查看用户登录及系统授权相关信息
    ubuntu查看日志中访问次数前十的ip
    magento清空日志表
    mysql general error 2006
    mysql 1205 lock wait timeout exceeded
    mysql 504 timeout问题
    PHP : 数据库中int类型保存时间并通过年月份时分秒进行显示
    PHP : 封装Mysqli的连接、关闭和增改查(面向过程)
  • 原文地址:https://www.cnblogs.com/mengzhongshi/p/3505055.html
Copyright © 2011-2022 走看看