views:

961

answers:

5

Hi, Could anyone provide me with the pointers to source code for linux commands such as 'sort' , 'uniq' etc. many thanks.

+11  A: 

On Debian and Ubuntu:

apt-get source coreutils

More generally: http://ftp.gnu.org/gnu/coreutils/

Lars Wirzenius
+2  A: 

Generally on rpm managed Linux distribution, for me to check which file belong to which package, I will use command like:

rpm -qf `which sort`
arsane
A: 

Try here: http://www.gnu.org/software/coreutils/

mike
+1  A: 

For sources much closer to the original UNIX toolset (and not the GNU rewrites),

The Heirloom Toolchest is a collection of standard Unix utilities.

Highlights are:

  • Derived from original Unix material released as Open Source by Caldera and Sun.
ephemient
+1  A: 

From OpenSolaris. IMHO much cleaner code then GNU.

Terminus
The opening of OpenSolaris code is actually a large source of the sources collected in the Heirloom tools I linked to in my answer.
ephemient
thanks terminus for the soloaris link.Did you have the chance to review the code in GNU/solaris systems ? i personally intend to learn from them ( as they are widely used stable tools ).
Al pacino