Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the uptime command in linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report