What is uptime command in linux

uptime Command in Linux | Explained

In Linux, the “uptime” command determines how long the system has been in an active state. It shows the system date and time, system uptime, logged-in users, and load averages. It is part of the GNU core utility packages and is available on almost all Linux distributions.

This post aims to illustrate the working and functionality of the “uptime” command in Linux. The guideline of this post is defined below:

What is the uptime Command in Linux?

The “uptime” command is typically used to check the stability and availability of a Linux system. Before digging into detailed usage. Check out the syntax followed by it:

Syntax

The basic structure of the “uptime” command is typed below:

In the syntax of the “uptime” command, “uptime” is the main keyword while the square brackets show its supported “options”.

The commonly used options of the “uptime” command are explained deeply in the below table:

Options Description
-h Provides the “uptime” command help page that holds its basic pieces of information.
-s Shows the system’s last booted date and time.
-p Represents the system uptime in an easy and human-readable format.
-V Displays the “uptime” utility version.

In addition, use the “help” command to get a detailed view of the “uptime” command:

How to Use uptime Command in Linux?

Generally, the “uptime” command shows the time when the system has been started. However, it provides some additional information as well. Here, in this section, some practical examples are described to see the usage of the “uptime” command.

Example 1: Display the System

Simply running the “uptime” command without any argument or option displays the system running uptime and some other important information in one line. Type the below command on the terminal and see the output:

The “uptime” command output contains the following components:

  • Current System’s Time: In our case, it is “19:11:43”, which is “7:11 PM”.
  • System Uptime: It displays the time when the system is active. The system has been up for about “13” minutes in the above output.
  • No of Logged-in Users: The currently logged-in user in this example is only “1”.
  • Load Averages: The load averages indicate how many processes are currently running or waiting to use the CPU after the last “one”, “five”, and “fifteen” minutes.

Example 2: Check the Running Time of the System

The “-p” option of the “uptime” command only shows the system running time in a pretty or human-friendly format:

Читайте также:  Linux mint wifi android

The output denotes that the current system is running up from “1” hour and “17” minutes.

Example 3: Identify the System Startup Time

The “uptime” command with the “-s” option displays the current date and time when the system last booted:

In the above output, the system has last booted on “01-12-2022”.

Conclusion

The “uptime” command is present in most Linux distributions. It provides the system running uptime and other important information. The generalized syntax of the “uptime” command is “$ uptime [OPTION]”. Furthermore, it provides important options that show output according to the user’s needs. This post has described the objective, usage, and working of the “uptime” utility, along with practical examples.

Источник

Linux Uptime Command With Usage Examples

The Linux Operating System is filled with several commands which any aspiring Linux expert or power user e.g. system admin must have a good grasp of. One of such commands is uptime and today, I’ll briefly discuss its purpose and syntax.

Uptime is a command that returns information about how long your system has been running together with the current time, number of users with running sessions, and the system load averages for the past 1, 5, and 15 minutes. It can also filter the information displayed at once depending on your specified options.

uptime uses a simple syntax:

Using Uptime

You can run the uptime command without any options like so:

It will display an output similar to:

09:10:18 up 106 days, 32 min, 2 users, load average: 0.22, 0.41, 0.32

In order of appearance, the command displays the current time as the 1st entry, up means that the system is running and it is displayed next to the total time for which the system has been running, the user count (number of logged on users), and lastly, the system load averages.

What are system load averages? It is the average number of processes that are in a runnable or uninterruptable state. A process is in a runnable state when it is using the CPU or waiting to use the CPU; while a process is in an uninterruptable state when it is waiting for I/O access like waiting for a disk.

To know more about uptime, check out our article: Understand Linux Load Averages and Monitor Performance of Linux

Now let’s see some useful uptime command usage with examples.

Check Linux Server Uptime

You can filter uptime’s result to show only the running time of the system with the command:

# uptime -p up 58 minutes 

Check Linux Server Starting Time

Using option -s will display the date/time since when the system has been running.

# uptime -s 2019-05-31 11:49:17 

Uptime Version & Help

As it is with most command line apps, you can display uptime’s version information and quick help page with the following command.

# uptime -h Usage: uptime [options] Options: -p, --pretty show uptime in pretty format -h, --help display this help and exit -s, --since system up since -V, --version output version information and exit For more details see uptime(1).

Having gotten to this point in the article, you can now use uptime for your daily runs and you’ll determine its level of usefulness to you. If you have any doubts, here’s its man page.

Источник

Uptime Command in Linux

Uptime is a command that returns information about how long your system has been running together with the current time, number of users with running sessions, and the system load averages for the past 1, 5, and 15 minutes. It can also filter the information displayed at once depending on your specified options.

  1. How do I find uptime in Linux?
  2. What is use of uptime command?
  3. How do I check my system uptime?
  4. What is uptime and downtime in Linux?
  5. Who am I command line?
  6. What does uptime mean Linux?
  7. What is proc uptime?
  8. How do I edit uptime?
  9. What is the command to check server uptime?
  10. How do I check my server uptime remotely?
  11. What is the command to check system uptime in Windows?
Читайте также:  Set date astra linux

How do I find uptime in Linux?

To find the uptime of a Linux server use any one of the following command. First, open the terminal window and then type: uptime command – Tell how long the Linux system has been running. w command – Show who is logged on and what they are doing including the uptime of a Linux box.

What is use of uptime command?

Uptime Command In Linux: It is used to find out how long the system is active (running). This command returns set of values that involve, the current time, and the amount of time system is in running state, number of users currently logged into, and the load time for the past 1, 5 and 15 minutes respectively.

How do I check my system uptime?

To check Windows uptime with Task Manager, right-click the Windows taskbar and select Task Manager or press Ctrl–Shift–Esc. Once Task Manager is open, click on the Performance tab. Under the Performance tab, you will see a label of Up Time.

What is uptime and downtime in Linux?

Uptime is a computer industry term for the time during which a computer or IT system is operational. . Downtime, the opposite of uptime, is the period of time when a system is not operational. The terms uptime and downtime are used to define the level of success provided by real-time services.

Who am I command line?

whoami command is used both in Unix Operating System and as well as in Windows Operating System. It is basically the concatenation of the strings “who”,”am”,”i” as whoami. It displays the username of the current user when this command is invoked. It is similar as running the id command with the options -un.

What does uptime mean Linux?

Uptime is a command that returns information about how long your system has been running together with the current time, number of users with running sessions, and the system load averages for the past 1, 5, and 15 minutes.

What is proc uptime?

Shows how long the system has been on since it was last restarted: $ cat /proc/uptime 350735.47 234388.90. 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.

How do I edit uptime?

In the upper right corner of the “Uptime” page is an “Edit” button with a cog icon. Click the “Edit” button to be taken to a settings page where you can alter your monitors’ frequency, test regions, and other settings.

What is the command to check server uptime?

  1. Task Manager. Probably the simplest way to manually check Windows server uptime is to open Task Manager, available on your Windows taskbar. .
  2. Systeminfo Command. .
  3. Net Stats Command.

How do I check my server uptime remotely?

The most efficient way is probably just to use PowerShell cmdlets. Use the Win32_OperatingSystem WMI class with the -ComputerName switch to pull the LastBootupTime property from a remote computer and then subtract from the value of the current date/time that comes from Get-Date.

What is the command to check system uptime in Windows?

  1. Select “Start“.
  2. Type “cmd“, then press “Enter“.
  3. Type “net statistics workstation“, then press “Enter“.
  4. Toward the top of the output, there is a line that says “Statistics Since…” that will show the time the computer last came online.
Читайте также:  Linux не установлен telnet

How to safely remove PPA repositories in Ubuntu

Remove

Remove a PPA (GUI Method)Launch Software & Updates.Click the “Other Software” tab.Select (click) the PPA you want to delete.Click “Remove” to remo.

How to Install and Configure Consul Server on Ubuntu 18.04

Consul

How do I set up a consul server?How do I know if consul is installed?How do I update my consul?What is consul Linux?How do I access a consul server?Wh.

How to Install HandBrake Video Converter on Ubuntu

Handbrake

On your Ubuntu desktop Activities toolbar, click the Ubuntu Software icon.In the following view, click on the search icon and enter Handbrake in the s.

Latest news, practical advice, detailed reviews and guides. We have everything about the Linux operating system

Источник

Linux Uptime Command

Any Linux distro comes with the “uptime” command. It’s an important command for system administrators to know. It helps troubleshoot the issues related to power and scheduling. Of course, there are other alternative tools available for this purpose but uptime is relatively simple and easy to use.

The content of this guide is as follows:

Let’s start the uptime command.

How Does the Uptime Command Work?

If you use the system’s uptime command via command prompt, you get many benefits out of it. For example, suppose you are facing a problem in connecting to the server. Then, you can easily run the uptime command on the server to check if there has been a recent reboot on the server. This helps in troubleshooting the situation and provides you with better visibility to apply the required solution.

The output specifies the current time. “Up” specifies that the system is up and running along with the total time that the system is up to the user count and the system load averages.

Running the uptime command of a Linux system via the command line, you get a specified output in the following order:

  • The current time of the system.
  • The total uptime of the system.
  • The active users that are currently running the system.
  • The average of the system loads that is available for the past 1, 5, and 15 minutes.

Uptime command comes with various options. To check the options, we can run the “help” command.

Example 1: Uptime in Human-Readable Format

With the use of the “-p” option, you can get a pretty clear output which displays the uptime in the number of days, hours, minutes, and seconds format:

Example 2: Check the Start Time of the System

Another option is to check the exact time when the system is first started rather than the time spent since it started. Run the following command on the command-line interface with the “-s” option:

Example 3: Check the Version of the Installed Uptime Command

If you want to check the version of the installed uptime package in the system, run the following command with the “-V” option:

The output shows the current version of the “uptime” command.

Conclusion

Linux is a well-known environment and is highly recommended for various projects due to its stability and various configurations. The “uptime” command checks the system information. We explained the “uptime” command with its various options.

About the author

Syed Minhal Abbas

I hold a master’s degree in computer science and work as an academic researcher. I am eager to read about new technologies and share them with the rest of the world.

Источник

Оцените статью
Adblock
detector