I would like to find out how long the system has been running under a UNIX or Linux operating system. How do I find out system uptime? How to tell how long the Linux system has been running on?
Both Linux and Unix-like systems come with various command to find out server uptime command. Under Linux file /proc/uptime has uptime information and file/var/run/utmp has information about who is currently logged on. However, info from /proc/uptime or utmp file is not directly readable by humans; therefore, you need to use the following commands. This page shows command that tell how long the Linux and Unix-based system has been running.
Linux Server Uptime Command
Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command:
21:54:11 up 13 days, 4:29, 1 user, load average: 0.21, 0.21, 0.12
The uptime command gives a one line display of the following information.
- The current time (21:54:11)
- How long the system has been running (up 13 days)
- How many users are currently logged on (1 user)
- The system load averages for the past 1, 5, and 15 minutes (0.21, 0.21, 0.12)
See uptime in pretty format pass the -p option to the uptime command
$ uptime -p
up 3 days, 2 hours, 11 minutes
This is the same information contained in the header line displayed by the w command and top command:
21:56:06 up 13 days, 4:31, 1 user, load average: 0.03, 0.14, 0.09 USER TTY FROM [email protected] IDLE JCPU PCPU WHAT root pts/0 123.xxx.yy.zzz 21:54 0.00s 0.02s 0.00s vi
Getting help about uptime command
To check system uptime in Linux and Unix we use the uptime command. However, if you need more information on command option type the following man command:
$ man uptime
$ uptime --help
-p, --pretty show uptime in pretty format -h, --help display this help and exit -s, --since system up since -V, --version output version information and exit
Use top command to display Linux system uptime
Type the following command:
Please note that the w command displays who is logged on and what they are doing while top command provides a dynamic real-time view of a running Linux/UNIX/BSD operating systems including processes.
In this quick tutorial, you learned how to use uptime, w, and top commands to see system uptime and other information from the command line.