download the source code of some commands

Wang Lei f3d27b at gmail.com
Thu Jun 21 11:22:49 EDT 2012


If you use Debian or other distribution with apt package system.

You can use whereis to locate this command.
[~]$ whereis halt
halt: /sbin/halt /usr/share/man/man5/halt.5.gz /usr/share/man/man8/halt.8.gz

Then, use dpkg -S to show which package it's included. This one is: sysvinit.
[~]$ dpkg -S /sbin/halt
sysvinit: /sbin/halt

Now, you can download the source from Debian source, use:
[~]$ apt-get source sysvinit

Or if you want the original source, use aptitude (or apt-cache) find
it's homepage.
[~]$ aptitude show sysvinit
Package: sysvinit
......
Homepage: http://savannah.nongnu.org/projects/sysvinit

At last, get it from there. As for other package systems, I think there
should be a way too. Or you can google.
 
On 2012-06-21 20:48:48 +0800, 王哲 wrote:
>   Hi all:
>        I want to see some source code of some commands,for
> example,halt,reboot,uptime,and so on.
>
> but i don't kown where to download?   can you give me some advice?
>
> Thanks in advance!
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-- 
Regards,
Lei



More information about the Kernelnewbies mailing list