English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux hwclock-Befehl

Linux Command大全

Der Linux-Befehl hwclock wird verwendet, um die Hardwareuhr anzuzeigen und zu konfigurieren.

In Linux gibt es zwei Arten von Uhren: die Hardwareuhr und die Systemuhr. Die Hardwareuhr ist das Uhrwerk auf der Hauptplatine, das normalerweise im BIOS-Bild konfiguriert werden kann. Die Systemuhr bezieht sich auf die Uhr im Kernel. Beim Start von Linux liest die Systemuhr die Einstellungen der Hardwareuhr aus und arbeitet danach unabhängig. Alle Linux-bezogenen Befehle und Funktionen lesen die Einstellungen der Systemuhr.

语法

hwclock [--adjust][--debug][--directisa][--hctosys][--show][--systohc][--test]
[--utc][--version][--set --date=<date and time>]

Parameter:

  • --adjust  hwclock records each change to the hardware clock./etc/in the--adjust parameter, so that hwclock can estimate the deviation of the hardware clock based on the previous records and use it to correct the current hardware clock.
  • --debug  Display detailed information when hwclock is executed.
  • --directisa  hwclock defaults to/dev/rtc device to access the hardware clock. If it cannot be accessed, you can use this parameter to directly use I/O instruction to access the hardware clock.
  • --hctosys  Adjust the system clock to be consistent with the current hardware clock.
  • --set --date=<date and time>  Set the hardware clock.
  • --show  Display the time and date of the hardware clock.
  • --systohc  Adjust the hardware clock to be consistent with the current system clock.
  • --test  Only test the program, and will not actually change the hardware clock.
  • --utc  If you want to use Greenwich Mean Time, please add this parameter, hwclock will perform the conversion.
  • --version  Display version information.

Online Examples

Display Current Time

# hwclock 
2010year 05month27day Thursday 18hours 04minutes31seconds -0.704214 seconds

View Version Information

# hwclock -v
hwclock from util-linux-2.12a

Linux Command大全