杭州市建设职业中心网站,常州网站建设代理商,怎么做一个小程序app,免费注册126邮箱1、安装brew#xff08;找了很多#x1f517;#xff0c;就这个博主的好用#xff09;
Mac如何安装brew#xff1f;_行走的码农00的博客-CSDN博客_mac brew
2、安装lrzsz
brew install lrzsz
检查是否安装成功
brew list
定位lrzsz的安装目录
brew list lrzsz
执…1、安装brew找了很多就这个博主的好用
Mac如何安装brew_行走的码农00的博客-CSDN博客_mac brew
2、安装lrzsz
brew install lrzsz
检查是否安装成功
brew list
定位lrzsz的安装目录
brew list lrzsz
执行结果如下 3、配置rz sz 进行上传下载
进入lrzsz的安装目录bin下
cd /opt/homebrew/bin
创建两个文件
$FILE 后面的配置路径为lrzsz的安装目录bin
sudo vim iterm2-recv-zmodem.sh #!/bin/bash # Author: Matt Mastracci (matthewmastracci.com) # AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script # licensed under cc-wiki with attribution required # Remainder of script public domain osascript -e tell application iTerm2 to version /dev/null 21 NAMEiTerm2 || NAMEiTerm if [[ $NAME iTerm ]]; then FILEosascript -e tell application iTerm to activate -e tell application iTerm to set thefile to choose folder with prompt Choose a folder to place received files in -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\) else FILEosascript -e tell application iTerm2 to activate -e tell application iTerm2 to set thefile to choose folder with prompt Choose a folder to place received files in -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\) fi if [[ $FILE ]]; then echo Cancelled. # Send ZModem cancel echo -e \\x18\\x18\\x18\\x18\\x18 sleep 1 echo echo \# Cancelled transfer else cd $FILE /opt/homebrew/bin/rz -E -e -b sleep 1 echo echo echo \# Sent \-\ $FILE fi sudo vim iterm2-send-zmodem.sh #!/bin/bash # Author: Matt Mastracci (matthewmastracci.com) # AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script # licensed under cc-wiki with attribution required # Remainder of script public domain osascript -e tell application iTerm2 to version /dev/null 21 NAMEiTerm2 || NAMEiTerm if [[ $NAME iTerm ]]; then FILEosascript -e tell application iTerm to activate -e tell application iTerm to set thefile to choose file with prompt Choose a file to send -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\) else FILEosascript -e tell application iTerm2 to activate -e tell application iTerm2 to set thefile to choose file with prompt Choose a file to send -e do shell script (\echo \(quoted form of POSIX path of thefile as Unicode text)\\) fi if [[ $FILE ]]; then echo Cancelled. # Send ZModem cancel echo -e \\x18\\x18\\x18\\x18\\x18 sleep 1 echo echo \# Cancelled transfer else /opt/homebrew/bin/sz $FILE -e -b sleep 1 echo echo \# Received $FILE fi 给予权限
chmod -R 777 iterm2-recv-zmodem.shchmod -R 777 iterm2-send-zmodem.sh
4、iTerm2 配置添加rz sz 功能
点击 iTerm2 的设置界面 Perference- Profiles - Default - Advanced - Triggers 的 Edit 按钮 配置内容如下 第一行 rz waiting to receive.\*\*B0100 Run Silent Coprocess /opt/homebrew/bin/iterm2-send-zmodem.sh 第二行 \*\*B00000000000000 Run Silent Coprocess /opt/homebrew/bin/iterm2-recv-zmodem.sh Instant 打钩的话不需要重启item 然后就可以使用rz、rz命令啦~