LinuxCommandLibrary

sz

Download files from a remote host

SYNOPSIS

sz [options] file1 [file2 ...]

PARAMETERS

-a
    Use ASCII transfer mode.
This option forces the transfer to be done in ASCII mode, converting end-of-line characters as necessary. It should be used only for text files.

-b
    Use binary transfer mode.
This is the default mode and is suitable for most files.

-c command
    Execute command on remote host. This option executes a shell command on the receiving end before the transfer begins.

-e
    Escape control characters.
This option escapes control characters in the data stream.

-k
    Send 1K blocks.
Requests that the receiver use 1K blocks (instead of the default 512-byte blocks).

-L
    Limit packet length to bytes. Defaults to 128. Some systems may not accept long packets. Use -L 16 to force 16-byte packets.

-n
    Send file as name only.

-N
    Do not ask about overwriting files.

-o
    Overwrite existing files without prompting.

-q
    Quiet mode.
Suppresses some informational messages.

-t
    Timeout in seconds.
Sets the timeout value for the transfer. If the receiver does not respond within the specified time, the transfer is aborted.

-v
    Verbose mode.
Provides more detailed output during the transfer.

-w
    Window size in bytes.
Specifies the size of the sliding window used for error checking during the transfer.

-y
    Transmit literally (for debugging ZMODEM).

-Z
    Use ZMODEM protocol with 32-bit CRC.

DESCRIPTION

The `sz` command is used to send one or more files to a remote computer using the ZMODEM protocol. It is primarily used in terminal emulators and communications programs to facilitate file transfers between systems, often over serial lines or network connections. ZMODEM offers features like error detection, automatic resuming of interrupted transfers, and reasonable speed, making it a reliable method for transferring files in environments where more modern protocols like SCP or SFTP might not be available or desirable. The `sz` command is typically invoked on the sending machine, and a corresponding ZMODEM receiver (e.g., `rz` or equivalent functionality within a terminal emulator) must be running on the receiving machine.

CAVEATS

ZMODEM requires a compatible receiver program (`rz` or equivalent) to be running on the remote system. Ensure that the receiver is properly configured before initiating the transfer.

USAGE EXAMPLES

To send a single file named 'document.txt':
sz document.txt

To send multiple files:
sz file1.txt file2.jpg file3.pdf

To send a file in binary mode with verbose output:
sz -bv file.bin

HISTORY

ZMODEM was developed by Chuck Forsberg as an improvement over earlier file transfer protocols like XMODEM and YMODEM. It provided faster transfer speeds, better error detection, and the ability to resume interrupted transfers. `sz` is the sending component of the ZMODEM protocol. It has been widely adopted in terminal emulators and communication software and was commonly used in the BBS (Bulletin Board System) era for file sharing and remote access.

SEE ALSO

rz(1), lsz(1)

Copied to clipboard