trz Command Reference

The trz command is the receiving agent. It is executed on the remote server to signal your local trzsz wrapper that the server is ready to receive an upload.

When executed, it emits a specific escape sequence to stdout (e.g., ::TRZSZ:TRANSFER:R:...). The local wrapper catches this, opens a file selection dialog on your local machine, and then streams the file data to the server.

Syntax

trz [options] [path]
  • path: (Optional) The destination directory on the remote server where the uploaded files will be saved. If omitted, it defaults to the current working directory (.).

Command-Line Options

Flag Long Flag Description Trade-offs & Notes
-h --help Show the help message and exit. -
-v --version Show the version number and exit. -
-q --quiet Quiet mode. Suppresses the progress bar during the transfer. Useful for scripting or if the terminal struggles to render rapidly updating UI elements.
-y --overwrite Yes, overwrite existing file(s). If omitted, trzsz will fail or automatically rename the file to avoid data loss.
-b --binary Force binary transfer mode. Significantly faster throughput. However, binary mode may fail if tmux control sequences intercept the raw binary stream. (Automatically disabled by trzsz if tmux issues are detected).
-e --escape Escape all known control characters. Slightly slower transfer speeds, but much safer in complex proxy/telnet environments that might interpret raw control characters as commands.
-d --directory Enable transferring entire directories. Zips/archives the directory tree dynamically during transit.
-r --recursive Same as -d. Provided for familiarity with standard Unix tools like cp or scp.
-f --fork Fork the transfer process into the background. Automatically implies -q (quiet). Returns terminal control to you immediately while the transfer happens in the background.
-B N --bufsize N Set the max buffer chunk size. Accepts N in bytes, K, M, or G. (e.g., 2M). Default is 10M. Increase on pristine LANs; decrease on highly unstable connections.
-t N --timeout N Timeout (in seconds) for receiving each chunk. Default: 20. Set to 0 to disable timeouts entirely. Useful for extremely slow connections.
-c TYPE --compress TYPE Set compression behavior. Options: yes, no, auto. Default is auto. Auto will analyze the first few chunks to determine if the data is highly compressible before enabling zstd compression.

Common Use Cases & Examples

1. Standard Upload Upload files to the current directory safely (fails if the file already exists).

trz

2. Force Overwrite Upload Update an existing binary or configuration file, overwriting the old version.

trz -y

3. Upload to a Specific Directory Deploy assets directly into the web server directory without cd'ing first.

trz -y -d /var/www/html/assets/

4. Upload a Large Directory Tree Recursively upload a folder containing many files.

trz -d

5. High-Speed Binary Upload Bypass base64 encoding for maximum transfer speed on stable networks (not recommended inside deeply nested tmux sessions).

trz -b -y