Forrest logo
back to the ntpdate tool

ntpdate:tldr:6f2d6

ntpdate: Force time to be stepped using `settimeofday` instead of `slewed`.
$ sudo ntpdate -b ${host}
try on your machine

The command sudo ntpdate -b ${host} is used to synchronize the system's time with the Network Time Protocol (NTP) server specified by the ${host} variable.

Here's a breakdown of the command:

  • sudo: It is a command that allows a user with administrative privileges (superuser) to execute a command as another user, typically the root user. It prompts for the user's password before executing the command.

  • ntpdate: It is a command-line utility used to query NTP servers and adjust the local system's clock accordingly.

  • -b: This option is used to set the "panic threshold" when adjusting the clock. If the time difference between the local system's clock and the NTP server's time is greater than the value specified by the "panic threshold," the system will step the time, which means it will abruptly change the clock to match the server's time. This option helps ensure accurate time synchronization but might cause slight disruptions in applications that are sensitive to time changes.

  • ${host}: It is a placeholder for the hostname or IP address of the NTP server you want to synchronize with. You need to replace ${host} with the actual server's address.

Overall, the command with sudo ntpdate -b ${host} is used to update the system's time by synchronizing it with the specified NTP server. The use of sudo grants the necessary privileges for time adjustment.

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.
back to the ntpdate tool