For a normal Linux user it is not critical about how long the system been running but for a Linux Administrator it is critical to know about it. Servers which running mission critical application must be running as long as possible. Sometimes it must be zero-downtime. So, how can we know information about it?
In this article I will show you how you can check how long your system been running using uptime command, to run this command you do not need root access. By default uptime command already installed on most of the Linux system.
Find How Long Your System Been Running
# uptime 03:43:13 up 11 days, 4:26, 2 users, load average: 0.20, 0.10, 0.18
Above output comes from /proc/uptime file. Even the file is text based, but it’s a raw information which is not directly human-readable. That’s why we need uptime command to translate it.
Lets go understand the uptime command output.
In above output the first information on the left side is “03:43:13” this is your system current time.
In the second information you can see “up 11 days, 4:26” This information provides you how long your system has been running. As you can see your system has been running from 11 days and 4 hours and 26 minutes. After restating the system counter will be reset to zero.
Logged In Users
Next the third information shows logged in users on the system. As you can see there are 2 users are logged in at that time. When there is multiple user logged in, uptime will tell you the numbers.
In the last information you can check average load of the system. As you can see 0.20, 0.10, 0.18. Two decimal point is translated as a percentage. 0.20 means 20% and 0.10 means 10%.
While the sequence 0.20, 0.10, 0.18 represent for the past 1 minutes, 5 minutes and 15 minutes. The lower numbers you get mean the better your system will perform.
That’s the usage of the uptime command in daily used. To more details go to its manual page.
# man uptime