Transfer Files with iTerm sz/rz

6 Quick Steps

Darryl Leong
2 min readSep 17, 2021

This is a quick guide on transferring files between your local system and a remote server.

1. Download iTerm:

2. Install lrzsz package in iTerm terminal

sudo brew install lrzsz

3. Add the following scripts to usr/local/bin in both local and remote server

4. Change Permission for iTerm scripts (both local & remote server)

chmod 777 iterm2-*

5. Set up iTerm2 triggers

  • iTerm2’s [preference] -> [profile] -> [advanced] -> [triggers] -> [edit]
Regular expression: rz waiting to receive.\*\*B0100
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-send-zmodem.sh
Regular expression: \*\*B00000000000000
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-recv-zmodem.sh

6. Transfer files

  1. On receiving side: execute ‘rz’. This will open a prompt for you to select the file you are preparing to receive.
  2. On sending side: execute ‘sz’. This will open a prompt for you to select the file to send.

And voilà, if you’ve followed these simple steps, you should have successfully sent your file over to your remote server! Hope this helped at least 1 person. I had to reference several articles to get this done [listed below] so I decided to compile all of it into 1 article.

References:

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Darryl Leong
Darryl Leong

Written by Darryl Leong

I write sometimes because its fun

No responses yet

Write a response