工具与资源github.com
命令行谋杀案:用 shell 命令破案
The Command Line Murders
2014 — 2016,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
《The Command Line Murders》是 GitHub 上的一个命令行侦探解谜项目:玩家通过分析仓库中的车辆、会员名单等线索文件,用 Unix 命令逐步锁定嫌疑人。评论里能看到 awk、grep、comm、recutils 等工具的实战用法,也有人用 ipython 等更灵活的方式辅助。作者说这是为 Mozilla Festival 工作坊赶制的小项目,并计划推出续作。
为什么经久不衰:它把 awk、grep、comm 等 Unix 文本处理工具包装成一场可上手的侦探游戏,既有练习价值又有解谜乐趣,因此多年后仍值得一玩。
HN 评论精选
项目源自 Mozilla Festival 工作坊,作者计划续作。
嘿,我是作者。很高兴你们喜欢!这个作品有点赶工,是为去年 Mozilla Festival 的一个工作坊做的;不过我打算再做一期。
veltman查看英文原文
Hey, I'm the one who made this. Glad you guys liked it! This one was a bit quick and dirty, done for a workshop at the Mozilla Festival last year, I'm going to try to do another installment though!
awk 和 grep 足以完成关键筛选。
我用 awk 按记录块筛选出符合车牌、车型、颜色条件的车辆,再用 grep -Fxf 求 Delta_SkyMiles 与 Museum_of_Bash_History 的共同成员。
Gorgor查看英文原文
Here is my solution for finding the tall males driving the blue honda with the semi-known licencse plate. I found awk quite suitable. awk 'BEGIN {RS="\n\n"; FS="\n"} $1 ~ /L337.*9$/ && $2 ~ /Honda/ && $3 ~ /Blue/ && $5 ~ /6'\''/ {print $4}' vehicles | cut -d' ' -f2,3 Edit: And to find the intersection between the SkyMiles members and the members of the Museum of Bash History, I used fgrep: grep -Fxf Delta_SkyMiles Museum_of_Bash_History
转换文件格式或借用 recutils 能降低处理难度。
提示:把 vehicles 转成面向行的格式后,用标准 POSIX 工具会容易得多(评论用 ROT13 给出了一行命令)。另一个思路是 vehicles 几乎就是合法的 Recutils 文件,用 sed 稍作修正后可以用 recsel 查询。
networked查看英文原文
That was fun. Hint: The file "vehicles" will be easier to deal with using the standard POSIX tools if you translate it into a line-oriented format. Here is a way to do it (in rot13): <iruvpyrf ge '\a' '|' | frq -r 'f/Yvprafr/\aYvprafr/t' > iruvpyrf.ersbeznggrq An alternative solution is to notice that "vehicles" is almost a valid Recutils [1] file. The fix is as simple as frq -r '1,4q;f/Yvprafr Cyngr/YvprafrCyngr:/' iruvpyrf > iruvpyrf.erp You can query the result with `recsel`. (Admittedly, I didn't try this until after solving the mystery.) [1] https://www.gnu.org/software/recutils/#content
comm 适合求多份名单的交集。
`comm -1 -3` 几乎就是为快速找出所有相关团体的共同成员而设计的。
gergoerdi查看英文原文
`comm -1 -3` (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/comm.html) is practically made for quickly finding who is a member of all involved groups.
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com