Linux command ship with various command line tools to find out server uptime command. File /proc/uptime has uptime information, and file /var/run/utmp has information about who is currently logged on. However, data from /proc/uptime or /var/run/utmp file is not directly readable by humans, so you need to use the following commands.
Command to find the uptime of a Linux server
To find the uptime of a Linux server use any one of the following command. First, open the terminal window and then type:
- uptime command – Tell how long the Linux system has been running
- w command – Show who is logged on and what they are doing including the uptime of a Linux box
- top command – Display Linux server processes and display system Uptime in Linux too.
Let us see examples.
How to check system uptime in Linux
Open the terminal application on Linux and type the following uptime command:
The uptime command gives a one line display of the following information.
- The current time – 10:46:56
- 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.15, 0.08, 0.08)
Show uptime in pretty and human readable format by passing the -p as follows:
up 1 week, 6 days, 2 hours, 50 minutes
Want to find out the system is up since what time?
Try passing the -s as follows to see information in yyyy-mm-dd HH:MM:SS format:
Check Linux system uptime with w command
Run the w command to show information about the users currently on the Linux machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. For example, type the following w command:
Display server uptime in Linux using top command
The top command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes including system uptime. Open the terminal and run:
You learned how to use the uptime command that display the current time, the length of time the Linux system has been up, the number of users online, and the load average. For more information, see this page and the following pages too:
- Linux Server see the historical and statistical uptime of system with tuptime utility
- man uptime