When to use uptime
Use uptime to confirm server running time and view load averages as a starting point for diagnosis. Load is not the same quantity as CPU percentage, and its significance depends on capacity and workload.
Syntax
uptime [PARAMETERS]Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
View uptime and load average
uptimeRunning time, session accounting and recent load averages are displayed.
Show human-readable uptime
uptime -pA more readable duration is printed.
Show the last system boot time
uptime -sThe reported boot timestamp is displayed.
Notes and limitations
- On Linux, load average is the average number of runnable tasks and tasks in uninterruptible sleep over 1, 5 and 15 minutes.
- Load average is not a CPU percentage. Interpret it alongside processor count and I/O state.
Common questions and troubleshooting
Does a load average of four mean four percent CPU?
No. Linux load relates to runnable and uninterruptible tasks. Compare it with CPU capacity and investigate I/O waits as well.
Can a long uptime prove the service is healthy?
No. An application can fail without a reboot. Check the relevant service state, logs and application response separately.
Further help
Options vary by version and distribution. Check the installed documentation with this command: man uptime.