Linux uptime command With examples

Linux uptime command With examples

With the Linux uptime command, you can get information about how long the system has been running, the total number of user logins in the system, and the system average load for the past 1,5 and 15 minutes respectively. By running the uptime command in the Linux system, the system can know some of the following information in one line.

  • System current time.
  • How long has the system been running?
  • How many users are currently logged on to the Linux system?
  • What was the system load average for the last 1, 5, and 15 minutes?

Syntax

uptime [-options]

How to use the uptime command

If you run the Linux uptime command in the terminal without any option then, you will get a result like this

# uptime
linux uptime

From the above uptime command, four parts are given as output: current time, uptime, number of users, and average load as mentioned earlier.

In the first entry of the output of the uptime command, you can see the current system time and total uptime of the system as long as the system is running, in the user count you can see the number of users logged into the system and in the last, you can  View the average load time of the system.

show up time in a pretty format

If you want to know the uptime of the system in human-readable format, then for this you need to add the –p option with the uptime command.

#uptime -p
show uptime in a pretty format in linux

Check Linux Server Starting Time

If you want to see the uptime of a Linux server in the format of date and time, then for this you have to use the -s option along with the uptime command. As you can see on the screen below.

# uptime -s
check Linux Server Starting Time

Uptime Version & Help

Every app and software running in the system has a version and sometimes we need to check the version of the command. If you want to check the version of the uptime command, you have to use the -h and -v option with the uptime command.

# uptime –h
#uptime -v
Uptime Version & Help

Check Linux system uptime with the w command

You can use the w command in the Linux system to get information like the uptime command, with this command you can check the current time of the system, how long the system has been running, the total number of user logins in the server, and the system average load time by 1. , 5, and 15 minutes. Below you can see the output of the w command.

Check Linux system uptime with the w command

check server uptime in Linux with top command

With the top command, you can check the dynamic real-time process of the Linux system. With this command, you can get information about all the processes running in the system, memory, CPU, Linux uptime, login user, number of running commands, etc.

Related Articles: What Are top Commands and How to use this command

uptime command is very important for every Linux system administrator because this command helps to tell our server uptime time and other related information, let us understand it well by example, suppose you are a system administrator and for some time you are not able to access the server remotely, then you need to know whether the system has rebooted due to power failure or other reasons, you can run Linux Uptime command to clear the doubt. By the way, nowadays in advanced technology, there are many ways to know the uptime and reboot status of the system, which will be explained in the next article.

In this article, we have explained the Linux uptime command and hope you have understood well about the uptime command. Comment below for any type of feedback related to this article. For similar information visit our other blogs simiservice.com

Rate this post
simi kaithal