Linux command
ntpctl 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show synchronization status
ntpctl -s status
Show all peers
ntpctl -s peers
Show all sensors
ntpctl -s sensors
Show all information
ntpctl -s all
说明
ntpctl queries the OpenNTPD daemon for synchronization status. It displays information about time sources and synchronization state. The status view shows whether the clock is synchronized, the stratum level, and the offset from the reference time. A synchronized clock means the system time is being corrected. Peer display lists configured NTP servers with their status, stratum, and offset. This helps identify which servers are reachable and providing good time. Sensors show hardware time sources like GPS receivers or radio clocks that may be configured. These provide local reference time independent of network. The tool communicates with ntpd through a control socket. The daemon must be running with control socket enabled for ntpctl to work. OpenNTPD emphasizes security and simplicity over feature completeness. ntpctl reflects this by providing essential status information without complex queries.
参数
- -s status
- Show synchronization status.
- -s peers
- Show peer status.
- -s sensors
- Show sensor status.
- -s all
- Show all information.
FAQ
What is the ntpctl command used for?
ntpctl queries the OpenNTPD daemon for synchronization status. It displays information about time sources and synchronization state. The status view shows whether the clock is synchronized, the stratum level, and the offset from the reference time. A synchronized clock means the system time is being corrected. Peer display lists configured NTP servers with their status, stratum, and offset. This helps identify which servers are reachable and providing good time. Sensors show hardware time sources like GPS receivers or radio clocks that may be configured. These provide local reference time independent of network. The tool communicates with ntpd through a control socket. The daemon must be running with control socket enabled for ntpctl to work. OpenNTPD emphasizes security and simplicity over feature completeness. ntpctl reflects this by providing essential status information without complex queries.
How do I run a basic ntpctl example?
Run `ntpctl -s status` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -s status do in ntpctl?
Show synchronization status.