mac 下使用 lrzsz

版权声明:本文为twowinter原创文章,请联系微信公众号twowinter,未经博主允许不得转载。 https://blog.csdn.net/iotisan/article/details/88559545

前言

要和Linux服务器传输文件,一个非常简单的办法是使用 lrzsz。Windows下有很多办法,MAC下目前都是靠 mmastrac 编写的一个 Zmodem 脚本。

https://github.com/mmastrac/iterm2-zmodem

今天刚做完了实验,做个记录,在他 readme 的基础上做了一点命令丰富。

本文作者twowinter,转载请注明作者:http://blog.csdn.net/iotisan/

1 安装方法

  1. Install lrzsz on OSX: brew install lrzsz
  2. Save the iterm2-send-zmodem.sh and iterm2-recv-zmodem.sh scripts in /usr/local/bin/
$ sudo curl -O https://raw.githubusercontent.com/mmastrac/iterm2-zmodem/master/iterm2-send-zmodem.sh
$ sudo curl -O https://raw.githubusercontent.com/mmastrac/iterm2-zmodem/master/iterm2-recv-zmodem.sh
$ sudo chmod 777 /usr/local/bin/iterm2-*

小能手在这边出现过问题,卡住了好久,iTerm2 提示如下:

Coprocess terminated with output on stderr

这是由于下载的脚本有问题,需要重新下载下。

  1. Set up Triggers in iTerm 2 like so:
    How to Create a Trigger
    Regular expression: rz waiting to receive.\*\*B0100
    Action: Run Silent Coprocess
    Parameters: /usr/local/bin/iterm2-send-zmodem.sh
    Instant: checked

    Regular expression: \*\*B00000000000000
    Action: Run Silent Coprocess
    Parameters: /usr/local/bin/iterm2-recv-zmodem.sh
    Instant: checked

2 使用办法

To send a file to a remote machine:

  1. Type rz on the remote machine
  2. Select the file(s) on the local machine to send // 一切顺利的话,本地机子是会弹出一个文件浏览选择框。
  3. Wait for the coprocess indicator to disappear

The receive a file from a remote machine

  1. Type sz filename1 filename2 … filenameN on the remote machine
  2. Select the folder to receive to on the local machine
  3. Wait for the coprocess indicator to disappear

end


猜你喜欢

转载自blog.csdn.net/iotisan/article/details/88559545