Display ntpd's time-source associations, selected peer, reachability, and offset in a table.
Which command is appropriate?
ntpq -p queries ntpd and displays its peer association table. A star commonly marks the selected peer.
Detailed explanation
ntpd -pIncorrect. ntpd is the daemon, not the peer-query command.
Incorrect. ntpd is the daemon, not the peer-query command.
ntpdate -pIncorrect. ntpdate is for one-shot synchronization.
Incorrect. ntpdate is for one-shot synchronization.
chronyc -pIncorrect. chronyc uses commands such as sources rather than ntpq syntax.
Incorrect. chronyc uses commands such as sources rather than ntpq syntax.
ntpq -pCorrect. ntpq -p displays ntpd peers.
Correct. ntpq -p displays ntpd peers.
Try it yourself
An example you can run in a temporary verification environment.
ntpq --help 2>&1 | grep -E -- '-p' | head -n 1Expected result
peers表示に関するhelp行Key points
- ntpq is the query client
- -p lists peers
- Selected peer is marked
Notes
- Environment: ntpq help / daemonへの問い合わせなし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.