1.首先安装item2,item2 是类似于mac shell的终端
item2 下载地址,http://iterm2.com/downloads.html,下载后解压缩,直接运行。
2.Install Homebrew ##在下载和安装时需要花几分钟时间,
dragondeMacBook-Air:~ dragon$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to dragon:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin
==> /usr/bin/sudo /usr/sbin/chown dragon /usr/local/. /usr/local/bin
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown dragon /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 3769, done.
remote: Compressing objects: 100% (3608/3608), done.
remote: Total 3769 (delta 43), reused 534 (delta 26), pack-reused 0
Receiving objects: 100% (3769/3769), 3.21 MiB | 20.00 KiB/s, done.
Resolving deltas: 100% (43/43), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at 28c13e2 clockywock: add 0.3.1a bottle.
==> Installation successful!
==> Next steps
Run `brew help` to get started
dragondeMacBook-Air:~ dragon$ bre
break brew
dragondeMacBook-Air:~ dragon$ sudo brew install lrzsz
Error: Cowardly refusing to `sudo brew install`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
dragondeMacBook-Air:~ dragon$ brew install lrzsz
==> Downloading http://www.ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz
==> Downloading from https://ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/lrzsz/0.12.20 --mandir=/usr/local/Cel
==> make
==> make install
/usr/local/Cellar/lrzsz/0.12.20: 16 files, 456K, built in 41 seconds
dragondeMacBook-Air:~ dragon$
可以看到 ,安装成功了。
安装完成后检查 ls -alh /usr/local/bin/sz 是否存在
如果出现ls: /usr/local/bin/sz: No such file or directory 执行如下命令
wangqingyis-air:bin wangqingyi$ ln -s /usr/local/bin/lrz /usr/local/bin/rz
wangqingyis-air:bin wangqingyi$ ln -s /usr/local/bin/lsz /usr/local/bin/sz
4.下载iterm2-zmodem
wangqingyis-air:bin wangqingyi$ pwd
/usr/local/bin
wangqingyis-air:bin wangqingyi$ sudo wget https://raw.github.com/mmastrac/iterm2-zmodem/master/iterm2-send-zmodem.sh
wangqingyis-air:bin wangqingyi$ sudo wget https://raw.github.com/mmastrac/iterm2-zmodem/master/iterm2-recv-zmodem.sh
wangqingyis-air:~ wangqingyi$sudo chmod 777 /usr/local/bin/iterm2-*
5.运行下载的 iterm 添加trigger
打开iterm2 ------ 同时按 command和,键 ------- Profiles ---------- Default ------- Advanced ------ Triggers的Edit按钮
Regular expression: \*\*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