当前位置:网站首页>Iterm2 file transfer with remote server

Iterm2 file transfer with remote server

2022-06-21 13:38:00 Empty-Filled

One 、 Background introduction

Windows It can be used Xshell Remote server file transfer ,Mac Not on Xshell, Can pass iTerm2 Realization rz/sz function .

Two 、 step

  1. install lrzsz
brew install lrzsz
  1. download iterm2-zmodem
git clone https://github.com/aikuyun/iterm2-zmodem.git
  1. Copy iterm2-send-zmodem.sh and iterm2-recv-zmodem.sh Two scripts to /usr/local/bin
sudo cp iterm2-* /usr/local/bin
  1. Script permission setting
sudo chmod 777 /usr/local/bin/iterm2-*
  1. Set up iterm2 Of Trigger function ,Profiles->->Edit Profiles->Advanced Medium Tirgger, Add two records , They are as follows :
1. Article 1 with a 
        Regular expression: rz waiting to receive.\*\*B0100
        Action: Run Silent Coprocess
        Parameters: /usr/local/bin/iterm2-send-zmodem.sh
        Instant: checked
2. Second 
        Regular expression: \*\*B00000000000000
        Action: Run Silent Coprocess
        Parameters: /usr/local/bin/iterm2-recv-zmodem.sh
        Instant: checked

 Insert picture description here

  1. Server installation lrzsz
yum -y install lrzsz

3、 ... and 、rz、sz Use

  1. Upload files
#  Log on to the remote server , Input rz, Pop up to select a file 
rz
  1. File download
#  Log on to the remote server , Input sz+ File name , Choose a directory 
sz

Four 、QA & Reference

  1. /usr/local/bin/sz: No such file or directory
#  see sz The installation path 
which sz
#  In the replacement script sz The path is the actual value , such as /opt/homebrew/bin/sz
vim /usr/local/bin/iterm2-send-zmodem.sh
  1. iTerm2 official:
    https://iterm2.com/documentation.html
  2. iTerm2-zmodem download:
    https://github.com/aikuyun/iterm2-zmodem
原网站

版权声明
本文为[Empty-Filled]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221435219804.html