Do you want to know, how long your Linux system has been running without downtime? when the system is up and what date.
There are multiple commands is available in Linux to check server/system uptime and most of users prefer the standard and very famous command called `uptime` to get this details.
Server uptime is not important for some people but it’s very important for server administrators when the server running with mission-critical applications such as online shopping portal, netbanking portal, etc,.
It must be zero downtime because if there is a down time then it will impact badly to million users.
As i told, many commands are available to check server uptime in Linux. In this tutorial we are going teach you how to check this using below 11 methods.
Uptime means how long the server has been up since its last shutdown or reboot.
The uptime command the fetch the details from `/proc` files and print the server uptime, the `/proc` file is not directly readable by humans.
The below commands will print how long the system has been running and up. It also shows some additional information.
### Method-1 : Using uptime Command
uptime command will tell how long the system has been running. It gives a one line display of the following information.
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.
w command provides a quick summary of every user logged into a computer, what each user is currently doing,
and what load all the activity is imposing on the computer itself. The command is a one-command combination of several other Unix programs: who, uptime, and ps -a.
USER TTY FROM [emailprotected] IDLE JCPU PCPU WHAT
root pts/1 103.5.134.167 08:34 0.00s 0.01s 0.00s w
```
### Method-3 : Using top Command
Top command is one of the basic command to monitor real-time system processes in Linux. It display system information and running processes information like uptime, average load, tasks running, number of users logged in, number of CPUs & cpu utilization, Memory & swap information. Run top command then hit E to bring the memory utilization in MB.
**Suggested Read :** [TOP Command Examples to Monitor Server Performance][1]
```
# top -c
top - 08:36:01 up 21 days, 5:48, 1 user, load average: 0.12, 0.08, 0.02
who command displays a list of users who are currently logged into the computer. The who command is related to the command w, which provides the same information but also displays additional data and statistics.
```
# who -b
system boot 2018-04-12 02:48
```
### Method-5 : Using last Command
The last command displays a list of last logged in users. Last searches back through the file /var/log/wtmp and displays a list of all users logged in (and out) since that file was created.
```
# last reboot -F | head -1 | awk '{print $5,$6,$7,$8,$9}'
Thu Apr 12 02:48:04 2018
```
### Method-6 : Using /proc/uptime File
This file contains information detailing how long the system has been on since its last restart. The output of `/proc/uptime` is quite minimal.
The first number is the total number of seconds the system has been up. The second number is how much of that time the machine has spent idle, in seconds.
```
# cat /proc/uptime
1835457.68 1809207.16
```
# date -d “$(Method-7 : Using tuptime Command
Tuptime is a tool for report the historical and statistical running time of the system, keeping it between restarts. Like uptime command but with more interesting output.
```
$ tuptime
```
### Method-8 : Using htop Command
htop is an interactive process viewer for Linux which was developed by Hisham using ncurses library. Htop have many of features and options compared to top command.
**Suggested Read :** [Monitor system resources using Htop command][2]
Glances is a cross-platform curses-based system monitoring tool written in Python. We can say all in one place, like maximum of information in a minimum of space. It uses psutil library to get information from your system.
Glances capable to monitor CPU, Memory, Load, Process list, Network interface, Disk I/O, Raid, Sensors, Filesystem (and folders), Docker, Monitor, Alert, System info, Uptime, Quicklook (CPU, MEM, LOAD), etc,.
**Suggested Read :** [Glances (All in one Place)– An Advanced Real Time System Performance Monitoring Tool for Linux][3]
```
glances
ubuntu (Ubuntu 17.10 64bit / Linux 4.13.0-37-generic) - IP 192.168.1.6/24 Uptime: 21 days, 05:55:15
CPU [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 90.6%] CPU - 90.6% nice: 0.0% ctx_sw: 4K MEM \ 78.4% active: 942M SWAP - 5.9% LOAD 2-core