哪个命令的源代码在哪里?

j0h*_*j0h 0 command-line source-code coreutils

我在 coreutils 中四处查看,sudo apt-cache search which 我也查看了其中的联机帮助页,但没有找到。

我想添加一个参数来列出可执行文件的依赖关系,我认为这会很有用。

ste*_*ver 10

至少在我的 Ubuntu 22.04 上,/usr/bin/which是由debianutils软件包提供的:

$ update-alternatives --list which
/usr/bin/which.debianutils
$ 
$ dpkg -S /usr/bin/which.debianutils 
debianutils: /usr/bin/which.debianutils
Run Code Online (Sandbox Code Playgroud)

这是一个 shell 脚本 - 因此无需下载源代码:

$ file /usr/bin/which.debianutils 
/usr/bin/which.debianutils: POSIX shell script, ASCII text executable
Run Code Online (Sandbox Code Playgroud)