How to View System Uptime in Linux

In the world of server administration, stability is the ultimate goal. A server that frequently reboots on its own is a server experiencing catastrophic hardware failures, kernel panics, or severe power issues. Conversely, a server that has been running continuously for three years without a reboot likely hasn’t received any critical kernel security patches. As a Linux administrator, quickly verifying how long a machine has been running—its Uptime—is one of the first diagnostic checks you perform when logging into a system to gauge its overall health and maintenance status.

The ‘uptime’ Command (The Quick Check)

The fastest and most direct way to retrieve this information is using the dedicated uptime command. It provides a single-line output containing several crucial pieces of system telemetry.

  1. Open your terminal or connect to the server via SSH.
  2. Type uptime and press Enter.

The output will look something like this:
14:32:05 up 45 days, 12:15, 2 users, load average: 0.15, 0.22, 0.18

Decoding the output:

  • 14:32:05: The current system time.
  • up 45 days, 12:15: The actual uptime. This server has been running without interruption for 45 days, 12 hours, and 15 minutes.
  • 2 users: The number of terminal sessions currently logged into the machine.
  • load average: These three numbers represent the average CPU load over the last 1 minute, 5 minutes, and 15 minutes. (A number lower than your total CPU core count is healthy).

If you only want the uptime duration without the load averages and user counts, you can use a cleaner format by typing: uptime -p (which outputs something like “up 6 weeks, 3 days, 12 hours”).

The ‘w’ Command (Uptime + User Activity)

If you are investigating why a server is running slowly, simply knowing the uptime isn’t enough. You often need to know who else is logged in and what they are doing. The w command combines the uptime telemetry with a detailed user activity log.

  1. Type w and press Enter.

The very first line of the output is identical to the uptime command. However, below it, you will see a formatted table detailing every active user session, their IP address, when they logged in, and the specific command or script they are currently executing. This is invaluable for spotting a rogue user compiling large software packages and slowing down the system.

The ‘top’ Command Dashboard

While uptime and w are one-shot commands that print data and exit, you can also view uptime dynamically within the system monitor dashboard.

  1. Type top and press Enter.

In the top-right corner of the continuously updating dashboard, the uptime is prominently displayed next to the current time. This allows you to monitor the system’s runtime while simultaneously watching live CPU and memory consumption. Press q to exit the dashboard when you are finished.

By regularly checking the uptime, administrators can enforce maintenance schedules, ensuring servers are rebooted for kernel updates while maintaining high availability.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.