<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MacOS &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/macos/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Sat, 20 Jan 2024 17:24:55 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] MacOS下的那些diff工具</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8b%e7%9a%84%e9%82%a3%e4%ba%9bdiff%e5%b7%a5%e5%85%b7/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8b%e7%9a%84%e9%82%a3%e4%ba%9bdiff%e5%b7%a5%e5%85%b7/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Sat, 20 Jan 2024 17:01:51 +0000</pubDate>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[colordiff]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[grc]]></category>
		<category><![CDATA[icdiff]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[meld]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=14003</guid>

					<description><![CDATA[<p>diff命令是最常用的、比较两个文本文件差异的工具。但在很多情况下，它并不那么好用，比如你想高亮显示差异的内容时，单纯的diff命令就做不到了。<br />
本文讨论了在macOS系统下，diff命令的一些&#8220;增强版&#8221;工具，让你用起来更方便。<br />
<span id="more-14003"></span><br />
<span style="color:#ff0000;">➤</span>&#160;安装、设置好 Homebrew 并保持最新<br />
在macOS里，为了方便快捷地安装各种软件包，首先你要装好Homebrew，具体过程这里不详述，可参考<a href="https://www.codelast.com/?p=14050" rel="noopener" target="_blank">这个</a>链接。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&#160;让 diff&#160;命令彩色化：通过&#160;grc&#160;配合<br />
单纯的 diff 命令本身并不直接提供高亮显示差异内容的功能。diff 命令通常输出两个文件之间的差异，包括新增的行、删除的行以及修改的行，但它使用的是标准的文本输出，没有颜色高亮。<br />
为了让 diff 命令输出彩色的内容，可以安装 grc（Generic Colouriser）软件：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&#160;install&#160;grc
</code></pre>
</section>
<p>安装完成后，修改 ~/.bash_profile&#160;文件，添加一行：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;"><span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">alias</span>&#160;diff=<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&#39;/usr/local/bin/grc&#160;/usr/bin/diff&#39;</span></code></pre>
</section>
<p>然后重新打开终端，再用 <span style="color:#ff0000;">diff file1 file2</span>&#160;命令试一下，大概会是下面这样的效果：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="grc with diff" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_1_grc_with_diff.png" style="width: 800px; height: 274px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&#160;colordiff&#160;软件：直接输出彩色的diff<br />
嫌上面安装&#160;grc&#160;的方法烦？可以直接安装&#160;colordiff&#160;软件：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&#160;install&#160;colordiff
</code></pre>
</section>
<p>再用 <span style="color:#ff0000;">colordiff file1 file2</span>&#160;命令来显示diff，大概会是下面这样的效果：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="colordiff" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_2_colordiff.png" style="width: 800px; height: 273px;" /></a><br />
可以看到这个效果和 grc + diff&#160;差不多，所以考虑到简单，直接用colordiff就好了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8b%e7%9a%84%e9%82%a3%e4%ba%9bdiff%e5%b7%a5%e5%85%b7/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>diff命令是最常用的、比较两个文本文件差异的工具。但在很多情况下，它并不那么好用，比如你想高亮显示差异的内容时，单纯的diff命令就做不到了。<br />
本文讨论了在macOS系统下，diff命令的一些&ldquo;增强版&rdquo;工具，让你用起来更方便。<br />
<span id="more-14003"></span><br />
<span style="color:#ff0000;">➤</span>&nbsp;安装、设置好 Homebrew 并保持最新<br />
在macOS里，为了方便快捷地安装各种软件包，首先你要装好Homebrew，具体过程这里不详述，可参考<a href="https://www.codelast.com/?p=14050" rel="noopener" target="_blank">这个</a>链接。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;让 diff&nbsp;命令彩色化：通过&nbsp;grc&nbsp;配合<br />
单纯的 diff 命令本身并不直接提供高亮显示差异内容的功能。diff 命令通常输出两个文件之间的差异，包括新增的行、删除的行以及修改的行，但它使用的是标准的文本输出，没有颜色高亮。<br />
为了让 diff 命令输出彩色的内容，可以安装 grc（Generic Colouriser）软件：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&nbsp;install&nbsp;grc
</code></pre>
</section>
<p>安装完成后，修改 ~/.bash_profile&nbsp;文件，添加一行：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;"><span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">alias</span>&nbsp;diff=<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&#39;/usr/local/bin/grc&nbsp;/usr/bin/diff&#39;</span></code></pre>
</section>
<p>然后重新打开终端，再用 <span style="color:#ff0000;">diff file1 file2</span>&nbsp;命令试一下，大概会是下面这样的效果：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="grc with diff" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_1_grc_with_diff.png" style="width: 800px; height: 274px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;colordiff&nbsp;软件：直接输出彩色的diff<br />
嫌上面安装&nbsp;grc&nbsp;的方法烦？可以直接安装&nbsp;colordiff&nbsp;软件：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&nbsp;install&nbsp;colordiff
</code></pre>
</section>
<p>再用 <span style="color:#ff0000;">colordiff file1 file2</span>&nbsp;命令来显示diff，大概会是下面这样的效果：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="colordiff" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_2_colordiff.png" style="width: 800px; height: 273px;" /></a><br />
可以看到这个效果和 grc + diff&nbsp;差不多，所以考虑到简单，直接用colordiff就好了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;icdiff：左右双屏的diff对比工具，很直观<br />
上面的diff命令，都是上下形式来展示，我觉得看起来很难受。icdiff 软件可以改变这种情况。安装：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&nbsp;install&nbsp;icdiff
</code></pre>
</section>
<p>命令 <span style="color:#ff0000;">icdiff file1 file2</span>&nbsp;的效果如下：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="icdiff" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_3_icdiff.png" style="width: 800px; height: 356px;" /></a><br />
看到没，不仅左右对照，而且还彩色高亮显示，超级直观！<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;vim -d：基于vim的左右双屏对比<br />
使用 <span style="color:#ff0000;">vim -d file1 file2</span>&nbsp;命令，就可以在vim中左右双屏展示差异了：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="vim -d" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_5_vim.png" style="width: 800px; height: 385px;" /></a><br />
但是注意：当一行内容太长的时候，vim在diff模式下不会把内容自动换行显示，看起来很不方便，你可以用 <span style="color:#ff0000;">:set wrap</span>&nbsp;命令来开启自动换行。<br />
如果要让光标在左右屏之间切换，按<span style="color:#ff0000;">两下</span>快捷键 <span style="color:#ff0000;">Ctrl+w</span>&nbsp;即可。<br />
缺点：当一行内容超长的时候，即使开启了自动换行，在一行内跳转也是极不方便的，而且鼠标又不能滚动文本，我觉得不爽。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;code --diff：基于VSCode的左右双屏对比<br />
什么？你天天使用的VSCode也能用做 diff&nbsp;工具？没错：<br />
<span style="color:#ff0000;">code --diff file1 file2</span><br />
这样就能在VSCode编辑器里展示出两个文件的 diff&nbsp;啦：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="VSCode diff" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_6_vscode.png" style="width: 800px; height: 434px;" /></a><br />
如果你想修改diff显示的颜色，你甚至可以修改VSCode的配置(settings.json)来实现：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="json language-json hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;"><span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;workbench.colorCustomizations&quot;</span>:&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-attr" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">&quot;diffEditor.insertedTextBackground&quot;</span>:&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;#fc00ce7c&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-attr" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">&quot;diffEditor.removedTextBackground&quot;</span>:&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;#4542f97c&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-attr" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">&quot;diffEditor.insertedLineBackground&quot;</span>:&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;#d9f4db66&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-attr" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">&quot;diffEditor.removedLineBackground&quot;</span>:&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;#e6dbe066&quot;</span>,
}
</code></pre>
</section>
<p>在这个例子中，workbench.colorCustomizations&nbsp;里的配置都是我添加的。<br />
diffEditor.insertedTextBackground&nbsp;配置的是 file1&nbsp;里的diff内容的颜色；<br />
diffEditor.removedTextBackground&nbsp;配置的是 file2&nbsp;里的diff内容的颜色；<br />
diffEditor.insertedLineBackground&nbsp;配置的是 file1&nbsp;里的diff行的背景色；<br />
diffEditor.removedLineBackground&nbsp;配置的是 file2&nbsp;里的diff行的背景色。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;Meld：图形化的双屏/三屏diff对比工具<br />
MacOS下的<a href="https://yousseb.github.io/meld/" rel="noopener" target="_blank">Meld</a>是另一个图形化diff工具。这个软件类似于Linux下的 meld&nbsp;软件，它不仅可以对比两个文件的 diff，还可以对比三个文件的diff。<br />
不过我在M2 CPU的MacOS上用起来，时不时会crash一次，所以就不想再用了。<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="Meld" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_4_meld.png" style="width: 800px; height: 429px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;超长文本行的diff高亮显示<br />
上面提到的命令行的diff工具，在遇到超长文本行+某些内容的时候，在显示diff的时候都有这样那样的问题。<br />
例如，file1 的第一行和 file2 的第一行都有一万个字符，但它们仅仅在其中的5个字符有差异，那么diff工具理论上应该高亮显示出那5个字符。<br />
但实际上，当这行的内容有些特殊的时候，命令行diff工具可能会高亮显示出整行，而不是那5个字符；或者高亮显示的是多于那5个字符的一块区域。总之它有可能没法精确地标识出diff的部分。<br />
这里举一个例子：<br />
1.txt 和 2.txt 的第一行都超长，它们只在几个字符上有差异：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="VSCode diff long line" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_7_vscode_deal_with_long_line.png" style="width: 800px; height: 44px;" /></a><br />
可见VSCode正确地只高亮了有差异的部分。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
如果用 icdiff 1.txt 2.txt 来查看差异，就非常扯蛋了，它没能像VSCode一样仅标识出diff的部分，而是把整行都标识成了diff，辣眼睛：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="icdiff deal with long line" src="https://www.codelast.com/wp-content/uploads/2024/01/mac_os_diff_tool_8_icdiff_deal_with_long_line.png" style="width: 800px; height: 322px;" /></a></p>
<p>在这种情况下，VSCode和Meld都可以正确标识出diff的内容。<br />
所以图形化diff工具还是有用的，别只迷信命令行。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：<br />
<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8b%e7%9a%84%e9%82%a3%e4%ba%9bdiff%e5%b7%a5%e5%85%b7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] MacOS上的Homebrew记录</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8a%e7%9a%84homebrew%e8%ae%b0%e5%bd%95/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8a%e7%9a%84homebrew%e8%ae%b0%e5%bd%95/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Sat, 20 Jan 2024 16:52:09 +0000</pubDate>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Homebrew]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[软件包管理]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=14050</guid>

					<description><![CDATA[<p>本文记录了MacOS上的软件包管理器Homebrew的若干琐事。</p>
<blockquote>
<p>
		Homebrew 是一个自由和开源的软件包管理系统，专为 macOS 设计，用于简化软件安装过程。它允许用户容易地安装、更新和卸载各种软件包，包括命令行工具、开发工具和常用库。Homebrew 通过 GitHub 维护，并且它的软件包是从 GitHub 仓库中获取的。</p>
</blockquote>
<p><span id="more-14050"></span><br />
<span style="color: rgb(255, 0, 0);">➤</span>&#160;安装 Homebrew 并保持最新<br />
在macOS里，为了方便快捷地安装各种软件包，首先你要装好Homebrew。<br />
安装Homebrew的过程此处不赘述，请参考Homebrew官网。<br />
如果你早已安装过，那么注意要保持它最新：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; letter-spacing: 0px; color: rgb(62, 62, 62); line-height: 1.6; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">
<pre style="padding: 0px; font-size: inherit; width: 1066.23px; margin-top: 0px; margin-bottom: 0px; color: inherit; line-height: inherit;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&#160;update
</code></pre>
</section>
<p>这个过程可能耗时较长。<br />
如果你不更新，可能会在用 brew install xxx&#160;安装软件包的时候，看到类似于下面的提示：</p>
<blockquote>
<div>
		==&#62; Searching for similarly named formulae...</div>
<div>
		Error: No similarly named formulae found.</div>
<div>
		Error: No available formula or cask with the name &#34;grc&#34;.</div></blockquote>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8a%e7%9a%84homebrew%e8%ae%b0%e5%bd%95/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>本文记录了MacOS上的软件包管理器Homebrew的若干琐事。</p>
<blockquote>
<p>
		Homebrew 是一个自由和开源的软件包管理系统，专为 macOS 设计，用于简化软件安装过程。它允许用户容易地安装、更新和卸载各种软件包，包括命令行工具、开发工具和常用库。Homebrew 通过 GitHub 维护，并且它的软件包是从 GitHub 仓库中获取的。</p>
</blockquote>
<p><span id="more-14050"></span><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;安装 Homebrew 并保持最新<br />
在macOS里，为了方便快捷地安装各种软件包，首先你要装好Homebrew。<br />
安装Homebrew的过程此处不赘述，请参考Homebrew官网。<br />
如果你早已安装过，那么注意要保持它最新：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; letter-spacing: 0px; color: rgb(62, 62, 62); line-height: 1.6; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="padding: 0px; font-size: inherit; width: 1066.23px; margin-top: 0px; margin-bottom: 0px; color: inherit; line-height: inherit;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&nbsp;update
</code></pre>
</section>
<p>这个过程可能耗时较长。<br />
如果你不更新，可能会在用 brew install xxx&nbsp;安装软件包的时候，看到类似于下面的提示：</p>
<blockquote>
<div>
		==&gt; Searching for similarly named formulae...</div>
<div>
		Error: No similarly named formulae found.</div>
<div>
		Error: No available formula or cask with the name &quot;grc&quot;.</div>
<div>
		==&gt; Searching for a previously deleted formula (in the last month)...</div>
<div>
		Error: No previously deleted formula found.</div>
<div>
		==&gt; Searching taps on GitHub...</div>
<div>
		Error: No formulae found in taps.</div>
</blockquote>
<div>
	也就是说Homebrew找不到软件包。</div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;设置 GitHub&nbsp;密钥，让Homebrew可以正常安装软件<br />
如果你没有设置过 GitHub&nbsp;密钥，当你执行 brew install xxx&nbsp;命令来安装软件的时候，会报错：</p>
<blockquote>
<div>
		Error: GitHub</div>
<div>
		The GitHub credentials in the macOS keychain may be invalid.</div>
<div>
		Clear them with:</div>
<div>
		&nbsp; printf &quot;protocol=https\nhost=github.com\n&quot; | git credential-osxkeychain erase</div>
<div>
		Or create a personal access token:</div>
<div>
		&nbsp; https://github.com/settings/tokens/new?scopes=gist,public_repo&amp;description=Homebrew</div>
<div>
		and then set the token as: export HOMEBREW_GITHUB_API_TOKEN=&quot;your_new_token&quot;</div>
</blockquote>
<p>大概意思就是，你需要到上面的这个GitHub链接里设置、生成一个token，然后把&nbsp;<span style="color: rgb(0, 0, 255);">HOMEBREW_GITHUB_API_TOKEN</span>&nbsp;这个环境变量设置成你生成的那个token。<br />
照做就得了。生成token之后，编辑&nbsp;~/.bash_profile&nbsp;文件，添加一行：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; letter-spacing: 0px; color: rgb(62, 62, 62); line-height: 1.6; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="padding: 0px; font-size: inherit; width: 1066.23px; margin-top: 0px; margin-bottom: 0px; color: inherit; line-height: inherit;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;"><span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); overflow-wrap: inherit !important; word-break: inherit !important;">export</span>&nbsp;HOMEBREW_GITHUB_API_TOKEN=xxx
</code></pre>
</section>
<p>其中，xxx&nbsp;代表你在GitHub上生成的那个 token。<br />
这样做之后，你理应可以用 brew install&nbsp;来正常安装软件了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;Homebrew加速：设置国内镜像<br />
由于Homebrew默认使用的是GitHub上的仓库，对于国内用户来说，访问速度可能会比较慢。国内有一些机构提供了Homebrew的镜像，可以用来加速软件包的下载和安装：中科大镜像、清华镜像、阿里云镜像等。<br />
以阿里云镜像为例：<br />
替换 brew.git：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; letter-spacing: 0px; color: rgb(62, 62, 62); line-height: 1.6; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="padding: 0px; font-size: inherit; width: 1066.23px; margin-top: 0px; margin-bottom: 0px; color: inherit; line-height: inherit;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">git&nbsp;-C&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); overflow-wrap: inherit !important; word-break: inherit !important;">&quot;<span class="hljs-variable" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(98, 151, 85); overflow-wrap: inherit !important; word-break: inherit !important;">$(brew&nbsp;--repo)</span>&quot;</span>&nbsp;remote&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); overflow-wrap: inherit !important; word-break: inherit !important;">set</span>-url&nbsp;origin&nbsp;https://mirrors.aliyun.com/homebrew/brew.git
</code></pre>
</section>
<p>替换&nbsp;homebrew-core.git：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; letter-spacing: 0px; color: rgb(62, 62, 62); line-height: 1.6; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="padding: 0px; font-size: inherit; width: 1066.23px; margin-top: 0px; margin-bottom: 0px; color: inherit; line-height: inherit;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">git&nbsp;-C&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); overflow-wrap: inherit !important; word-break: inherit !important;">&quot;<span class="hljs-variable" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(98, 151, 85); overflow-wrap: inherit !important; word-break: inherit !important;">$(brew&nbsp;--repo&nbsp;homebrew/core)</span>&quot;</span>&nbsp;remote&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); overflow-wrap: inherit !important; word-break: inherit !important;">set</span>-url&nbsp;origin&nbsp;https://mirrors.aliyun.com/homebrew/homebrew-core.git
</code></pre>
</section>
<p>替换&nbsp;homebrew-cask.git（如果需要）：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; letter-spacing: 0px; color: rgb(62, 62, 62); line-height: 1.6; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="padding: 0px; font-size: inherit; width: 1066.23px; margin-top: 0px; margin-bottom: 0px; color: inherit; line-height: inherit;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">git&nbsp;-C&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); overflow-wrap: inherit !important; word-break: inherit !important;">&quot;<span class="hljs-variable" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(98, 151, 85); overflow-wrap: inherit !important; word-break: inherit !important;">$(brew&nbsp;--repo&nbsp;homebrew/cask)</span>&quot;</span>&nbsp;remote&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); overflow-wrap: inherit !important; word-break: inherit !important;">set</span>-url&nbsp;origin&nbsp;https://mirrors.aliyun.com/homebrew/homebrew-cask.git
</code></pre>
</section>
<p>然后再执行 brew update&nbsp;来更新本地仓库。</p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：<br />
<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e4%b8%8a%e7%9a%84homebrew%e8%ae%b0%e5%bd%95/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] MacOS的ssh命令报错：Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e7%9a%84ssh%e5%91%bd%e4%bb%a4%e6%8a%a5%e9%94%99%ef%bc%9alibrary-not-loaded-usr-local-opt-openssl-lib-libcrypto-1-0-0-dylib/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e7%9a%84ssh%e5%91%bd%e4%bb%a4%e6%8a%a5%e9%94%99%ef%bc%9alibrary-not-loaded-usr-local-opt-openssl-lib-libcrypto-1-0-0-dylib/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Fri, 19 Jan 2024 19:42:17 +0000</pubDate>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Library not loaded]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[OpenSSH]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[ssh]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=14021</guid>

					<description><![CDATA[<p>MacOS执行一个连接远程服务器的命令 <span style="color:#b22222;">ssh root@192.168.10.78 &#34;mkdir -p /data&#34;</span> 命令时，报错：</p>
<blockquote>
<div>
		dyld[52840]: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib</div>
<div>
		&#160; Referenced from: &#60;此处内容省略&#62; /usr/local/Cellar/openssh/7.8p1/bin/ssh</div>
<div>
		&#160; Reason: tried: &#39;/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/local/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/lib/libcrypto.1.0.0.dylib&#39; (no such file, not in dyld cache), &#39;/usr/local/Cellar/openssl@3/3.2.0_1/lib/libcrypto.1.0.0.dylib&#39;</div></blockquote>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e7%9a%84ssh%e5%91%bd%e4%bb%a4%e6%8a%a5%e9%94%99%ef%bc%9alibrary-not-loaded-usr-local-opt-openssl-lib-libcrypto-1-0-0-dylib/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>MacOS执行一个连接远程服务器的命令 <span style="color:#b22222;">ssh root@192.168.10.78 &quot;mkdir -p /data&quot;</span> 命令时，报错：</p>
<blockquote>
<div>
		dyld[52840]: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib</div>
<div>
		&nbsp; Referenced from: &lt;此处内容省略&gt; /usr/local/Cellar/openssh/7.8p1/bin/ssh</div>
<div>
		&nbsp; Reason: tried: &#39;/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/local/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/lib/libcrypto.1.0.0.dylib&#39; (no such file, not in dyld cache), &#39;/usr/local/Cellar/openssl@3/3.2.0_1/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/openssl@3/3.2.0_1/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/local/Cellar/openssl@3/3.2.0_1/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/local/lib/libcrypto.1.0.0.dylib&#39; (no such file), &#39;/usr/lib/libcrypto.1.0.0.dylib&#39; (no such file, not in dyld cache)</div>
</blockquote>
<div>
	这个问题可能是因为<span style="color:#0000ff;">OpenSSH</span>版本旧导致的。可以尝试更新<span style="color:#0000ff;">OpenSSH</span>来解决：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&nbsp;update
brew&nbsp;upgrade&nbsp;openssh
</code></pre>
</section>
<p>重试，如果仍然报错，可能要尝试重新安装OpenSSH了：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="bash language-bash hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">brew&nbsp;uninstall&nbsp;--ignore-dependencies&nbsp;openssh
brew&nbsp;install&nbsp;openssh
</code></pre>
</section>
<p>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：<br />
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
	以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-macos%e7%9a%84ssh%e5%91%bd%e4%bb%a4%e6%8a%a5%e9%94%99%ef%bc%9alibrary-not-loaded-usr-local-opt-openssl-lib-libcrypto-1-0-0-dylib/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
