It does not matter how long the system has been running for some people, but it is very important for the server administrator. When running important applications, the server must ensure stable operation for a long period of time, and sometimes even require zero downtime. So how can we know how long the server has been running?
In Linux, we can use the uptime command, and this command does not require the root permission. The uptime command has been installed by default in the system.
Syntax:
- $ uptime
You will see the following on the screen:
This information is stored in the/proc/uptime file. Although it is saved in text format, the data cannot be directly displayed. Therefore, we need to use the uptime command to translate it.
The following describes 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 and is output in the 24-hour format.
System running time
Article 2Up 1004 daysThis shows the running time of your system. Figure 1 shows that your system has been running for 1004 days, 12 hours, and 20 minutes. If your system has not been running for more than 24 hours, only hours or minutes are displayed. Note that the information shown in Figure 2 and Figure 3 is cleared after the system is restarted.
Number of logged-on users
The third part shows the number of logged-in users. In Figure 11 user, That is, the number of currently logged-on users. When multiple users log on to the system at the same time, the uptime Command tells you the number of users.
Average Load
The last information is the average load of the system. Return to Figure 1, you can see that the numbers 0.25, 0.25, and 0.19 with two decimal places can be converted into percentages, that is, 0.25 and 0.19 represent 25% and 19% respectively. 0.25, 0.25, 0.19 represents the average load of the system in the past 1 minute, 5 minutes, and 15 minutes. The lower the load, the better the system performance.
This isUptimeFor more information, enterMan uptimeGo to the manual page of the uptime command to view the information.
How long has your machine been running? Paste your uptime to show you.
Via: http://linoxide.com/linux-command/linux-uptime-command/