PDA

View Full Version : unix top command



GregoryPitts
June 2nd, 2008, 02:05 PM
Can anyone give me a detailed description of how the top command is actually implemented? I can't seem to find any documentation on it. A link to the source or a path to the source would be fine. Thanks.

Greg

hermes0710
June 2nd, 2008, 02:29 PM
Hi,
check these:
http://linux.about.com/od/commands/l/blcmdl1_top.htm
http://unixhelp.ed.ac.uk/CGI/man-cgi?top+1

GregoryPitts
June 2nd, 2008, 03:19 PM
Thanks. I was looking for something more than the man pages. I found the source here, in case anyone is wondering

http://procps.sourceforge.net/

geirha
June 2nd, 2008, 04:53 PM
If it's gpl, ubuntu has to make the source code available to you, and they do that using apt:



$ which top # Find the absolute path of the file
/usr/bin/top
$ dpkg -S /usr/bin/top # Find the package the file is installed by
procps: /usr/bin/top
$ apt-get source procps # Download the source
[...cut...]
dpkg-source: extracting procps in procps-3.2.7
dpkg-source: unpacking procps_3.2.7.orig.tar.gz
dpkg-source: applying ./procps_3.2.7-5ubuntu2.diff.gz


I find this procedure a little easier than searching for the source on google. For next time ;)