Mac iterm2支持rz、sz

ZModem integration for iTerm 2

This script can be used to automate ZModem transfers from your OSX desktop to a server that can run lrzsz (in theory, any machine
that supports SSH), and vice-versa.

The minimum supported iTerm2 version is 1.0.0.20120108

Troubleshooting

  • Sending a directory may fail: this is a known issue
  • If you are using tmux or some other terminal multiplexer (ie: screen), try using the -e option to sz and/or rz on your server to force escaping of more characters during transmission.
  • This tool may also fail if you are using expect or rlogin as it expects a mostly-clean 8-bit connection between the two parties.

Setup

  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/
  3. Set up Triggers in iTerm 2 like so:
    How to Create a Trigger

<pre>
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

</pre>

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

Future plans (patches welcome)

  • Visual progress bar indicator

引用

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,854評論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,088評論 0 23
  • 2017年9月17日星期日晴 以為昨天的大雨今天會很冷呢,但醒了就發(fā)現(xiàn)窗外的天好藍云好白,這樣的好天氣當(dāng)然...
    風(fēng)箏2017閱讀 269評論 0 0
  • 想想最近一周的狀態(tài),每天都很忙,除了工作就是吃飯睡覺。然而我感覺決定工作有很大一進步的就是一件事做好就能發(fā)生...
    小茨閱讀 227評論 0 0
  • 丫頭對她的生父并無多少印象,因為從娘胎里出來那會到現(xiàn)在跟他見面的次數(shù)就屈指可數(shù),直至離婚后,那就更是少得可憐了,所...
    小奕瑾麻麻丶閱讀 238評論 0 0

友情鏈接更多精彩內(nèi)容