<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bat on JiangYM&#39;s Blog</title>
    <link>https://jiangym.top/blog/tags/bat/</link>
    <description>Recent content from JiangYM&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    
    <managingEditor>xxx@example.com (JiangYM)</managingEditor>
    <webMaster>xxx@example.com (JiangYM)</webMaster>
    
    <copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright>
    
    <lastBuildDate>Tue, 15 Sep 2026 08:30:00 +0800</lastBuildDate>
    
    
    <atom:link href="https://jiangym.top/blog/tags/bat/index.xml" rel="self" type="application/rss&#43;xml" />
    

    
    

    <item>
      <title>ripgrep &#43; fd &#43; bat &#43; fzf：用了就回不去的老命令替代品</title>
      <link>https://jiangym.top/blog/post/linux-modern-cli-tools-replacements/</link>
      <pubDate>Tue, 15 Sep 2026 08:30:00 &#43;0800</pubDate>
      <author>xxx@example.com (JiangYM)</author>
      <guid>https://jiangym.top/blog/post/linux-modern-cli-tools-replacements/</guid>
      <description>
        <![CDATA[<h1>ripgrep + fd + bat + fzf：用了就回不去的老命令替代品</h1><p>作者：JiangYM（xxx@example.com）</p>
        
          <p>先上结论：如果你还在用 grep -r、find、cat、ls 这些老古董，今天看完这篇换掉，你会后悔——后悔为什么不早换。</p>
<p>大概半年前我还在用最朴素的 <code>grep -r</code> 找代码、<code>find . -name</code> 找文件、<code>cat</code> 看配置。直到有一次帮朋友 debug，看他用 rg 刷刷刷就把我要翻半天的东西搜出来了，我当场破防。</p>
<p>然后花了一个下午，把常用工具全换了。到现在用了大半年，说句实话——回不去了，回去就是降级体验。</p>
<h2 id="ripgreprg-grep-的究极体">
<a class="header-anchor" href="#ripgreprg-grep-%e7%9a%84%e7%a9%b6%e6%9e%81%e4%bd%93"></a>
ripgrep（rg）—— grep 的究极体
</h2><p>最核心的替换，没有之一。</p>
<p><code>grep -r &quot;pattern&quot; .</code> 和 <code>rg &quot;pattern&quot;</code> 的区别？这么说吧，前者像是拿扫帚扫地，后者像是用戴森吸尘器——你甚至还没反应过来它就扫完了。</p>
<p>rg 快的原因很简单：默认忽略 .gitignore 里的文件、跳过二进制、用 SIMD 加速。你不需要加 <code>--exclude-dir=node_modules</code> 这种骚操作，它本来就帮你跳过了。</p>
<p>我最常用的场景：</p>
<ul>
<li><strong>写 Hugo 模板找变量引用</strong>：<code>rg &quot;{{.*title&quot; content/</code>，秒出</li>
<li><strong>翻 nginx 配置</strong>：<code>rg &quot;proxy_pass&quot; /etc/nginx/ -l</code>，把改过的文件全列出来</li>
<li><strong>内存不够不想起 IDE</strong>：<code>rg -n &quot;TODO\|FIXME&quot; src/ --type-add 'code:*.{rs,go,py,js}' -t code</code></li>
</ul>
<p>不夸张，自从用了 rg，我打开 vscode 的频率都降了。在终端里直接搜完就地改，省了 IDE 启动那几秒。</p>
<h2 id="fd--比-find-好用的-find">
<a class="header-anchor" href="#fd--%e6%af%94-find-%e5%a5%bd%e7%94%a8%e7%9a%84-find"></a>
fd —— 比 find 好用的 find
</h2><p><code>find . -name &quot;*.py&quot;</code> 这种命令我写了十年，从来没觉得有啥问题。直到我知道了 <code>fd</code>。</p>
        
        <hr><p>本文2026-09-15首发于<a href='https://jiangym.top/blog/'>JiangYM's Blog</a>，最后修改于2026-09-15</p>]]>
      </description>
      
        <category>技术</category>
      
    </item>
    
  </channel>
</rss>
