RZ(1)
π rz, rb, rx β the file-receiving girlies π
okay so bestie, welcome to RZ(1), from the General Commands Manual, and it's giving "I catch files over a serial line and I do it flawlessly." Three commands, one mission, zero gatekeeping. Let's get into it. π¦
πΈ NAME πΈ
rx, rb, rz β XMODEM, YMODEM, ZMODEM (Batch) file receive. That's it, that's the whole job description. π
β¨ SYNOPSIS β¨
rz [- +8abeOpqRtTuUvy]
rb [- +abqRtuUvy]
rx [- abceqRtuUv] file
[-][v]rzCOMMAND
like, exactly that. no cap. β¨
π DESCRIPTION π
So this program uses error correcting protocols to receive files over a dial-in serial port from a whole bunch of programs running under PC-DOS, CP/M, Unix, and other operating systems. You can call it from a shell prompt manually, or it just spawns automatically when the calling program runs an "sz file ..." command. main character behavior, honestly. π
Now, real talk: while rz is smart enough to be called from cu(1), very few versions of cu(1) are smart enough to let rz actually work properly. π Unix flavors of Professional-YAM are available for that dial-out application though, so there's a fix if you need it.
Rz (Receive ZMODEM) receives files with the ZMODEM batch protocol. The pathnames are supplied by the sending program, and directories are made if necessary (and possible). Normally the "rz" command is automatically issued by the calling ZMODEM program, but some defective ZMODEM implementations may require starting rz the old fashioned way. π
Rb receives file(s) with YMODEM, accepting either standard 128 byte sectors or 1024 byte sectors (YAM sb -k option). And bestie, you gotta determine when the 1024 byte block length actually improves throughput without causing lost data or even system crashes. It's giving "measure twice, transmit once."
If True YMODEM (Omen Technology trademark) file information (file length, etc.) is received, the file length controls the number of bytes written to the output dataset, and the modify time and file mode (iff non zero) are set accordingly. β¨
If no True YMODEM file information is received, slashes in the pathname are changed to underscore, and any trailing period in the pathname is eliminated. This conversion is useful for files received from CP/M systems. With YMODEM, each file name is converted to lower case unless it contains one or more lower case letters. cute, lowercase era. π
Rx receives a single file with XMODEM or XMODEM-1k protocol. Again, you should determine when the 1024 byte block length actually improves throughput without causing problems. The user must supply the file name to both the sending and receiving programs. And heads up: up to 1023 garbage characters may be added to the received file. π not the bonus garbage.
The rzCOMMAND era π
Rz may be invoked as rzCOMMAND (with an optional leading - as generated by login(1)). For each received file, rz will pipe the file to COMMAND filename where filename is the name of the transmitted file, with the file contents as standard input.
Each file transfer is acknowledged when COMMAND exits with 0 status. A non zero exit status terminates transfers. periodt.
A typical use for this form is rzrmail, which calls rmail(1) to post mail to the user specified by the transmitted file name. For example, sending the file "caf" from a PC-DOS system to rzrmail on a Unix system would result in the contents of the DOS file "caf" being mailed to user "caf". iconic. π¬
On some Unix systems, the login directory must contain a link to COMMAND, since login sets SHELL=rsh, which disallows absolute pathnames. If invoked with a leading v, rz will be verbose (see the v option). The following entry works for Unix SYS III/V:
rzrmail::5:1::/bin:/usr/local/rzrmail
If the SHELL environment variable includes rsh, rbash or rksh (restricted shell), rz will not accept absolute pathnames or references to a parent directory, will not modify an existing file, and removes any files received in error. π« it's locked down, bestie.
If rz is invoked with stdout and stderr to different datasets, Verbose is set to 2, causing frame by frame progress reports to stderr. This may be disabled with the q option.
π OPTIONS π
The meanings of the available options are, and I quote my own heart, everything:
-+,--appendβ append received data to an existing file (ZMODEM, ASCII only).-a,--asciiβ Convert files to Unix conventions by stripping carriage returns and all characters beginning with the first Control Z (CP/M end of file).-b,--binaryβ Binary (tell it like it is) file transfer override.-B NUMBER,--bufsize NUMBERβ BufferNUMBERbytes before writing to disk. Default is32768, which should be enough for most situations. If you have a slow machine or a bad disk interface or suffer from other hardware problems you might want to increase the buffersize.-1orautouse a buffer large enough to buffer the whole file. Be careful with this options β things normally get worse, not better, if the machine starts to swap. β οΈ-c,--with-crcβ XMODEM only. Use 16 bit CRC (normally a one byte checksum is used).-C,--allow-remote-commandsβ allow remote command execution ( insecure ). This allows the sender to execute an arbitrary command throughsystem ()orexecl (). Default is to disable this feature (?). This option is ignored if running in restricted mode.-D,--nullβ Output file data to/dev/null; for testing. (Unix only)--delay-startup Nβ WaitNseconds before doing anything. β¨-e,--escapeβ Force sender to escape all control characters; normally XON, XOFF, DLE, CR-@-CR, and Ctrl-X are escaped.-E,--renameβ Rename incoming file if target filename already exists. The new file name will have a dot and a number (0..999) appended.-h,--helpβ give help screen.-m N,--min-bps Nβ Stop transmission if BPS-Rate (Bytes Per Second) falls belowNfor a certain time (see--min-bps-timeoption).-M N,--min-bps-timeβ Used together with--min-bps. Default is120(seconds).-O,--disable-timeoutsβ Disable read timeout handling code. This makeslrzhang if the sender does not send any more, but increases performance (a bit) and decreases system load (through reducing the number of system calls by about 50 percent).
Use this option with care. π«Ά
--o-syncβ Open output files in synchronous write mode. This may be useful if you experience errors due to lost interrupts ifupdate(orbdflushor whoever this daemon is called on your system) writes the buffers to the disk.
This option is ignored and a warning is printed if your systems doesn't support O_SYNC.
-p,--protectβ (ZMODEM) Protect: skip file if destination file exists.-q,--quietβ Quiet suppresses verbosity. π€«-r,--resumeβ Crash recovery mode.lrztries to resume interrupted file transfers.-R,--restrictedβ Enter more restricted mode.lrzwill not create directories or files with a leading dot if this option is given twice.
See SECURITY for mode information about restricted mode.
-s HH:MM,--stop-at HH:MMβ Stop transmission atHHhours,MMminutes. Another variant, using+Ninstead ofHH:MM, stops transmission inNseconds.-S,--timesyncβ Request timesync packet from the sender. The sender sends its system time, causinglrzto complain about more then 60 seconds difference.
Lrz tries to set the local system time to the remote time if this option is given twice (this fails if lrz is not run by root).
This option makes lrz incompatible with certain other ZModems. Don't use it unless you know what you are doing. π
--syslog[=off]β turn syslogging on or off. the default is set at configure time. This option is ignored if no syslog support is compiled in.-t TIM,--timeout TIMβ Change timeout toTIMtenths of seconds. This is ignored if timeout handling is turned of through theOoption.--tcp-client ADDRESS:PORTβ Act as a tcp/ip client: Connect to the given port.
See --tcp-server for more information.
--tcp-serverβ Act as a server: Open a socket, print out what to do, wait for connection.
You will normally not want to use this option as lrzsz is the only zmodem which understands what to do (private extension). You might want to use this if you have to use zmodem (for which reason whatever), and cannot use the --tcp option of lsz (perhaps because your telnet doesn't allow to spawn a local program with stdin/stdout connected to the remote side).
If you use this option you have to start lsz with the --tcp-client ADDRESS:PORT option. lrz will print the address and port on startup.
Use of this option imposes a security risk, somebody else could connect to the port in between. See SECURITY for details. π₯
-U,--unrestrictβ turn off restricted mode (this is not possible if running under a restricted shell).--versionβ prints out version number.-v,--verboseβ Verbose causes a list of file names to be appended to stderr. More v's generate more output. π£οΈ-wN,--windowsize Nβ Set window size toN.-X,--xmodemβ use XMODEM protocol.-y,--overwriteβ Yes, clobber any existing files with the same name. π€--ymodemβ use YMODEM protocol.-Z,--zmodemβ use ZMODEM protocol.
π SECURITY π
Contrary to the original ZMODEM, lrz defaults to restricted mode. In restricted mode lrz will not accept absolute pathnames or references to a parent directory, will not modify an existing file, and removes any files received in error. Remote command execution is disabled. π«β¨
To use a more restricted mode set the environment variable ZMODEM_RESTRICTED or give the R option. This disables creation of subdirectories and invisible files.
Restricted mode may be turned off with the U option, unless lrz runs under a restricted shell.
Use of the --tcp-client or --tcp-server options imposes a security risk, as somebody else could connect to the port before you do it, and grab your data. If there's strong demand for a more secure mode i might introduce some sort of password challenge.
π ENVIRONMENT π
lrz uses the following environment variables, bestie:
SHELLβlrzrecognizes a restricted shell if this variable includesrshorrksh.ZMODEM_RESTRICTEDβlrzenters the more restricted mode if the variable is set.
π¦ EXAMPLES π¦
okay so here's the vibe in action:
(Pro-YAM command)
<ALT-2>
Pro-YAM Command: sz *.h *.c
(This automatically invokes rz on the connected system.)
π SEE ALSO π
ZMODEM.DOC, YMODEM.DOC, Professional-YAM, crc(omen), sz(omen), usq(omen), undos(omen)
Compile time options required for various operating systems are described in the source file. π
π NOTES (bestie read this fr) π
Okay so sending serial data to timesharing minicomputers at sustained high speeds has been known to cause lockups, system halts, kernel panics, and occasional antisocial behaviour. Not a vibe. When you're experimenting with high speed input to a system, consider rebooting the system if the file transfers are not successful β especially if the personality of the system appears altered. Like if your mainframe woke up and chose chaos, maybe give it a lil nap. π
The Unix "ulimit" parameter must be set high enough to permit large file transfers. No skimping, bestie.
The TTY input buffering on some systems may not allow long blocks or streaming input at high speed. You should suspect this problem when you can't send data to the Unix system at high speeds using ZMODEM, YMODEM-1k or XMODEM-1k, when YMODEM with 128 byte blocks works properly. And if the system's tty line handling is really broken, the serial port or the entire system may not survive the onslaught of long bursts of high speed data. It's giving fragile. π«
The DSZ or Pro-YAM zmodem l numeric parameter may be set to a value between 64 and 1024 to limit the burst length (zmodem pl128). Slay, now you can throttle it.
32 bit CRC code courtesy Gary S. Brown. Directory creation code from John Gilmore's PD TAR program. Giving credit where credit is due, periodt. π
π BUGS (we're being honest) π
- Calling
rzfrom most versions ofcu(1)doesn't work becausecu's receive process fightsrzfor characters from the modem. They're beefing. π - Programs that do not properly implement the specified file transfer protocol may cause
szto "hang" the port for a minute or two. Every reported instance of this problem has been corrected by using ZCOMM, Pro-YAM, or other program with a correct implementation of the specified protocol. Like, use the good ones, bestie. - Many programs claiming to support YMODEM only support XMODEM with 1k blocks, and they often don't get that quite right. The audacity fr fr. π
- Pathnames are restricted to 127 characters. In XMODEM single file mode, the pathname given on the command line is still processed as described above. The ASCII optionΒ΄s CR/LF to NL translation merely deletes CRΒ΄s;
undos(omen)performs a more intelligent translation.
π₯οΈ VMS VERSION π₯οΈ
So the VMS version does not set the file time.
VMS C Standard I/O and RMS may interact to modify file contents unexpectedly. Sneaky behaviour, ngl.
The VMS version does not support invocation as rzCOMMAND. The current VMS version does not support XMODEM, XMODEM-1k, or YMODEM. We're keeping it minimal over here.
According to the VMS documentation, the buffered input routine used on the VMS version of rz introduces a delay of up to one second for each protocol transaction. This delay may be significant for very short files. Removing the "#define BUFREAD" line from rz.c will eliminate this delay at the expense of increased CPU utilization. Pick your struggle, bestie. βοΈ
The VMS version causes DCL to generate a random off the wall error message under some error conditions; this is a result of the incompatibility of the VMS "exit" function with the Unix/MSDOS standard. It's literally not rz's fault. π
π ZMODEM CAPABILITIES π
Rz supports incoming ZMODEM binary (-b), ASCII (-a), protect (-p), clobber (-y), and append (-+) requests. The default is protect (-p) and binary (-b). Iconic defaults tbh.
The Unix versions support ZMODEM command execution. π₯
π FILES π
rz.c,crctab.c,rbsb.c,zm.c,zmodem.hβ Unix source files.rz.c,crctab.c,vrzsz.c,zm.c,zmodem.h,vmodem.h,vvmodem.cβ VMS source files.
And that's the whole page, bestie!! π This was OMEN's RZ(1) β that's the source/version stamped on it β and the date lives in the footer of the original page right next to it. Go forth and receive your files responsibly, mwah πβ¨π¦
π¦ where this page comes from
- debian trixie: lrzsz 0.12.21rc-0.2
- ubuntu noble: lrzsz 0.12.21-11build1
- ubuntu questing: lrzsz 0.12.21rc-0.2
- ubuntu resolute: lrzsz 0.12.21rc-0.3
- ubuntu stonking: lrzsz 0.12.21rc-4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms