[LBo] About /proc/uptime [was: Chap 3 - Exercises]

Anita Lewis a.lewis at linuxbasics.org
Mon Nov 13 01:00:44 CET 2006


On 11/12/2006 04:07 PM Ray wrote:
>
> #2
> as near as i can figure, "cat /proc/uptime" displays 2 counters consisting of 
> the number of seconds the system has "been up" 
> the first, converted to minutes is given by the command "uptime" the second 
> seems to be 3 to 5 minutes less on my system. Almost 14 minutes less in the 
> example above provided by Eric. Any idea what the second number is?
> "man cat" gives no clues.
>  


This one was harder!  You got a good start with 'man' but the 'cat' part
wasn't it.  'proc' was the clue and I found that with a google search.

'man proc' lists all those cute little files and somewhere in there is
the part for uptime:

     /proc/uptime
              This file contains two numbers: the uptime of the  system
(sec‐
              onds), and the amount of time spent in idle process (seconds).

And I don't know what idle process is, but I could see that it was not
changing as I looked at the file off and on over time, while the first
number did change as the seconds rolled by.

Anita




More information about the QnA mailing list