Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the uptime command in linux

Shulou Source: shulou.com Published: 2022-06-01 05:30:53 10月06日 Update

This article mainly introduces how to use the uptime command in linux. It is very detailed and has a certain reference value. Friends who are interested must finish it!

Linux uptime command

By name, the uptime command tells you how long the system has been running up. This is the grammar:

Uptime [options]

The tool's man page says:

Uptime displays the following information on one line: the current time, how long the system has been running, how many users are currently logged in, and the average load of the system for the first 1, 5, and 15 minutes.

The following Q & An examples should give you a better understanding of the uptime command.

Q1. How to use the uptime command

The basic use of uptime is simple-just enter the name of the command and press enter.

Uptime

This is the output:

How to use the uptime command

Here, * is the current time, up indicates that the system is running, 5:53 is the total time for the system to start, and * is the load load information of the system. If you want to learn more, here is a description of a piece of information on the uptime man page:

The system load is the average number of processes in the runnable runnable or uninterruptible uninterruptable state. Runnable processes are either using CPU or waiting to use CPU. A process in an uninterruptible state is waiting for some Imax O access, such as waiting for disk IO.

There is an average of three time intervals. The meaning of the load average varies depending on the number of CPU in the system. A load of 1 means full load for a system with only a single CPU, while for a system with 4 CPU, it means that 75% of the time is idle.

Q2. How to realize time in a more humane format

If you just want to know how long the system has been running and want to display it in a more user-friendly format, you can use the-p item.

Uptime-p

This is the output:

Make the tool show up time in pretty format

Q3. How to make uptime display the date / time when the system starts?

You can also specify the time and date on which the uptme display system starts running. The method is to use the-s command entry.

Uptime-s

This is the output:

Make uptime display date/time since when system is up

Q4. How to get version information and help information

-V gets version information,-h gets help information.

Uptime-V uptime-h

The above is all the contents of the article "how to use uptime commands in linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: System time command information run this is status process help output difference humanity content meaning date display system format version article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Huawei vpn Shulou Tech Info OPPO Reno