Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find the source code of Unix utilities? [closed]

People also ask

How can I view source code in Linux?

If the kernel source code is present in your system, you can find it under the /usr/src/linux-<Version> directory, where <Version> must be replaced with the source code kernel version you are dealing with. You also can find the last kernel source code at https://github.com/torvalds/linux.

What are utilities in Unix?

Virtually every command you know under the Unix system is classified as a utility; therefore, the program resides on the disk and is brought into memory only when you request that the command be executed.

What is Linux utility command?

The Linux command is a utility of the Linux operating system. All basic and advanced tasks can be done by executing commands. The commands are executed on the Linux terminal. The terminal is a command-line interface to interact with the system, which is similar to the command prompt in the Windows OS.


On Debian and Ubuntu:

apt-get source coreutils

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


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.

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`

From OpenSolaris. IMHO much cleaner code then GNU.