macOS 安装lrzsz

macOS 安装lrzszmac自带的终端是不支持lrzsz的,需要下载安装iterm2MacOS终端利器iTerm2安装homebrewbrew的MAC安装macOS安装lrzsz进入/usr/local/bin由于原作者下架了项目,我们只能手动新建脚本了,下面请无脑全部复制即可。1.创建iterm2-recv-zmodem.sh#!/bin/bashosascript-e…

大家好,又见面了,我是你们的朋友全栈君。

mac自带的终端是不支持lrzsz的,需要下载安装iterm2

Mac OS 终端利器 iTerm2

安装homebrew

brew的MAC安装

macOS 安装lrzsz

进入/usr/local/bin

由于原作者下架了项目,我们只能手动新建脚本了,下面请无脑全部复制即可。

1.创建iterm2-recv-zmodem.sh

#!/bin/bash

osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
	FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
else
	FILE=`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "iTerm2" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
fi

if [[ $FILE = "" ]]; then
	echo Cancelled.
	# Send ZModem cancel
	echo -e \\x18\\x18\\x18\\x18\\x18
	sleep 1
	echo
	echo \# Cancelled transfer
else
	cd "$FILE"
	/usr/local/bin/rz -E -e -b
	sleep 1
	echo
	echo
	echo \# Sent \-\> $FILE
fi

2.创建iterm2-send-zmodem.sh

#!/bin/bash

osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
	FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
else
	FILE=`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "iTerm2" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
fi
if [[ $FILE = "" ]]; then
	echo Cancelled.
	# Send ZModem cancel
	echo -e \\x18\\x18\\x18\\x18\\x18
	sleep 1
	echo
	echo \# Cancelled transfer
else
	/usr/local/bin/sz "$FILE" -e -b
	sleep 1
	echo
	echo \# Received $FILE
fi

3.增加刚才新建的两个文件的权限

chmod +x iterm2-send-zmodem.sh 
chmod +x iterm2-recv-zmodem.sh 

4.设置item2

步骤:command+“,” 组合键打开item2的“Preferences”面板->Profiles选项卡->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

macOS 安装lrzsz

勾选了 instant就不需要重启items了,然后就可以愉快的传输文件了。

现在就有弹窗了哦~

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/152479.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)
blank

相关推荐

  • Oracle数据库恢复删除数据的方法

    Oracle数据库恢复删除数据的方法误删oracle数据库中的数据,在不考虑全库备份和利用归档日志情况,怎样快速恢复数据呢?下面介绍3种方法。1.利用oracle提供的闪回方法进行数据恢复,适用于delete删除方式首先获取删除数据的时间点:select*fromv$sqlwheresql_textlike’%table_name%’;根据结果中的sql_text内容,找到delete执行语句对应的删除时间点,执行下面语句查询出删除的数据。select*fromtable_nameasoftime

  • hook declined to update refs_抓包工具packet capture

    hook declined to update refs_抓包工具packet capture发包工具TRexstateless使用笔记https://github.com/cisco-system-traffic-generator/trex-coreLinux运行优化forfilein`find/sys/devices/system/cpu/-namescaling_governor`;doechoperformance>$file;doneec…

  • word2vec原理与Gensim使用[通俗易懂]

    word2vec原理与Gensim使用[通俗易懂]word2vec原理1NeuralNetworkLanguageModel2CBOW2.1HierarchicalSoftmax2.2NegativeSampling3Skip-gram3.1HierarchicalSoftmax3.2NegativeSampling4负采样算法5.word2vec实战1NeuralNetworkLanguageModel…

  • beanutils.copyproperties原理_beanutils工具类

    beanutils.copyproperties原理_beanutils工具类常用的BeanUtils.copyProperties方法,你知道它的实现原理吗?

  • idea 2022.01.4激活码(注册激活)2022.02.14

    (idea 2022.01.4激活码)最近有小伙伴私信我,问我这边有没有免费的intellijIdea的激活码,然后我将全栈君台教程分享给他了。激活成功之后他一直表示感谢,哈哈~https://javaforall.cn/100143.htmlIntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,上面是详细链接哦~4KDD…

  • traceroute工作原理[通俗易懂]

    traceroute工作原理[通俗易懂]traceroute,也就是traceroute,跟踪路由。这个程序最早是VanJacobson实现的。源代码在网上能够找到,只是我还没有去找。基本的原理是IP路由过程中对数据包TTL(Tim

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号