linux du command source code

2019-02-12 05:32发布

Where I can find the source code for du and other Linux utilities?

标签: c linux kernel
2条回答
贪生不怕死
2楼-- · 2019-02-12 06:14

David is right. You can start with the entry point, du.c, in Savannah. Also, since it's free software under the GPL, you can also get it from your GNU/Linux distribution. E.g., on Debian or Ubuntu you can generally just do:

apt-get source coreutils

to get the source for the version installed.


(EDIT by Novelocrat)

For other commands, to find out what package they're in, you can say

dpkg -S `which command`

which command will tell you the full path to that command, and dpkg -S filename will tell you what package provides a file. Then you can run apt-get source packagename to get its source code.

查看更多
3楼-- · 2019-02-12 06:16

It is with the GNU CoreUtils package.

查看更多
登录 后发表回答