TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Rawhide – (rh) find files using pretty C expressions

61 点作者 gbrown_超过 2 年前

4 条评论

unwind超过 2 年前
This sounds like an awesome tool, and the &quot;hacker spirit&quot; of it really speaks to me.<p>It&#x27;s really fitting to have a supremely technical and focused tool like this be described with things like &quot;pretty C expressions&quot; and (my favorite) &quot;it&#x27;s like find(1), but more fun to use&quot;, because obviously writing low-level C-like expressions to match against files is <i>fun</i>, most of all. Love it.<p>Also some of the examples are truly powerful, and at least I was not aware of any tool that could do things like this:<p><pre><code> # Find executable files that are larger than 10KiB, and have not been executed in the last 24 hours: anyx &amp;&amp; sz &gt; 10K &amp;&amp; atime &lt; ago(day) # Find regular files with multiple hard links f &amp;&amp; nlink &gt; 1 # Find symlinks whose ultimate targets are on a different filesystem: texists &amp;&amp; tdev != dev </code></pre> Examples all cherry-picked from the manual page, and I picked the most terse version, more readable&#x2F;explanatory versions using fewer built-ins are also available.<p>Many of the examples feel liks &quot;I would never need that&quot;-territory, until you do and then it&#x27;s like impossible unless you write your own specialized tool to do it, or reach for this. Very cool!
an1sotropy超过 2 年前
Looking at the last line:<p><pre><code> Authors: 1990 Ken Stauffer, 2022 raf &lt;raf@raf.org&gt; </code></pre> Has this been around since 1990?<p>I’m bummed I didn’t know about it. The variety of output options is amazing.
评论 #33004500 未加载
评论 #32982984 未加载
评论 #32980358 未加载
rurban超过 2 年前
What did he do to rh? I suppose just adding json support, and 64bit off_t support.<p>Ah, I see: <a href="https:&#x2F;&#x2F;github.com&#x2F;raforg&#x2F;rawhide&#x2F;commits&#x2F;main" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;raforg&#x2F;rawhide&#x2F;commits&#x2F;main</a> A bit more cleanup and handy aliases also.
评论 #32982041 未加载
评论 #33005045 未加载
tyingq超过 2 年前
This looks very handy, and maps closely to something I use Perl for, but that requires more boilerplate.<p>But, if you find yourself wanting something like this, and don&#x27;t want to install anything new... Here&#x27;s something close in Perl that uses File::stat (this ships with Perl):<p><pre><code> find . -print | perl -MFile::stat -nE &#x27;chomp;$s=stat($_);$s-&gt;nlink &gt; 1 &amp;&amp; say&#x27;</code></pre>
评论 #32990358 未加载