How to Check System Uptime in Linux Command Line

November 20, 2025 / Command Line

In this article, you will explore how to check system uptime in Linux Command Line. System uptime refers to the amount of time a Linux system has been running without a reboot. Monitoring uptime is important for troubleshooting, performance auditing, and understanding system stability. Linux provides several built-in commands that allow you to quickly check uptime from the terminal.

The most commonly used commands, how they work, and practical examples for system administrators are illustrated here.

What Is System Uptime?

System uptime shows how long your Linux machine has been running uninterruptedly since its last reboot. It helps you:

  • Monitor server stability
  • Detect unexpected restarts
  • Track maintenance or downtime
  • Analyse long-running processes

Linux offers multiple methods for checking uptime using built-in tools.

Method 1: Using the uptime Command (Recommended)

  1. Basic Uptime Information
    Run the following command:

    uptime

    This will display:

    • Current system time
    • Total uptime
    • Number of logged-in users
    • Load averages for the last 1, 5, and 15 minutes
  2. Human-Readable Uptime
    For a cleaner, sentence-style output, use:

    uptime -p

    Example output:
    up 2 days, 4 hours, 15 minutes

  3. Show the Exact Last Reboot Time
    To find when the system was last restarted:

    uptime -s

    Example:
    2025-01-10 14:22:45

Method 2: Using the who Command

Run:

who -b

This shows the last system boot time, for example:

system boot  2025-01-15 10:05

This method is helpful when you only need to know when the system last restarted.

Method 3: Reading /proc/uptime

Linux stores uptime data in the virtual /proc filesystem.

Run:

cat /proc/uptime

You will see two numbers:

  1. Uptime in seconds
  2. Idle time in seconds

Example:

150203.55 148500.30

This method is often used by scripts, monitoring agents, or custom tools.

Method 4: Using top or htop

  1. Check Uptime with top
    Run:

    top

    Uptime appears at the top of the interface along with:

    • Current time
    • Logged-in users
    • Load averages
  2. Check Uptime with htop
    If installed, use:

    htop

    htop provides a colour-coded, user-friendly display with uptime visible in the top bar.

Method 5: Using the last Command

Run:

last reboot

This displays the reboot history, including:

  • Reboot date and time
  • How long has the system been running
  • Previous restart records

Ideal for auditing, troubleshooting, and detecting unexpected system reboots.

Conclusion

In this manner, checking system uptime in Linux is straightforward, and you can use several built-in commands depending on your needs. The uptime command gives quick overall information, ‘who’ helps identify the last reboot time, and /proc/uptime is ideal for scripts or automated monitoring. Each method offers valuable insights into system performance and stability. Regularly checking uptime helps administrators keep servers healthy and reliable.

Need a reliable Linux environment for critical workloads?
A Linux VPS Hosting solution provides the stability, flexibility and control needed for business applications.

Want to adjust your server settings too? Learn How to change the server time zone in WHM

Spread the love