4. Linux System and Hardware Times
Contents
In a Linux system, we can view the time of the system or the time of the underlying hardware.
Hardware Time
We can view the time of the hardware by using the hwclock or clock command. We looked at the two commands separately through the ll command, and we learned that clock was a soft link to hwclock, so they were the same.
With the help of the man command, we know that hwclock is the command used by system administrators:
Let’s try the results of the two commands separately
|
|
|
|
System Time
We can use the date command to get the system time.
With the help of the man command, we know that date is the command used by users:
Let’s also try the date command:
|
|
Synchronization Between Them
We can synchronise the time between the system and the hardware with some parameters of the hwclock command.
Synchronizing system time to hardware time
We can append the -w parameter to the clock or hwclock command to synchronise system time to hardware time:
|
|
Synchronizing hardware time to system time
We can append the -s parameter to the clock or hwclock command to synchronise hardware time to system time:
|
|
Differences Between Them
Hardware time is generally used when the system starts. System time is generally used after the system is started.
Author Dong Chen
LastMod Tue Feb 5 2019