一.介绍
rz,sz是Linux/Unix同Windows进行ZModem文件传输的命令行工具
- sz:将选定的文件发送(send)到本地机器
- rz:运行该命令会弹出一个文件选择窗口,从本地选择文件上传到Linux服务器
二.安装(Ubuntu)
安装命令:
apt-get install lrzsz
三.使用
1.sz命令:
sz [filename]
示例:
如何确定下载的路径,由于我使用的是Xshell连接的虚拟机,所有可以在会话选项里进行设置(使用secureCRT跟Xshell差不多)
执行sz命令时会弹出如下的弹窗,可以根据自己需要选择文件路径
传输成功
在Windows系统中自定义的文件夹下可以看到所传输的文件
3.rz命令:
rz [options] [filename]
options:
-+, --append append to existing files
-a, --ascii ASCII transfer (change CR/LF to LF)
-b, --binary binary transfer
-B, --bufsize N buffer N bytes (N==auto: buffer whole file)
-c, --with-crc Use 16 bit CRC (X)
-C, --allow-remote-commands allow execution of remote commands (Z)
-D, --null write all received data to /dev/null
--delay-startup N sleep N seconds before doing anything
-e, --escape Escape control characters (Z)
-E, --rename rename any files already existing
--errors N generate CRC error every N bytes (debugging)
-h, --help Help, print this usage message
-m, --min-bps N stop transmission if BPS below N
-M, --min-bps-time N for at least N seconds (default: 120)
-O, --disable-timeouts disable timeout code, wait forever for data
--o-sync open output file(s) in synchronous write mode
-p, --protect protect existing files
-q, --quiet quiet, no progress reports
-r, --resume try to resume interrupted file transfer (Z)
-R, --restricted restricted, more secure mode
-s, --stop-at {HH:MM|+N} stop transmission at HH:MM or in N seconds
-S, --timesync request remote time (twice: set local time)
--syslog[=off] turn syslog on or off, if possible
-t, --timeout N set timeout to N tenths of a second
--tcp-server open socket, wait for connection (Z)
--tcp-client ADDR:PORT open socket, connect to ... (Z)
-u, --keep-uppercase keep upper case filenames
-U, --unrestrict disable restricted mode (if allowed to)
-v, --verbose be verbose, provide debugging information
-w, --windowsize N Window is N bytes (Z)
-X --xmodem use XMODEM protocol
-y, --overwrite Yes, clobber existing file if any
--ymodem use YMODEM protocol
-Z, --zmodem use ZMODEM protocol