How to Check Your System Uptime in Ubuntu Linux Terminal

One of the greatest strengths of the Linux operating system is its incredible stability. Unlike consumer desktop environments that often require a reboot every few days to install updates or clear memory leaks, a properly configured Ubuntu server can run continuously for months—or even years—without ever shutting down.

Whether you are managing a remote web server, troubleshooting a network issue, or simply want bragging rights about how long your personal machine has been running, checking your system’s “uptime” is a fundamental skill every Linux user should know.

In this guide, we will show you the three easiest terminal commands to check exactly how long your Ubuntu Linux machine has been powered on.

Method 1: The Standard “uptime” Command

As the name suggests, this is the most direct and commonly used command for this specific task. It provides a clean, single-line output containing several useful pieces of information.

  1. Open your terminal (press Ctrl + Alt + T).
  2. Type the following command and press Enter: uptime

The terminal will instantly output a line of text that looks something like this:

14:32:15 up 45 days, 6:12, 2 users, load average: 0.15, 0.22, 0.18

Here is how to read that output:

  • 14:32:15: The current system time.
  • up 45 days, 6:12: This is your actual uptime! The machine has been running for 45 days, 6 hours, and 12 minutes.
  • 2 users: The number of user accounts currently logged into the system.
  • load average: A measurement of CPU workload over the last 1, 5, and 15 minutes.

The Pretty Uptime Option

If you only care about the duration and do not want to see the load averages or user counts, you can use the “pretty” flag. Type this command:

uptime -p

The output will simply say: up 6 weeks, 3 days, 6 hours, 12 minutes. This is much easier to read at a glance.

Method 2: Using the “top” Command

If you are actively monitoring your system resources to figure out why your machine is running slowly, you do not need to run a separate command to check the uptime. It is built directly into the standard task manager.

  1. In the terminal, type: top
  2. Press Enter.

The top command launches a live, continuously updating list of all the processes consuming your CPU and RAM. If you look at the very first line of text at the absolute top of the screen, you will see the exact same uptime information provided by Method 1. To exit the top interface and return to your normal terminal prompt, simply press the Q key.

Method 3: Checking When the System Actually Booted

Sometimes, knowing that a machine has been running for “45 days” is not as helpful as knowing the exact calendar date and time it was last rebooted (for example, to verify if an automatic security patch caused a restart on Tuesday night).

To find the exact timestamp of the last boot, you can use the uptime command with the “since” flag:

uptime -s

This will output a highly precise date and time, formatted like this: 2023-10-14 08:20:00.

By mastering these three simple commands, you can instantly verify the stability of your Ubuntu server and gain better insight into your system’s maintenance cycles.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

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

Receive our best articles and tips delivered straight to your inbox.