How to Check Server Uptime in Linux

Server UptimeInformation about how long the system has been running or server uptime is not critical for some people. But it is important for server administrators. Servers that run mission-critical applications must run as long as possible. Sometimes it must be zero downtime. Information about the uptime is very useful in many cases it helps to audit how long the server is running.

In this tutorial, we will learn about the command to find the system uptime in linux.Uptime system uptime means how long the server has been running since the last shutdown or reboot.

READ  How to Fix "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first" Error On Linux CentOS 6.2 Server

Question :
How to check unix or linux server uptime ? What command Should i run ?

Answer :
1. Run uptime command :

# uptime

Sample outputs:

 22:54:34 up  1:26,  1 user,  load average: 0.11, 0.03, 0.01

The uptime command gives a one line display of the following information.

  • The current time (22:54:34)
  • How long the system has been running (up 1 hour 26 Minutes)
  • How many users are currently logged on (1 user)
  • The system load averages for the past 1, 5, and 15 minutes (0.11, 0.03, 0.01)
READ  How to Find files in Linux

2. You can use w command to check server uptime

# w

Sample outputs:

 23:06:57 up  1:38,  1 user,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    192.168.1.52     21:30    0.00s  1.85s  0.01s w

Please note that the w command also displays who is logged together with uptime info above.

3. Check server uptime using top command.

# top
top - 23:27:01 up 4 days, 10:20,  1 user,  load average: 0.22, 0.12, 0.09
Tasks: 163 total,   1 running, 162 sleeping,   0 stopped,   0 zombie
%Cpu(s):  6.1 us,  1.0 sy,  0.0 ni, 92.7 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  4043436 total,   282644 free,  1044916 used,  2715876 buff/cache
KiB Swap:  8388600 total,  8316440 free,    72160 used.  2905352 avail Mem
1 comment
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee