ntpdate:tldr:6adf7
ntpdate: Query the host without setting the time.
$ ntpdate -q ${host}
try on your machine
The command "ntpdate -q ${host}" is used to query an NTP (Network Time Protocol) server for the current time.
Here's a breakdown of the command:
- "ntpdate": This is the main command used to sync the system time with an NTP server. It queries the server and adjusts the system time accordingly.
- "-q": This flag is used to run the command in query mode. Instead of modifying the system time, it simply retrieves the time information from the server and displays it without making any changes.
- "${host}": This is a placeholder for the hostname or IP address of the NTP server you want to query. The actual value needs to be substituted in place of "${host}". For example, if you want to query an NTP server with the hostname "ntp.example.com", you would replace "${host}" with "ntp.example.com".
In summary, the "ntpdate -q ${host}" command is used to query and display the current time from an NTP server without modifying the system time.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.