How to Use sz/rz for Uploads and Downloads on Linux (Step-by-Step Guide)

This post introduces how to use sz and rz on Linux for simple file uploads and downloads, including installation, usage, and iTerm2 setup on macOS.

Sep 24, 2017 · 1 min read · 138 Words · -Views -Comments · Programming
Linux 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

In daily development, we often need to upload files to a server or download files from it. FTP requires setting up an FTP server and configuring the service. Using sz/rz enables simple upload and download operations.

Installation

# On macOS
brew install lrzsz

## On Linux machines
yum install lrzsz

## FreeBSD
pkg install lrzsz

## Debian
apt install -y lszrz   

Usage

sz usage: download

  • Download a single file: # sz filename
  • Download multiple files: # sz filename1 filename2
  • Download all files under the dir directory, excluding subfolders: # sz dir/*

rz usage: upload

  • Just type the rz command # rz

  • Force overwrite the source file # rz -y

iTerm2 setup on macOS

# Create two files in the /usr/loal/bin directory
cd /usr/local/bin
wget https://raw.githubusercontent.com/RobberPhex/iterm2-zmodem/master/iterm2-recv-zmodem.sh
wget https://raw.githubusercontent.com/RobberPhex/iterm2-zmodem/master/iterm2-send-zmodem.sh

# Grant execute permissions to these two files
chmod 777 /usr/local/bin/iterm2-*
Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover