Tag Archives: System uptime command in Linux

Uptime Command in Unix, Linux and Windows

The uptime command can be very useful for troubleshooting system problems. In Windows 7 you can use the systeminfo command and pipe the output to find to cut just the “Time” line out. Older Windows XP systems used to show the actual uptime. Now it just shows the system boot time and you have to do the math.

C:\> systeminfo | find "Time:"
uptime-command-windows-7
Using the systeminfo and | commands to find the uptime of a Windows system--Image Credit: SiliconCali.com
uptime-command-windows-xp
Windows XP gives the system uptime with the systeminfo command--Image Credit: SiliconCali.com

You can also use the ‘systeminfo | more’ command string to give you the full output of your Windows system information with paging so you can use the space bar to page down.

Uptime in Unix is of course more versatile. Here’s the short and concise uptime manpage from Solaris 10 Unix:

sunbox% man uptime

User Commands uptime(1)

NAME
uptime – show how long the system has been up

SYNOPSIS
uptime

DESCRIPTION
The uptime command prints the current time, the length of
time the system has been up, and the average number of jobs
in the run queue over the last 1, 5 and 15 minutes. It is,
essentially, the first line of a w(1) command.

EXAMPLES
Below is an example of the output uptime provides:

example% uptime
10:47am up 27 day(s), 50 mins, 1 user, load average: 0.18, 0.26, 0.20

ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:

____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| Availability | SUNWcsu |
|_____________________________|_____________________________|

SEE ALSO
w(1), who(1), whodo(1M), attributes(5)

NOTES
who -b gives the time the system was last booted.

SunOS 5.9 Last change: 18 Mar 1994 1

sunbox% who -b
. system boot Nov 9 15:11
sunbox% uptime
5:57pm up 457 day(s), 2:46, 1 user, load average: 0.10, 0.10, 0.09
sunbox%
sunbox% date
Thu Feb 9 17:57:58 PST 2012
sunbox%