rz
Receive files via Zmodem protocol
SYNOPSIS
rz [-beEOTuv] [-c count] [-d directory] [-Z command]
PARAMETERS
-a
Automatically detect the transfer speed.
-b
Use binary mode for the transfer.
-c count
Set maximum number of consecutive crc errors before the transfer is aborted.
-d directory
Specify a directory to save the received files into.
-e
Escape all control characters.
-E
Force use of the escape control character for the transfer.
-n
Transfer only newer files.
-o
Overwrite existing files.
-O
Append data to an existing file if it exists.
-t
Preserve file timestamps.
-T secs
Set timeout to 'secs' seconds.
-u
Resume interrupted transfer.
-v
Verbose, show more information about transfer process.
-Z command
Use command to compress/uncompress the files.
DESCRIPTION
The rz command is a utility used to receive files from a remote system using the ZMODEM file transfer protocol. It's commonly used in terminal emulators to facilitate file uploads from a host machine to a remote server or device accessed via a serial port or a similar connection. rz listens for a ZMODEM transfer initiation from the sending side (often initiated by the 'sz' command on the other end). Once initiated, it handles the data transfer, error checking, and file writing on the receiving end. It supports resuming interrupted transfers and handling various file attributes.
rz offers options to automatically create directories if they don't exist (-d), to overwrite existing files (-o), to preserve timestamps (-t), and to use binary mode (-b). This makes it suitable for transferring both text and binary files reliably over often unreliable connections. For interactive usage it's often coupled with terminal emulators that support ZMODEM, which simplifies the process for end-users.
The command is usually part of a package like `lrzsz` or `rzsz`.
CAVEATS
ZMODEM is an older protocol and might not be supported by all modern systems or terminal emulators. Security considerations should be kept in mind when using ZMODEM over untrusted networks, as the protocol itself has some vulnerabilities.
ERROR HANDLING
If the ZMODEM transfer fails, rz will typically exit with a non-zero exit code. The -c option can be used to adjust how many consecutive errors are tolerated before aborting the transfer.
AUTOMATIC STARTUP
In many terminal emulators, you don't need to type 'rz' manually. Initiating a ZMODEM send from the remote end (using 'sz') will automatically trigger the emulator to start 'rz' in the background to handle the reception.
HISTORY
rz and sz are parts of the larger lrzsz package, developed to provide reliable file transfer capabilities over serial lines. ZMODEM, as a protocol, gained popularity in the BBS (Bulletin Board System) era and has remained useful for specific embedded systems and older terminal applications. The 'lrzsz' package evolved to improve ZMODEM implementation and provide command-line tools for easy integration.
SEE ALSO
sz(1)