Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Querying the NTP status via command-line options

&pagelevel(4)&pagelevel

ntpq

[-inp][-d][-c <command>] [<server>] [...]

If one or more statements are specified on the command line, each of these statements is sent to the NTP servers running either on the host specified in the command line arguments or, by default, on the local host (localhost). If none of the statements is specified, ntpq attempts to read commands from the standard input and execute them on the NTP server that is running on the first host specified in the command line or, by default (if no other host is specified), on the local host.

ntpq uses special packets to communicate with the NTP server and can therefore also be used to query any compatible NTP servers on the network.

The command-line options are described below. If a command-line option other than -i or -n is specified, the queries involved are sent directly to the named hosts. Otherwise, ntpq tries to read commands from the standard input interactively.


Options

-i

Places ntpq in interactive mode. Commands are read from the standard input.

-n

Outputs all host addresses in dotted notation, instead of converting them to host names.

-p

Prints a list of partners known to the server (NTP partner hosts and clocks) as well as an overview of their statuses. This is the equivalent of the interactive command peers.

-d

Activates the output of debugging data.

-c <command>[ <host>] ...

The following argument is interpreted as a command and added to the list of commands to be executed on the specified hosts. The -c option can be specified any number of times.

<server>

Specifies the NTP server for which the current status is to be determined.