Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the hwclock command system settings for linux

Shulou Source: shulou.com Published: 2022-06-02 12:44:50 09月13日 Update

Editor to share with you the use of linux hwclock command system settings, I hope you will learn a lot after reading this article, let's discuss it together!

The hwclock command is a hardware clock access tool, which can display the current time, set the time of the hardware clock and set the hardware clock to the system time, or set the system time to the time of the hardware clock.

There are two kinds of clocks in Linux, such as hardware clock and system clock. The hardware clock refers to the clock device on the motherboard, that is, the clock that can usually be set in the BIOS screen. The system clock refers to the clock in kernel. When Linux starts, the system clock reads the setting of the hardware clock, and then the system clock operates independently. All Linux-related instructions and functions are set to read the system clock.

Syntax format: hwclock [parameters]

Common parameters:

-- debug displays detailed information about hwclock execution. -- directisahwclock presets to access hardware clocks from / dev/rtc devices. If it cannot be accessed, you can use this parameter to access the hardware clock directly with the Ihammer O instruction. -- hctosys adjusts the system clock to match the current hardware clock. -- set-- date= sets the hardware clock. -- show displays the time and date of the hardware clock. -- systohc adjusts the hardware clock to match the current system clock. Test only tests the program and does not actually change the hardware clock. -- if utc wants to use Greenwich mean time, add this parameter and hwclock will perform the conversion. -- version displays version information.

Reference example

Setting the hardware time depends on the operating system time, as follows:

[root@linuxcool] # hwclock-- systohc

[root@linuxcool] # hwclock-- systohc-- utc

You can see this in some other versions of Linux, such as RebHat:

[root@linuxcool ~] # cat / etc/sysconfig/clock

View version information:

[root@linuxcool] # hwclock-v after reading this article, I believe you have a certain understanding of the hwclock command system setup using linux, want to know more about it, welcome to follow the industry information channel, thank you for reading!

Tags: Clock hardware system time parameters commands information versions access consistency instructions articles devices adjustments operating systems hosts motherboards that is functions available in Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Apple Shulou Technology OPPO Reno Shulou Information