Linux command
ntpq 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
ntpq
Example
ntpq -p
Example
ntpq -n -p
Example
ntpq -d
Example
ntpq -c rv
说明
ntpq queries the NTP daemon for status and configuration information. It can display peer associations, system variables, and synchronization statistics in both interactive and command-line modes. The peer list (-p) shows all configured time sources with columns indicating: - remote: Server address (* = current sync source) - refid: Reference clock or upstream server - st: Stratum level - reach: Reachability register (377 = all recent queries successful) - delay/offset/jitter: Timing metrics in milliseconds Interactive mode provides additional commands for detailed inspection of the NTP daemon's state.
参数
- -n, --numeric
- Display addresses numerically without DNS resolution
- -c _command_, --command _command_
- Execute a command without entering interactive mode
- -d, --debug-level
- Enable debugging output
- -i, --interactive
- Force interactive mode.
- -4, -6
- Resolve hostnames using IPv4 or IPv6 only.
- -w, --wide
- Use a wider peer table so long hostnames are not truncated.
- -k _FILE_, --keyfile _FILE_
- Read symmetric keys from _FILE_ for authenticated control requests.
- -a _KEYID_, --authentication _KEYID_
- Use the given key id when sending authenticated queries.
- -p, --peers
- Print a summary of all configured peers (same as interactive `peers`).
- -V, --version
- Print version information and exit.
FAQ
What is the ntpq command used for?
ntpq queries the NTP daemon for status and configuration information. It can display peer associations, system variables, and synchronization statistics in both interactive and command-line modes. The peer list (-p) shows all configured time sources with columns indicating: - remote: Server address (* = current sync source) - refid: Reference clock or upstream server - st: Stratum level - reach: Reachability register (377 = all recent queries successful) - delay/offset/jitter: Timing metrics in milliseconds Interactive mode provides additional commands for detailed inspection of the NTP daemon's state.
How do I run a basic ntpq example?
Run `ntpq` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -n, --numeric do in ntpq?
Display addresses numerically without DNS resolution