Jump to content

How do you show uptime?


Recommended Posts

cat /proc/uptime

 

but it's not 'human readable' :roll:

 

then make it yourself:

:mrgreen:

 

~$ uptime ()  { read secs x </proc/uptime;

> printf "%s hours, %s minutes and %s secondsn" $((${secs%.*}/3600)) $(($((${secs%.*}%3600))/60)) $(($((${secs%.*}%3600))%60)); }

~$

~$ uptime 

13 hours, 30 minutes and 14 seconds

~$

 

Seriously, static, I'm surprised that you don't have the "/usr/bin/uptime" command.

 

apart from top and uptime, the w command (/usr/bin/w) shows the uptime of your system too.

Link to comment
Share on other sites

If you don't have one you won't have the other.

[root@localhost /]# urpmf uptime

procps:/usr/bin/uptime

[root@localhost /]# urpmf /usr/bin/w

which:/usr/bin/which

SysVinit:/usr/bin/wall

coreutils:/usr/bin/wc

coreutils:/usr/bin/who

coreutils:/usr/bin/whoami

procps:/usr/bin/w

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...