The command ntpq -np
will output information about time difference between your NTP server and the sources it is synchronizing to (I'm not sure if this is exactly what you want). If you omit -n
parametr (ie. ntpq -p
) it will display hostnames instead of IP addresses (slightly slower, as it has to do DNS lookups).
The command ntpdate -q <address>
will output information about time difference between your machine and the time source specified in <address>
. The -q
parametr is important, as without it ntpdate
will try to sync time to the specified machine instead of just outputting the difference. It is possible that you need to type full path to ntpdate
(eg. /usr/sbin/ntpdate
) if running from non-root user.
(ntpq
should be installed with ntp package, ntpdate
is a separate package so you have to install it if it's not already installed)