Determine System Stability Using the uptime Command

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

The uptime command in a Ubuntu terminal.
Ricardop0927 / Wikimedia Commons / CC BY 4.0

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?

linux uptime

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.
  • How many users 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.

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

The command

uptime -s

shows the 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

w command

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

The output from the command is as follows:

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

The 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.