Web development and Tech news Blog site. WEBISFREE.com

HOME > linux

Understanding the Linux Command uptime

Last Modified : 16 Oct, 2023 / Created : 16 Oct, 2023
257
View Count


Let's learn about the 'uptime' command, which can be used to check the status information of the Linux system.

uptime [option value]

So, what information does it provide and how do we use it?



# Linux Command 'uptime'
The Linux 'uptime' command allows you to see the currently connected users and the CPU load status of the machine in use. The 'uptime' command displays the following information:

  • Current time (Hour:Minute:Second)
  • Duration since the machine was booted
  • Number of logged-in users
  • Average CPU load (1 minute/5 minutes/15 minutes)


As shown above, you can check the current CPU load status of the machine. The load rate includes the average over a specified period. The CPU load rate displays a value between 0 and 1. A value of 1 means that the CPU's maximum resources have been occupied during that time.


! Exploring Available Options
The 'uptime' command has the following parameters and options:

-p // Displays the duration since boot as 'pretty time'
-s // Displays the time when booting started

Below is a simple example. If you run 'uptime', it may display as follows:
-p // 시간 출력시 현재까지 운영된 타임을 pretty time으로 출력함
up 41 weeks, 6 days, 18 hours, 7 minutes

-s // 부팅이 시작된 시간을 출력함
2020-01-10 11:42:33

19:10:29 : This shows the current system time.
15min : Indicates how long the machine has been running, which in this case, is 15 minutes.
1 user : Indicates that currently there is 1 user.
2.38, 1.69, 1.11 : These values represent the average system resource occupancy for 1 minute, 5 minutes, and 15 minutes, respectively.



When would 'uptime' be needed?


The 'uptime' command is used to check the system status, especially to periodically verify that there are no performance issues by checking the server load.


We've now covered the 'uptime' command.

Perhaps you're looking for the following text as well?

    Previous

    How to use cron in Linux, registering task schedules

    Previous

    How to connect to ssh using Linux commands