The uptime
command is a Linux command that displays the current time, how long the system has been running, the number of users currently logged in, and the system load averages for the past 1, 5, and 15 minutes. The command is useful for system administrators to monitor the performance of their Linux systems.
Overview
To use the uptime
command, open a terminal window and type uptime
in the command prompt. The output will display the current time, how long the system has been running, the number of users currently logged in, and the system load averages for the past 1, 5, and 15 minutes.
$ uptime
11:36:28 up 1:45, 2 users, load average: 0.00, 0.01, 0.05
The output shows that the system has been running for 1 hour and 45 minutes, there are 2 users currently logged in, and the system load averages for the past 1, 5, and 15 minutes are 0.00, 0.01, and 0.05, respectively.
The system load averages indicate the average number of processes that are either in a runnable or uninterruptable state. A high load average indicates that the system is under heavy load and may be slow to respond to user requests.
Options
The uptime
command has no options.
Troubleshooting tips
If the uptime
command does not display any output, it may be that the system is not running or the command is not installed. Check that the system is running and try installing the procps
package, which contains the uptime
command.
$ sudo apt-get install procps
If the system load averages are consistently high, it may be an indication that the system is under heavy load and may require additional resources or optimization to improve performance.
Notes
The uptime
command is a simple and useful command for monitoring the performance of Linux systems. It is often used in conjunction with other performance monitoring tools to provide a comprehensive view of system performance.