Determine System Stability Using the uptime Command

The 'uptime' and 'w' commands show basic system info including uptimes

Verify the amount of time your Linux-based computer has run between reboots or powerdown events using the uptime command.

How Long Has Your System Been Running?

The simplest way to find out how long your system has been running is to enter the uptime command. The default output displays:

  • The current time.
  • How long the system has been running.
  • The number of users that are logged in.
  • The load average for the past 1, 5 and 15 minutes.

The load averages show the average number of processes that are in a runnable or uninterruptable state.

linux uptime

Modify the command by using the -s and -p switches.

The command

uptime -s

shows the start time of the machine.

The command

uptime -p

offers an easy-to-comprehend description of total uptime, in plain English.

Alternate Way to Show Your System Uptime

The uptime command isn't the only way to show the system uptime. You can achieve the same thing with the simple w command.

w command

The output from the w command is as follows:

  • user
  • tty
  • from
  • login time
  • idle time
  • JCPU
  • PCPU
  • WHAT

The w command shows more than just the current uptime. It shows who is logged in and what they are currently doing.

The JCPU is the time used by all processes attached to the terminal and the PCPU shows the time used by the current process in the WHAT column. 

Was this page helpful?