HackerURLs

一次又一次被重新发现的经典。

同一个链接,相隔一年以上,一次又一次被人重新发现、再次冲上 Hacker News 首页。能经受住这种时间检验的,大多是值得一读再读的文章。每篇附中文标题,讨论最热的那些再加上中文导读和高赞评论翻译。

从名人堂开始
  • 4,700+篇经过时间检验的经典

Hall of fame

名人堂

在经典库里看全部精选

上首页次数最多、而且有中文导读的 30 篇。时间轴上每个黑点是一次上首页,空心点是一次没冲上去的投稿。

  1. 正在载入经典…

Archive

经典库

按第一次上首页的年份分布,点柱子筛选。

排序

    About

    这些经典是怎么挑出来的

    1. 01

      合并同一个链接

      读取 Hacker News 自 2006 年以来的全部链接投稿,把 http/https、www、跟踪参数等写法不同的同一篇文章合并成一条。

    2. 02

      只留经得起时间的

      同一链接至少两次拿到 50 分以上(约等于上首页),而且两次相隔一年以上;再由 AI 剔除状态页、产品首页和新闻事件。

    3. 03

      写导读、译评论

      上首页次数最多的 2,000 篇配上中文导读、"为什么经久不衰",并精选翻译 HN 高赞评论。导读由 AI 生成,可能有误。

    工具与资源joeyh.name

    moreutils:一组早该有人编写的 Unix 工具

    Moreutils: A collection of Unix tools that nobody thought to write long ago

    4次上首页
    7年跨度
    1,161累计得分
    570条评论

    2015 — 2022,它一次次回到首页

    黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。

    导读

    Moreutils 是 Joey Hess 维护的一组 Unix 小工具合集,收录了 sponge、vipe、vidir、ts、errno 等标准 Unix 工具集中缺失但很实用的命令。这些工具填补了管道处理中的常见空白,比如在管道中插入编辑器、安全地回写文件等。

    为什么经久不衰:它解决的是 Unix 命令行几十年来一直存在的真实缺口,工具小巧稳定,多年后仍是命令行用户的实用补充。

    关键词 Unix工具命令行管道开源

    HN 评论精选

    sponge 解决了管道输出写回原文件时被 shell 提前截断的经典问题

    我觉得 sponge 非常有用。你是否想把一个文件通过管道处理后再写回原文件?直接重定向是行不通的,shell 会在 awk 读取之前就把文件截断,导致内容丢失。sponge 会等到读到 EOF 才截断并写入文件,完美解决这个问题。

    HellsMaddy查看英文原文

    I find sponge really useful. Have you ever wanted to process a file through a pipeline and write the output back to the file? If you do it the naive way, it won’t work, and you’ll end up losing the contents of your file: awk ' {do_stuff()}' myfile.txt | sort -u | column --table > myfile.txt The shell will truncate myfile.txt before awk (or whatever command) has a chance to read it. So you can use sponge instead, which waits until it reads EOF to truncate/write the file. awk ' {do_stuff()}' myfile.txt | sort -u | column --table | sponge myfile.txt

    vipe 让你在管道中间用编辑器手动筛选或修改数据

    我用得最多的是 vipe(在管道中插入文本编辑器)。当你想在把输入传给下一个命令前先编辑一下时很有用。比如我想删除部分 git 分支:git branch | vipe | xargs git branch -D,vipe 让我在删除前先从列表中划掉不想删的分支。

    topher200查看英文原文

    The one I use the most is `vipe`. > vipe: insert a text editor into a pipe It's useful when you want to edit some input text before passing it to a different function. For example, if I want to delete many of my git branches (but not all my git branches): $ git branch | vipe | xargs git branch -D `vipe` will let me remove some of the branch names from the list, before they get passed to the delete command.

    ts、errno、vipe 都是日常调试和管道处理的实用利器

    我常用其中几个:ts 给每行输入加时间戳,配合代码里的详细打印做临时性能分析很方便,能看出延迟发生在哪;errno 可以按名字或编号查错误码,调试和查找该返回哪个 errno 都很有用;vipe 适合一次性的管道,在编辑器里改一下比写个工具调用更快。

    JoshTriplett查看英文原文

    I use a few of these regularly: ts timestamps each line of the input, which I've found convenient for ad-hoc first-pass profiling in combination with verbose print statements in code: the timestamps make it easy to see where long delays occur. errno is a great reference tool, to look up error numbers by name or error names by number. I use this for two purposes. First, for debugging again, when you get an errno numerically and want to know which one it was. And second, to search for the right errno code to return, in the list shown by errno -l. And finally, vipe is convenient for quick one-off pipelines, where you know you need to tweak the input at one point in the pipeline but you know the nature of the tweak would take less time to do in an editor than to write the appropriate tool invocation to do it.

    vidir 用编辑器批量重命名文件,是整个工具集的亮点

    很棒的工具集。有些可以用更现代的 shell 轻易复刻,有些只是快捷方式。但 vidir 立刻吸引了我——用编辑器来编辑文件名这个想法太好了,用循环和正则做批量重命名很混乱,用 vim 就简单多了。这个工具让我安装了整个 moreutils。

    jfreax查看英文原文

    Nice collection of quite useful tools. Some of these can be easily replicated by using a more modern shell (bash, zsh) like mispipe, others are just shortcuts (e.g. ifne, chronic). But what immediately stood out to me is `vidir`. I really like the idea of editing file names with an editor. Using loops and regex in a shell for mass renaming can be a mess. It should be way easier with `vim`. This tool made me install moreutils.

    历次讨论

    同类还值得读

    1. 直接在浏览器中启动 Linux 内核

      Boot a linux kernel right inside your browser.

      Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。

      工具与资源上首页 5 次 · 2011–2025bellard.org
    2. Hacker News 未公开功能与行为清单(2018)

      A List of Hacker News's Undocumented Features and Behaviors (2018)

      数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。

      工具与资源上首页 5 次 · 2019–2025github.com
    3. MapSCII:在终端中用盲文和 ASCII 渲染地图

      MapSCII – Braille and ASCII map renderer for the console

      MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。

      工具与资源上首页 5 次 · 2017–2025github.com
    4. 顶尖大学的免费在线课程

      Free Online Courses from Top Universities

      Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。

      工具与资源上首页 5 次 · 2010–2022openculture.com
    5. 淘气字符串:容易引发用户输入问题的字符串清单

      Naughty Strings: A list of strings likely to cause issues as user-input data

      一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。

      工具与资源上首页 4 次 · 2015–2020github.com

    打赏支持

    打赏二维码

    觉得有用,请作者喝杯咖啡。

    WeChat

    关注向阳乔木

    微信公众号「向阳乔木推荐看」

    微信公众号「向阳乔木推荐看」二维码

    微信扫一扫;在微信里打开本页时,长按二维码识别。