Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-14-2008, 02:27 AM   #1
LQ Newbie
Registered: Apr 2007
Location: Gold Coast, Australia
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
source files for linux commands


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.

Old 06-14-2008, 02:32 AM   #2
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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.

Last edited by Nylex; 06-14-2008 at 02:37 AM.
Old 06-14-2008, 02:37 AM   #3
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Another implementation of "ls" is in "busybox". Then again, the GNU Coreutils source may be much easier to read.
Old 06-14-2008, 02:43 AM   #4
LQ Newbie
Registered: Apr 2007
Location: Gold Coast, Australia
Distribution: Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
thanks for you help.
Old 06-14-2008, 03:07 AM   #5
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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.
Old 06-15-2008, 12:10 AM   #6
LQ Newbie
Registered: Apr 2007
Location: Gold Coast, Australia
Distribution: Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
thanks for your help.
I updated my profile a little.
Old 06-15-2008, 12:52 AM   #7
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Source Code of the Linux commands drimades Linux - General 15 11-16-2006 05:39 AM
Obtaining source code for linux commands sreeramabsc Linux - General 10 01-29-2006 04:34 AM
can i access the source code of linux shell commands?? sharathg786 Red Hat 1 11-22-2005 06:08 AM
Help with Cygwin, using Linux commands and installing files Delmarc Linux - Newbie 4 10-25-2003 10:37 PM
Source for Linux commands? EnVoy Linux - Newbie 11 03-12-2003 06:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:39 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration