System uptime has always been a bragging right for those nerdy enough to care. The uptime denotes the amount of time the system has been up without doing a reboot or system shutdown. In the Linux world it is not unheard of to have your system uptime be over a year. In fact the current known record for a Linux system uptime is 2367.3 days (almost 6.5 years) up. I am guessing it is connected to a gas generator backup in case of electrical outages and sealed below the surface (I have no idea). Regardless, that type of uptime is quite impressive. So the question remains, how do you view that uptime on a Linux or Windows machine? Well guess what, that’s why you’re here.
Display System Uptime in Linux
There are a few places (utilities) that display system uptime to you from the command line. My favourite for this is the, you guessed it, uptime command. This command is very basic and displays the current uptime as well as the system load average from 1 minute, 5 minutes and 15 minutes ago, among other things, have a look:
$ uptime 18:46:54 up 9 days, 22:25, 17 users, load average: 0.02, 0.09, 0.07
This command just parses a /proc/uptime variable to retrieve the current system uptime. You can also just do a cat /proc/uptime which displays:
$ cat /proc/uptime 858679.03 1586913.98
This file contains the length of time since the system was booted, as well as the idle time of the system. These are displayed as floating point values.
Another method to find the system uptime is to use the top command. You will notice that the first line contains the system uptime, with the next line displaying the current set of system tasks, followed by CPU usage:
1 2 3
top - 13:54:31 up 9 days, 22:33, 17 users, load average: 0.06, 0.11, 0.08 Tasks: 188 total, 1 running, 186 sleeping, 1 stopped, 0 zombie Cpu(s): 13.2%us, 13.9%sy, 0.3%ni, 71.9%id, 0.7%wa, 0.0%hi, 0.0%si, 0.0%st
Those are the main ways to view system uptime in Linux.
View System Uptime in Windows
In Windows it is a more arduous task to find the system uptime. There is a utility you may download that displays the uptime as an executable file. The method I use in Windows is:
1. Go to “Start” -> “Run“.
2. Write “CMD” and press on “Enter” key.
3. Write the command “net stats srv” and press on “Enter” key.
4. The line that start with “Statistics since …” provides the time that the server was up from.
Not bad, all in all its just the one command on point 3 above to achieve the same result as in Linux. Anyone out there with an uptime of more than 6.5 years?!