Query time.example.test once and show offset information.
Do not change the system clock.
Which command is appropriate?
ntpdate -q SERVER performs a query-only request and reports results without setting the system clock.
Detailed explanation
ntpdate time.example.testIncorrect. Plain ntpdate may attempt to adjust the system clock.
Incorrect. Plain ntpdate may attempt to adjust the system clock.
ntpdate -q time.example.testCorrect. -q reports the query without changing the clock.
Correct. -q reports the query without changing the clock.
ntpq -w time.example.testIncorrect. This is not the ntpq form for a one-shot query.
Incorrect. This is not the ntpq form for a one-shot query.
date -q time.example.testIncorrect. date does not query NTP servers.
Incorrect. date does not query NTP servers.
Try it yourself
An example you can run in a temporary verification environment.
ntpdate --help 2>&1 | grep -E -- '-q' | head -n 1Expected result
query onlyを示すhelp行Key points
- -q means query only
- One-shot query
- No clock change
Notes
- Environment: ntpdate help / 外部通信なし
- 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.