About /proc/uptime

Rob Park rbpark at ualberta.ca
Thu Sep 26 12:58:48 PDT 2002

On Wednesday 25 September 2002 08:38 pm, James Drabb wrote:
> > You can take a look at /usr/src/linux-2.4.19/fs/proc/proc_misc.c to
> > see how it is generated : )

Or you could just read the man page.

> So the first number is uptime / 60 = mins
> so you can do:
> echo uptime is $((`cut -f1 -d' ' /proc/uptime | cut -f1 -d.` / 60)) mins

It's much less nasty to use this script:


Then you get nice output, not just minutes ;)

Rob Park
Any sufficiently advanced technology is indistinguishable from a perl script.
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message

More information about the lfs-chat mailing list