source code about commands
where can I found source files (in C language开发者_开发问答) about unix Commands (ls, sleep, cd etc).
I've downloaded the kernel linux-2.6.39-rc3, but there are no source about linux command.
thanks for your help :-)
Most of the generic Linux commands come from coreutils
http://www.gnu.org/software/coreutils/ there might be some missing there, but everything you asked specifically about should be found in coreutils source.
the kernel source doesn't contain any userland programs in it.
If you are using debian based os then u can use
dpkg -S command
to find the package it is present in and then
apt-get source package
to download the source. You can find similar commands on other machines.
Pickup the GNU coreutils @ http://ftp.gnu.org/pub/gnu/coreutils/ and this includes a lot of these commands.
use
sudo apt-get build-dep core-utils
apt-get source core-utils --compile
to get and compile everything in core-utils from scratch
精彩评论