uptime Command Guide for Checking How Long a System Has Been Running
uptime prints one line telling you how long the machine has been awake, who is logged in, and the “load average” — the first command to run when you want to know if a server just rebooted or is overloaded.
What is uptime, and Why Use It?
uptime answers three questions at a glance: how long since the last boot, how many users are logged in, and how much work the CPU has been handling recently. The first two are self-explanatory; the third — the load average — is the part beginners misread. It is a number (or three numbers) representing how many processes were ready to run and waiting for CPU time, averaged over the last 1, 5, and 15 minutes.
It is usually the first tool in any “the server feels weird” investigation: if the uptime says 2 hours and nobody rebooted it deliberately, something crashed. If the load average is 40 on a 4-core machine, something is very busy.
Why Learn uptime?
- It tells you if the machine rebooted — after an outage, the uptime line is the quickest way to confirm the restart happened.
- The load average is a system-wide health number — it catches runaway processes even if you do not know what is running yet.
- It takes no arguments and needs no install — it is on every Linux system, which makes it the safest first command on a machine you just SSH’d into.
- The numbers feed into everything else — knowing the load is high is what tells you to reach for top or htop to find who is causing it.
uptimetells you that something is happening; it never tells you what. Treat it as a smoke detector: when it beeps, go find the fire with the process tools.
1. Run It and Read the Output
uptime
14:32:07 up 12 days, 3:41, 2 users, load average: 0.52, 0.58, 0.60
Read it left to right:
| Part | Meaning |
|---|---|
14:32:07 | The current time on the machine |
up 12 days, 3:41 | Time since the last boot (days, then hours and minutes) |
2 users | How many login sessions are attached |
load average: 0.52, 0.58, 0.60 | Load averaged over 1, 5, and 15 minutes |
The three load numbers are deliberately staggered: the 1-minute value reacts fast, the 15-minute value smooths things out. Comparing them tells you the trend — rising or falling.
2. Understand the Load Average
On Linux, the load average counts processes that are running or waiting for CPU plus processes stuck in uninterruptible disk I/O. That second group is why a machine can show a high load even when the CPU looks idle: everyone is waiting on the disk.
The key is to compare the load against your CPU core count:
# How many cores does this machine have?
nproc
Rough rules of thumb:
- Load ≈ number of cores — the machine is fully busy but keeping up.
- Load > number of cores — processes are queueing; things will feel slower.
- Load < number of cores — comfortable headroom.
A load of 4.0 is fine on an 8-core box and a crisis on a 2-core box. The number alone means nothing without the core count.
To see the trend over time, watch it refresh every few seconds:
watch -n 5 uptime
See watch for the repeating-watch trick used on every monitoring page in this section.
3. See Exactly When the Machine Booted
The “up 12 days” format rounds. When you need the exact boot time — for example, to correlate a crash with a deploy — ask uptime -s:
uptime -s
2026-11-23 10:51:04
-s— print the start time of uptime as a full timestamp.
The same information lives in /proc/uptime as raw seconds since boot:
cat /proc/uptime
1089664.21 8712330.55
The first number is seconds since boot; the second is total idle time across all cores. Everything uptime shows is derived from this file.
4. Check Who Is Logged In
The 2 users part of the output counts login sessions, and uptime -a (some versions) or who expands it:
who
user tty1 2026-12-05 09:12
user pts/0 2026-12-05 14:01 (192.168.1.42)
On older or minimal systems, users prints just the usernames on one line:
users
If you need the history of logins — not just who is here now — that lives in the binary log /var/log/wtmp, read with last. See the /var/log tour for where all of these files live.
5. Use Uptime in Scripts
Because the load average is one of the few system-wide health numbers available everywhere, scripts use it as a cheap “is this box okay” check. The raw value is in /proc/loadavg:
cat /proc/loadavg
0.52 0.58 0.60 2/547 28431
A common pattern is to alert when the 5-minute load crosses the core count:
cores=$(nproc)
load=$(awk '{print $2}' /proc/loadavg)
if (( $(echo "$load > $cores" | bc -l) )); then
echo "WARNING: load $load exceeds $cores cores"
fi
Common Pitfalls
- Reading load average without the core count — “load 3.0” is meaningless until you know how many cores you have. Run
nprocfirst. - Assuming high load means high CPU — load counts disk-waiting processes too. If the CPU is idle but the load is high, suspect I/O; see iostat.
- Trusting “up X days” after a mystery reboot — the uptime is the evidence. If it says hours and nobody rebooted, investigate a crash with journalctl and dmesg.
- Confusing
uptimewith the current time — it prints both, but the load numbers are averages, not instantaneous CPU percentages. For percentages, use top or vmstat.
Related Pages
| Page | Relationship |
|---|---|
| top | Shows which processes drive the load uptime reports |
| htop | Friendlier interactive view of the same picture |
| free | The other half of the quick health check: memory instead of load |
| vmstat | Breaks the load into running vs. blocked processes |
| var-log | Where the login history (wtmp) and boot evidence live |
uptime Cheatsheet
| Command | What it does |
|---|---|
uptime | One line: current time, uptime, users, load averages |
uptime -s | Exact boot time as a timestamp |
watch -n 5 uptime | Refresh the line every 5 seconds |
cat /proc/uptime | Raw seconds since boot (first number) |
cat /proc/loadavg | Raw load averages plus run-queue counts |
nproc | Number of CPU cores — the reference for judging load |
who | Who is logged in, on which terminal, since when |
users | Just the logged-in usernames on one line |