The Uptime of Linux commands

Source: Internet
Author: User

What is it

The uptime is used to see how long the system has been started.

It displays the same information as the header of the W command (the first line).

Give me a chestnut.

To give an actual application scenario:

such as the discovery of some servers on the server did not join the start-up service hangs a piece, this time may suspect that this server has been restarted, can be on the service hangs on the machine to perform uptime to see the time has been started, if found to be small, it is tragic:

This is the case is more than a day before being restarted, of course, this is a better situation, if the server itself to restart the machine will have a bad egg to check the reason.

This should normally be the case:

PS: Although the server generally does not restart, but the important service is to join as far as possible to start a more reliable boot.

Output description
[Email protected] ~]# uptime 23:20:14 up  6:24,  3 users,  load average:0.00, 0.01, 0.05

The output indicates:

1. Currently 23:20:14 points

2. The system has started 6个小时24分钟

3. There are now 3 users logged into the system

4. The load of the system in the last 1 minutes, 5 minutes, 15 minutes is 0.00,0.01,0.05 respectively.

Advanced usage

Uptime provides some options, but these options are not available in all versions, uptime is one of the Procps toolkits, and Procps is a toolkit for displaying and controlling system information and process information.

Version

To view the version of the currently installed PROCPS, different versions of the support for options are not the same:

[Email protected] ~]# uptime--versionuptime from Procps-ng 3.3.10
Pretty

The pretty option shows how long it has been started in a more friendly way:

[Email protected] ~]# uptime--prettyup 6 hours, Wuyi minutes

Reference Manuals

Simple reference Manual:

Root     pts/1    192.168.157.1    23:20    3.00s  0.06s  0.03s w[[email protected] ~]# uptime--helpusage : Uptime [options]options:-P,--pretty   show uptime in pretty format-h,--help display this help     and Exit-s,--s Ince    system up since-v,--version  output version information and exitfor more details see uptime (1).

You can use man to view a more detailed reference manual:

Mans uptime

.

The Uptime of Linux commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.