The Linux uptime command

Windows Articles

Is ReactOS a real alternative to Windows?

Oh! The eternal struggle of computer operating systems. Windows vs. GNU/Linux and Mac as a distant spectator However, there are also interesting...

How to install Firebird on Ubuntu 20.04/ 18.04?

Database management systems are sufficient for many kinds of projects. Of course, they abound with MySQL / MariaDB or PostgreSQL popular but...

How to disable Firewall in Windows Server 2019/2016

Hello! The Firewall performs an essential security task on any version of Windows Server. In fact, it has the mission of preventing...

How to install ArangoDB on Ubuntu 20.04?

In this post, you will learn how to install ArangoDB on Ubuntu 20.04 So let's go for it What...

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...
angeloma
angeloma
Senior Writer and partner

The Linux terminal is one of the most versatile tools in the operating system. Many professionals use it every day to manage servers or work with networks and other things. In other words, it is a tool for all professions. That is why, in this opportunity, I will teach you a basic command, a very simple one to learn that can be very profitable. In this post, I will introduce you to the Linux uptime command.

Basic usage of the Linux uptime command

The uptime command is one of the most basic of all Linux shells. It is a command that allows you to know how long the system has been running.

Thanks to this command we will be able to program system restarts based on the time the system has been running. Personally, I use it for that. Also, to know when a workstation corresponds to a reboot.

Also, uptime 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.

So, if you use the uptime command like this without any parameters, you will get the following.

:~$ uptime
16:55:12 up  1:41,  1 user,  load average: 1,62, 1,19, 1,04

Now, I will explain briefly what the output obtained means:

  • 16:55:12 -> This is the local time of the computer where we are running the command.
  • up 1:41 -> This is the amount of time the system has been running. In my case, it is about 2 hours.
  • 1 user is active.
  • Load Average -> Displays last minute system load, last 5 minutes and last 15 minutes. This is taken based on the average of processes waiting to do disk I/O tasks. The lower the value, the more inactive the system has been.

On the other hand, the Linux uptime command has few options. If you want to display the information in a more readable format, use the -p option.

:~$ uptime -p
up 2 hours, 12 minutes

Or use the -s option to only show from when the system is active.

:~$ uptime -s
2019-05-17 15:13:47

If you want more information about the command, you can use the -h option.

:~$ uptime -h

So, that is it.

Conclusion

The uptime command is one of those commands quite easy to use but that can be useful in many cases. This way you will improve your use of the terminal and you can use that information in a bash script.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Is ReactOS a real alternative to Windows?

Oh! The eternal struggle of computer operating systems. Windows vs. GNU/Linux and Mac as a distant spectator However, there are also interesting...

How to install Firebird on Ubuntu 20.04/ 18.04?

Database management systems are sufficient for many kinds of projects. Of course, they abound with MySQL / MariaDB or PostgreSQL popular but...

How to disable Firewall in Windows Server 2019/2016

Hello! The Firewall performs an essential security task on any version of Windows Server. In fact, it has the mission of preventing...

How to install ArangoDB on Ubuntu 20.04?

In this post, you will learn how to install ArangoDB on Ubuntu 20.04 So let's go for it What...

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...