LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   source files for linux commands (https://www.linuxquestions.org/questions/linux-newbie-8/source-files-for-linux-commands-649203/)

Bucephalus 06-14-2008 01:27 AM

source files for linux commands
 
Hi

I would like to know where I can find the source files for linux commands such as ls, and mkdir.
Better still, the best way to find ls without being told where ls is..
if you know what I mean
I ran a find / -name "*.c"
I think I have to do something else.
Either where it is or how to find it, or both would be very much appreciated.

Buce

Nylex 06-14-2008 01:32 AM

You can just google for the project's homepage. ls is part of GNU Coreutils. You won't have the source on your system unless you specifically installed the source packages for your distro.

pinniped 06-14-2008 01:37 AM

Another implementation of "ls" is in "busybox". Then again, the GNU Coreutils source may be much easier to read.

Bucephalus 06-14-2008 01:43 AM

Great
thanks for you help.

jschiwal 06-14-2008 02:07 AM

You should put your distribution in your user profile. If you have an RPM based distribution, you can use "rpm -qf </path/to/command>" to find which package supplies that file. Then it's a matter of downloading the source rpm to obtain the source. Another reason you may want to download the source is to use the info source to produce print worthy versions of the documentation. The coreutils.pdf is over 200 pages long and very good. Either the gawk or gawk-doc package includes an excellent book on AWK programming.

Bucephalus 06-14-2008 11:10 PM

thanks for your help.
I updated my profile a little.

btmiller 06-14-2008 11:52 PM

On Ubuntu, you can just do "apt-get source <package name>" (no quotes) from the terminal to get the source code for a particular package.


All times are GMT -5. The time now is 09:49 PM.