uptime — Boot time and load
💬 "uptime command"
The uptime command shows uptime and load average in a single line. It is a good first command for inspection.
You can immediately see reboot status and load trends (1/5/15 minutes).
- Current time: the time when the command was executed.
- up: elapsed time since the last boot.
- users: the number of logged-in users.
- load average: the average load over the last 1, 5, and 15 minutes.
Commonly Used Options
| Option | Description |
|---|---|
| -p | Show uptime in a human-readable format |
| -s | Print the boot time |
| (with top/ps) | Continue by checking the cause of the load |
Three Essential Command Combinations
uptime— check uptime and load in one lineuptime -s— check the last boot timeuptime && nproc— compare load with the number of cores
💬 "Show me an example of applying this to multiple servers at once"
The following is a step-by-step summary of common situations encountered on production servers.
Step 1 · Check for Reboots
If uptime is shorter than expected, check for a reboot.
uptime -s
Step 2 · Check Load
Compare the load with the number of cores.
uptime && nproc
Step 3 · Trace the Cause
If the load is high, check the top processes.
top -o %CPU -b -n 1 | head -12
How It Is Used in Practice
1. Check for Unauthorized Reboots
Situation — You need to check when the server was rebooted.
uptime -s
Result — The last boot time is printed so you can compare it with maintenance records.
Point — You can view the entire boot history with journalctl --list-boots.
2. Assess Load Trends
Situation — Response is slow, but the CPU looks idle.
uptime && nproc && free -h
Result — If the 15-minute load is high and swap usage is large, suspect a memory/I/O problem.
Point — Do not judge by load alone; check CPU, memory, and I/O together.
Important Notes
- Load average is based on the number of running/waiting processes, not the number of requests.
- The same load value has different implications depending on the number of cores.
- In virtualized environments, host load can be reflected in guests.
Actual Output
This is the result of checking uptime/load, boot time, and the number of cores.
!uptime command output: uptime and load
Production server
Source (HTML): https://games.aidebatehub.com/programs/linux/services/uptime.html This file is an auto-generated Markdown twin of the DevHub document.
AI Knowledge Hub
Visitor Comments