LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
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
 
Old 06-14-2008, 01:32 AM   #2
Nylex
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 01:37 AM.
 
Old 06-14-2008, 01:37 AM   #3
pinniped
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, 01:43 AM   #4
Bucephalus
LQ Newbie
 
Registered: Apr 2007
Location: Gold Coast, Australia
Distribution: Ubuntu
Posts: 5

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

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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-14-2008, 11:10 PM   #6
Bucephalus
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-14-2008, 11:52 PM   #7
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

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


Reply


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 04:39 AM
Obtaining source code for linux commands sreeramabsc Linux - General 10 01-29-2006 03:34 AM
can i access the source code of linux shell commands?? sharathg786 Red Hat 1 11-22-2005 05:08 AM
Help with Cygwin, using Linux commands and installing files Delmarc Linux - Newbie 4 10-25-2003 09:37 PM
Source for Linux commands? EnVoy Linux - Newbie 11 03-12-2003 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:56 AM.

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