简述
lrzsz 是 Linux/Unix 与 Windows 进行 ZModem 文件传输的命令行工具,使得无需再开一个工具去进行文件传输,在 mac 下如果不进行配置是无法直接使用的,并且会造成终端卡死
安装 lrzsz
下载相关 shell 脚本
1 2 3 4 5 6 7 8 9
| sudo mkdir /usr/local/bin/iterm2-lrzsz sudo chmod 755 /usr/local/bin/iterm2-lrzsz cd /usr/local/bin/iterm2-lrzsz
sudo wget https://gist.githubusercontent.com/sy-records/1b3010b566af42f57fa6fa38138dd22a/raw/2bfe590665d3b0e6c8223623922474361058920c/iterm2-send-zmodem.sh
sudo wget https://gist.githubusercontent.com/sy-records/40f4ba22e3fbdeedf58463b067798962/raw/b32d2f7ac3fa54acca81be3664797cebb724690f/iterm2-recv-zmodem.sh
sudo chmod +x iterm2-*.sh
|
配置规则
iTerm2 -> Perference -> Profiles -> Default -> Advanced -> Triggers -> Edit
1 2 3 4 5 6 7 8 9
| Regular expression: rz waiting to receive.\*\*B0100 Action: Run Silent Coprocess Parameters: /usr/local/bin/iterm2-lrzsz/iterm2-send-zmodem.sh Instant: checked
Regular expression: \*\*B00000000000000 Action: Run Silent Coprocess Parameters: /usr/local/bin/iterm2-lrzsz/iterm2-send-zmodem.sh Instant: checked
|
安装完成后检查
1 2 3 4 5 6 7
| ls -alh /usr/local/bin/sz
brew list lrzsz
ln -s /opt/homebrew/Cellar/lrzsz/0.12.20_1/bin/lrz /usr/local/bin/rz ln -s /opt/homebrew/Cellar/lrzsz/0.12.20_1/bin/lsz /usr/local/bin/sz
|
测试