本文共 4483 字,大约阅读时间需要 14 分钟。
转自:
安装方式和苹果的安装方式是一样的,解压双击 把他拖进application中就可以了。
吐槽一下 好多的博客写的是很简单,一个命令 brew install lrzsz。。。可是也许有很多人没有brew这个命令 比如我 总是not found command,伤心。。
简单介绍一下,一般我们在unix或者类unix的linux系统上,使用yum或者apt-get,不过抱歉,在mac osx上好像不好使,所以几经周折找到homebrew简称brew,它的功能就类似yum或者apt-get。它是max osx上的软件包管理工具。
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
注意: 我在安装过程中看了很多博客,也尝试过很多链接,甚至打算翻墙来着,不过上面这条语句我一次执行就通过了(没翻墙),并看到了成功的标记 successful。
注意 在安装过会有一次卡顿,建入回车 接着我们会看到让我们输入密码,输入密码后等待安装就可以了。
好了,安装成功后输入 brew 查看是否有提示信息
harryliangdeMacBook-Pro:~ harryliang$ brewExample usage: brew search [TEXT|/REGEX/] brew (info|home|options) [FORMULA...] brew install FORMULA... brew update brew upgrade [FORMULA...] brew uninstall FORMULA... brew list [FORMULA...]Troubleshooting: brew config brew doctor brew install -vd FORMULADevelopers: brew create [URL [--no-fetch]] brew edit [FORMULA...] https://docs.brew.sh/Formula-Cookbook.htmlFurther help: man brew brew help [COMMAND] brew home
如果看到如上信息,则表示brew安装成功了。
brew install lrzsz
要想使用rz 和sz进行上传下载我们要尽兴一些配置
cd /usr/local/bin
这个目录下需要两个配置文件,这个配置文件可以自己粘贴,也可以去github网站下载。
命令:
vi iterm2-recv-zmodem.shvi iterm2-send-zmodem.sh
创建好两个文件后分别添加内容:
#!/bin/bash# Author: Matt Mastracci (matthew@mastracci.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 domainosascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTermif [[ $NAME = "iTerm" ]]; then FILE=`osascript -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 FILE=`osascript -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)&\"\")"`fiif [[ $FILE = "" ]]; then echo Cancelled. # Send ZModem cancel echo -e \\x18\\x18\\x18\\x18\\x18 sleep 1 echo echo \# Cancelled transferelse cd "$FILE" /usr/local/bin/rz -E -e -b sleep 1 echo echo echo \# Sent \-\> $FILEfi
#!/bin/bash# Author: Matt Mastracci (matthew@mastracci.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 domainosascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTermif [[ $NAME = "iTerm" ]]; then FILE=`osascript -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 FILE=`osascript -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)&\"\")"`fiif [[ $FILE = "" ]]; then echo Cancelled. # Send ZModem cancel echo -e \\x18\\x18\\x18\\x18\\x18 sleep 1 echo echo \# Cancelled transferelse /usr/local/bin/sz "$FILE" -e -b sleep 1 echo echo \# Received $FILEfi
chmod +777 iterm2-*
--- 在最后一个图片的位置进行配置,上图是配置好的样子,配置文件如下:
Regular expression: rz waiting to receive.\*\*B0100Action: Run Silent CoprocessParameters: /usr/local/bin/iterm2-send-zmodem.shRegular expression: \*\*B00000000000000Action: Run Silent CoprocessParameters: /usr/local/bin/iterm2-recv-zmodem.sh
按照上面的配置文件信息的格式填写即可。
转载地址:http://cxadi.baihongyu.com/