0
0
Linux-cliHow-ToBeginner · 3 min read

How to Use uptime Command in Linux: Syntax and Examples

Use the uptime command in Linux to see how long the system has been running, how many users are logged in, and the system load averages. Simply type uptime in the terminal and press Enter to get this information.
📐

Syntax

The basic syntax of the uptime command is simple:

  • uptime: Shows system uptime, current time, number of users, and load averages.

No additional options are required for the most common use.

bash
uptime
💻

Example

This example shows the output of the uptime command on a Linux system. It displays the current time, how long the system has been running, how many users are logged in, and the system load averages for the last 1, 5, and 15 minutes.

bash
uptime
Output
14:23:45 up 3 days, 4:12, 2 users, load average: 0.15, 0.10, 0.05
⚠️

Common Pitfalls

Some common mistakes when using uptime include:

  • Expecting detailed system stats: uptime only shows basic uptime and load averages, not CPU or memory usage.
  • Confusing load averages with CPU usage: Load averages show the average number of processes waiting to run, not CPU percentage.
  • Trying to use options that uptime does not support: It has no options for filtering or formatting output.

For more detailed system info, use commands like top or htop.

📊

Quick Reference

TermDescription
Current timeThe system clock time when the command runs
UptimeHow long the system has been running since last boot
UsersNumber of users currently logged in
Load averagesAverage system load over 1, 5, and 15 minutes

Key Takeaways

Run uptime in the terminal to quickly see system uptime and load averages.
Load averages represent the average number of processes waiting to run, not CPU usage percentage.
uptime has no options; it only shows a summary line.
For detailed system stats, use other tools like top or htop.
Understanding uptime helps monitor system stability and performance over time.