靈機一動, 想到初學者的好朋友 Stackoverflow。果然在那裡一搜 "linux download source code" 馬上找到解答: 在 man page 裡找出該指令屬於那個專案。像 man xargs 會發現文末這段話:
The best way to report a bug is to use the form at http://savannah.gnu.org/bugs/?group=findutils. The reason for this is that you will then be able to track progress in fixing the problem. Other comments about xargs(1) and about the findutils package in general can be sent to the bug-findutils mailing list. To join the list, send email to bug-findutils-request@gnu.org.於是 google findutils 就會找到它的官網, 裡面提到此專案包含 xargs, 附有下載鏈結。
在 Ubuntu 的作法
用 apt-get source PACKAGE 下載原始碼。前置作業如下:
- 確定 /etc/apt/sources.list 內有含 deb-src, 比方說加入這兩行:
deb-src http://us.archive.ubuntu.com/ubuntu jaunty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu jaunty universe multiverse - sudo apt-get update
可以用 aptitude show PACKAGE / COMMAND 來查 PACKAGE 名稱, 比方「 aptitude show host 」會告知 host 被包在 dnsutils 裡。或是用 apt-file search FILE 來找 PACKAGE, 像是「 apt-file search /usr/bin/xargs 」會列出 findutils。