LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Source code for GNU utils? (https://www.linuxquestions.org/questions/linux-newbie-8/source-code-for-gnu-utils-598650/)

itz2000 11-10-2007 03:20 PM

Source code for GNU utils?
 
hi, do you happen to know where can I find the source code for stuff like : the cp command? or any other commands such as mv or grep, etc?

I just want to see how these stuff were implemented, which is fascinating !

Thanks

Nylex 11-10-2007 03:30 PM

Did you not think about going to the GNU website? cp, mv and friends are part of GNU Coreutils and grep, is well, GNU grep. Try googling to find a project's homepage and you'll be able to download the source from there.

itz2000 11-10-2007 03:34 PM

Thanks, I've seen it only after I posted.


Thanks anyways./

matthewg42 11-10-2007 03:59 PM

On a debian-based distro, you can do it like this:
  1. Make sure the source repositories are enabled in your /etc/apt/sources.list
  2. Find out which package provides the program in question:
    Code:

    dpkg -S $(which mv)
  3. Install source:
    Code:

    apt-get source packagename

itz2000 11-11-2007 12:19 PM

I couldn't find the sources for other stuff I was looking like ps,
I'd be happy if you could guide me which package to look for the ps code, since I can't find it :(

Nylex 11-11-2007 12:40 PM

procps. Looking at man pages usually helps, too ;).

osor 11-11-2007 12:43 PM

Quote:

Originally Posted by itz2000 (Post 2955354)
I'd be happy if you could guide me which package to look for the ps code, since I can't find it :(

Dude, just use your package manager (supposing you use one). It will be able to tell you what files belong to which package (matthewg42 gave some instructions for dpkg-based distros). Incidentally, on most linux distros, ps comes from the procps package.


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