How to use the Linux hwclock command

Source: Internet
Author: User

In Linux, there are two kinds of clocks, such as hardware clock and system clock. The hardware clock refers to the clock device on the motherboard, which is usually the clock set in the BIOS screen. The system clock refers to the clock in the kernel. When Linux starts, the system clock reads the hardware clock setting, and the system clock is operated independently. All Linux related instructions and functions are set to read the system clock.

Grammar

Hwclock [--adjust][--debug][--directisa][--hctosys][--show][--systohc][--test] [--UTC]

[--version] [--set--date=< Date and time]

Parameters:

    • --adjust Hwclock each time the hardware clock is changed, it is recorded in the/etc/adjtime file. The--adjust parameter allows the Hwclock to estimate the hardware clock deviation based on previous records and use it to correct the current hardware clock.
    • --DEBUG displays detailed information when Hwclock executes.
    • --directisa hwclock preset To access hardware clocks from/DEV/RTC devices. If it is not accessible, this parameter can be used to access the hardware clock directly with the I/O instruction.
    • --hctosys adjusts the system clock to match the current hardware clock.
    • --set--date=< Date and time > Set hardware clock.
    • --show the time and date when the hardware clock is displayed.
    • --SYSTOHC adjusts the hardware clock to match the current system clock.
    • --test only tests the program and does not actually change the hardware clock.
    • --UTC to use GMT, add this parameter, Hwclock will perform the conversion work.
    • --version Displays version information.

Instance

Show Current Time

# Hwclock

May 27, 2010 Thursday 18:04 31 sec -0.704214 seconds

View version Information

# hwclock-v

Hwclock from UTIL-LINUX-2.12A

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.