Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the synchronization time commands in linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about what synchronization time commands are available in linux, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

Linux synchronization time command: 1, hwclock command, you can synchronize system time and hardware time, such as "hwclock-w" or "hwclock-s"; 2, ntpdate command, you can synchronize time between different machines.

1. Setting of Linux system time

To set system time in Linux, you can use the date command:

/ / View time [root@node1 ~] # dateTue Feb 25 20:15:18 CST 2014 dateTue Feb / modification time [root@node1] # date-s "20140225 20:16:00" # yyyymmdd hh:mm:ssTue Feb 25 20:16:00 CST 2014//date has multiple time formats acceptable, check date-- help2. Setting of Linux hardware time

You can use the hwclock or clock command to set the hardware time. The two are basically the same, using only one, except that the clock command supports Alpha hardware architecture as well as x86 hardware architecture.

/ / you can use hwclock, hwclock-- show or hwclock-r [root@node1 ~] # hwclock-- showTue 25 Feb 2014 08:21:14 PM CST-0.327068 seconds// to set the hardware time [root@node1 ~] # hwclock-- set-- date "20140225 20:23:00" [root@node1 ~] # hwclockTue 25 Feb 2014 08:23:04 PM CST-0.750440 seconds3. Synchronization of system time and hardware time

To synchronize system time and hardware time, you can use the hwclock command.

/ / modify hardware time [root@node1 ~] # hwclock-- systohc based on system time

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report