Linux uptime command operation example

  

In the Linux command, the uptime command can view the system cpu usage rate (see how to use the w and uptime commands to check the Linux system usage rate), and also check the system running time. The following small series will give you a detailed introduction to the usage of the uptime command.

Under Linux, we can use the uptime command, and this command does not have to use root privileges. The uptime command has been installed by default on the system.

syntax is as follows:

$ uptime

You will see the following displayed on the screen:

This information is stored in the /proc /uptime In the file, although it is saved as text, the data cannot be directly displayed. This requires us to use the uptime command to translate it.

Here's how to interpret the information provided by uptime:

System time

In Figure 1, the first message from the left is 14:04:39, which is the current System time, output in 24-hour format.

System runtime

The second message is Up 1004 days, 12:20, which shows the running time of your system. Figure 1 shows that your system has been running for 104 days, 12 hours and 20 minutes. If your system has not been running for more than 24 hours, it will only show hours or only minutes. Note that the information in Figure 2 and Figure 3 will be cleared when the system is restarted. Information


the number of users logged

The third part is to show the number of users logged in. In Figure 1, 1 user is displayed, which is the current number of logged in users. When multiple users log in to the system at the same time, the uptime command will tell you the number of users.

Average Load

The last message is the average load of the system. Returning to Figure 1, you see that the number 0.25, 0.25, 0.19 with two decimal places can be converted into percentages, ie 0.25 and 0.19 represent 25% and 19% respectively. 0.25, 0.25, 0.19 represent the average load of the system in the past 1 minute, 5 minutes, and 15 minutes, respectively. The lower the load, the better your system performance.

This is the daily usage guide for the uptime command. If you want to get more detailed information, enter the manual page of the uptime command by entering man uptime.

The above is an introduction to the operation example of Linux uptime. As you can see from the introduction of this article, the uptime command can also check the number of logged-in users and the average load.

Copyright © Windows knowledge All Rights Reserved