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

How to use the clock command in Linux system

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In this issue, Xiaobian will bring you about how to use the clock command in Linux system. The article is rich in content and analyzes and narrates from a professional perspective. After reading this article, I hope you can gain something.

clock command: Sets or displays an approximation of hardware time

necessary parameters

--adjust automatically adjusts hardware clock time

--debug When running, output detailed processing

--directisa directly accesses the hardware clock without passing through the device file/etc/rtc

--getepoch outputs the value of the hardware clock to standard output

--hctosys clock synchronization to synchronize the system clock and hardware clock

--se--date Set hardware time

--show shows hardware clock to standard output

--systohc system time write hardware clock

--test

--utc sets the hardware clock time to UTC

selection parameter

- seteoch-epoch = year of setting hardware clock

--version Display version information

Example:

The code is as follows:

[root@localhost www]# clock #Displays hardware clock time

Saturday May 4th, 2013 14:24:37-0.019069 seconds

The code is as follows:

[root@localhost www]# clock --utc #shows utc hardware clock time

Saturday May 4th, 2013 22:24:50 seconds-0.000655 seconds

The code is as follows:

[root@localhost www]# clock --set --date="05/04/2013 14:30:01"

The code is as follows:

[root@localhost www]# clock

Saturday May 4th, 2013 14:30:06 seconds-0.000904 seconds

The above is how to use the clock command in the Linux system shared by Xiaobian. If you happen to have similar doubts, you may wish to refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.

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