Direct reference to the documentation: HTTP://DANQINGDANI.BLOG.163.COM/BLOG/STATIC/18609419520141201215750
GitHub script that needs to be used: Https://github.com/mmastrac/iterm2-zmodem
Or concise steps are as follows:
1. Install Iterm2, homebrew
2. Installation Lrzsz: $brew Install Lrzsz
3. Download the script on GitHub and copy it to/usr/local/bin
4. In the corresponding profile in ITerm2, "Advance", "Trigger", fill in:
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
5. Log in to the remote machine, the machine needs to have Lrzsz (sudo yum install-y lrzsz). Theoretically, $rz, the Select File selection box will pop up on the local computer.
To transfer files using the SZ and RZ commands:
1. Open the Iterm2 terminal and log on to the remote server
2. Upload the local file to the remote server, enter the RZ command directly, pop up the window, select the path of the local file, click Choose to OK ~
3. Transfer the files on the remote server to local, enter SZ filename, pop-up window, select Local storage path, click Choose to OK ~
PS: This method is suitable for the use of SCP remote transfer files, it is not easy to feel it
Configure Lrzsz for ITerm2 on Mac machine, transfer files to remote server conveniently