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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What are your favorite UNIX tools?

11 点作者 aadhavans2 个月前
Either built-in tools, or those that follow the UNIX philosophy.<p>My favorite hidden gems in a base UNIX install are `tac` (print lines in reverse order) and `tr` (character substitutions).

9 条评论

wruza2 个月前
Most: grep, find, cat, sort, tail, wc, ls, sudo, pgrep.<p>Interesting: comm: <a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;comm" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;comm</a><p><i>Compare sorted files FILE1 and FILE2 line by line.<p>With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files.<p>-1 suppress column 1 (lines unique to FILE1)<p>-2 suppress column 2 (lines unique to FILE2)<p>-3 suppress column 3 (lines that appear in both files)</i><p>Weak: adduser&#x2F;useradd (hard to non-interactive), chmod (could use file&#x2F;dir filter with -R).<p>Least: systemctl, journalctl.
评论 #43307762 未加载
PaulHoule2 个月前
awk<p>(It&#x27;s a guilty pleasure to write shell pipelines that use awk to write a shell script and then pipe that script in sh, I find it easier than looking up the bizzaro syntax for loops in bash in the info pages.)
评论 #43294191 未加载
kasperset2 个月前
find<p>My command to backup selected file using Tarsnap. find &#x2F;Users&#x2F;xyz&#x2F;Analysis -type f \( -name &#x27;<i>.pdf&#x27; -o -name &#x27;</i>.docx&#x27; \) -print0 | tarsnap --dry-run --no-default-config --print-stats --humanize-numbers -c --null -T-<p>This command file files ending with docx and pdf to back with tarsnap. The &quot;-&quot; following the &quot;-T&quot; option allows to pass the name using std-in via find command
vermasque2 个月前
pbpaste and pbcopy to read and write to the clipboard and then combine with your favorite grep, sed, tr, cut, etc.
t-32 个月前
perl-rename - rename is also good, but much more annoying to use for me as it doesn&#x27;t use standard regex notation like perl-rename.<p>printf - shell is natively great at interpolation already, but having C-style printf formatting is often useful and echo has a lot of footguns
bediger40002 个月前
tr is surprisingly useful. If you&#x27;re clever, the -c and -d flags can do good things.<p>wc is also useful, mostly as &quot;wc -l&quot;. If you keep data in line oriented, human readable form, &quot;wc -l&quot; counts data items.
caprock2 个月前
ctrl-r in bash tops my list, even if it&#x27;s not quite what you are thinking of as a unix tool.<p>Probably the pipe itself would be my favorite next.<p>Then in no particular order: tail, cut, xargs, wc, tr, grep, sort, uniq.
manbart2 个月前
xclock with the cat theme
commandersaki2 个月前
comm &amp; awk