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協議。