Linux basic command-ntpq query time server
Ntpq
The ntpq instruction uses NTP mode 6 packets to communicate with the NTP server and is capable of querying compatible servers on allowed networks. It runs in interactive mode or through command-line arguments.
The scope of application of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora.
1. Grammar
Ntpq [- 46dinp] [- c command] [host] [...]
2. List of options
Option
Description
-4
Parsing using ipv4
-6
Parsing using ipv6
-c
Add executed commands to the list of commands for the specified host
-d
Turn on debug mode
-I
Use interactive mode
-n
Display the host address in decimal format
-p
Displays a list of server peer devices
3. Examples
View the list of server peer devices
[root@localhost ~] # ntpq-p / / View the list of peer servers
Remote refid st t when poll reach delay offset jitter
=
120.25.115.20 10.137.53.7 2 u 9 64 1 184.815 279.126 0.000
203.107.6.88 10.137.55.181 2 u 12 64 1 71.254 230.184 0.000
[root@localhost ~] #
A Linux learning platform has been made, and a prototype has come out at present, which you can refer to and use.
Link: https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ password: n7bk