days since this article was written, please be aware of its timeliness
OS X’s built-in terminal can directly connect to Linux (in comparison, Win’s cmd is quite inferior). However, there’s an issue: the terminal cannot directly upload or download files via Zmodem. This is where a more powerful remote server connection tool comes into play: iTerm.
There are many tutorials online, but some are irresponsibly copy-pasted just to boost traffic, lacking detail. I had to piece things together through trial and error, which was frustrating. Below, I’ll explain things in simpler terms.
Enough preamble—let’s get to the point: how to use rz/sz in Zmodem under Mac OS X to upload and download files.
Step 1: Download iTerm2
First, understand that the built-in terminal won’t suffice. We need to download a more powerful shell tool: iTerm2].
The download is a zip compressed package. Simply extract it to get an executable file with the .app extension. Double-click to open the iTerm2 window. If warning pop-ups appear, just approve them (it’s essentially like a portable app in Win, requiring no installation).
Step 2: Use iTerm2 to Install brew
brew is a package manager that simplifies software installation without needing to input addresses—it functions similarly to AppStore. For details, refer to the official website. Installing brew is straightforward. Using the iTerm2 you just downloaded and extracted, enter:
1 | |
Only then did it begin downloading and installing brew. This is important to remember.
Upon success, this prompt will appear:
1 | |
Note: If lrzsz cannot be installed via iTerm2’s brew (including any error messages), please manually download lrzsz. Here is the official website of lrzsz](https://ohse.de/uwe/software/lrzsz.html).
You need to place the downloaded zip archive into the cache directory of brew: /Library/Caches/Homebrew/
Step 3: Install lrzsz using brew
Enter the following in iTerm2:
1 | |
No further action is needed—just wait for the success prompt.
Step 4: Configure iTerm2
First, download two script files and place them in the /usr/local/bin directory. Here is the download link. Click the Download ZIP button at the bottom right of the Github page.
After downloading, extract the files and cd into the extracted folder (named iterm2-zmodem-master, requiring root permissions: sudo -i). Then, use the terminal or iTerm2 to copy the files to the /usr/local/bin directory.
The command is (assuming you are already cd in the iterm2-zmodem-master folder):
1 | |
Next, in the iTerm2 settings interface, click the Edit button under iTerm 偏好设置-> Profiles -> Default -> Advanced -> Triggers.
Select + and add the following trigger information (two lines):
1 | |
Step 5: Enjoy rz/sz to Your Heart’s Content!
After SSH connects to the server, try entering rz—a dialog box will pop up allowing you to select the file to upload. Mission accomplished!
-
Previous
Perspectives on Collecting User Privacy -
Next
By the Gan River, before the Tengwang Pavilion
I often wish that when facing some key decisions in life, someone could tell me the best course of action so that I would not waste my precious time. Putting myself in others' shoes, I therefore write blogs often, hoping to record in this tiny corner of the vast Internet the once-in-a-lifetime experiences that matter to me, and to help those who seek help.