DED9

How to check uptime for a Linux Server

Sometimes you may need to know how long your system has been running. In this guide, you will learn how to check Linux server uptime. There are different ways to do this using different tools.
Prerequisites for this training

You need to have a copy of the Linux Server to get started. If you don’t have a physical server, you can buy a virtual server at a reasonable price from Ded9.com. We suggest the Ubuntu distribution Linux virtual server if the commands are not much different in different Linux distributions.

To buy a virtual server with high uptime, you can order your VPS according to your needs.

1) Checking the server usage time with the uptime command

Let’s start with the simple uptime command.

uptime

The last time the system was booted, it printed the running time in HH:mm format and the load average to the terminal. Here is a good example of sample output.

Use the -s flag if you want it to be displayed last since the system boot.

uptime -s

Add the -p flag to view runtime in a more user-friendly and human-readable format.

uptime -p

2) Check the uptime using Linux w command

The w command is another Linux command line tool you can use to extract it. It is usually used to check logged-in users, but it also displays it’s statistics.

Simply run the command as below.

w

3) Uptime check using neofetch tool in Linux

Neofetch is a command line utility that displays a set of system information on a terminal, including the operating system logo. It checks the Linux version along with information such as operating system type, kernel, shell type, CPU and memory information and even updates time.

To launch neofetch, simply run:

neofetch

4) Using top / htop

The Linux top command is used to check the processes running on a system. However, you can retrieve other information such as load average, memory size, CPU usage, and runtime from the top of the output.

top

Htop is an improved version of the top tool, it displays color outputs in a user-friendly way. Checking Linux server uptime has become much easier compared to using the top command.

htop

This tutorial has described 4 ways to display your Linux uptime. We hope this tutorial was useful for you.

Die mobile Version verlassen