LinuxCommandLibrary

uptime

Show how long the system has been running

TLDR

Print current time, uptime, number of logged-in users and other information

$ uptime
copy

Show only the amount of time the system has been booted for
$ uptime [[-p|--pretty]]
copy

Print the date and time the system booted up at
$ uptime [[-s|--since]]
copy

Display version
$ uptime [[-V|--version]]
copy

SYNOPSIS

uptime [-p] [-s]

PARAMETERS

-p
    Show uptime in a pretty format.

-s
    System start time in ISO 8601 format.

DESCRIPTION

The uptime command displays information about how long the system has been running, the current time, the number of users currently logged in, and the system load averages for the past 1, 5, and 15 minutes. It is a quick way to get a snapshot of system activity and load. The load averages represent the average number of processes that are either actively running or waiting to run (i.e., in a runnable state) over the specified time intervals. A high load average suggests that the system is heavily loaded, which could indicate performance bottlenecks. This is a vital command for system administrators when diagnosing performance issues or simply keeping an eye on server health. uptime provides an at-a-glance view and is frequently used in monitoring scripts and dashboards.
The command reads system data from /proc filesystem, which is a pseudo-filesystem that provides an interface to kernel data structures.

CAVEATS

The load averages displayed are averages, and sudden spikes in activity may not be immediately reflected. Interpretation of load averages depends on the number of CPUs/cores on the system.

LOAD AVERAGE INTERPRETATION

The load average numbers represent the average number of processes in the run queue. A load average of 1.0 indicates that, on average, one process was either running or waiting to run. On a single-CPU system, a load average consistently above 1.0 indicates that the system is overloaded. On a multi-CPU system, a load average should ideally be below the number of CPUs/cores.
Example: on a 4 core system, a load average below 4 would generally be acceptable, while above 4 indicates that processes are having to wait their turn to run.

HISTORY

The uptime command has been a standard part of Unix-like operating systems for a long time, dating back to early versions of Unix. Its purpose has remained consistent: to provide a quick overview of system runtime and load.

SEE ALSO

w(1), top(1), vmstat(8), mpstat(1)

Copied to clipboard