Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Use ntpq Command in Linux

In the Linux environment, the ntpq command is a powerful tool used to query and control the Network Time Protocol (NTP) daemon running on a system. NTP is a protocol used to synchronize the time on computer systems over a network. It is crucial for maintaining accurate timekeeping, especially in distributed systems or systems that require precise time synchronization.

The ntpq command allows system administrators to monitor and troubleshoot NTP-related issues, query NTP servers, and obtain information about the current status of the NTP daemon. It provides a command-line interface to interact with the NTP daemon and retrieve valuable information.

To use the ntpq command in Linux, you need to have the NTP package installed on your system. Most Linux distributions come with the NTP package pre-installed, but if it's not available, you can install it using the package manager specific to your distribution.

Once the NTP package is installed, you can access the ntpq command from the terminal. The ntpq command supports various options and subcommands, allowing you to perform different tasks related to NTP.

Examples:

  1. Querying NTP Servers: To query an NTP server and retrieve information about its current status, you can use the following command:

    ntpq -p <server>

    Replace <server> with the IP address or hostname of the NTP server you want to query. This command will display detailed information about the NTP server, including its reachability, delay, offset, and more.

  2. Checking NTP Peers: To view the list of NTP peers configured on your system, you can use the following command:

    ntpq -p

    This command will display a table listing all the NTP peers along with their status, reachability, and synchronization details.

  3. Monitoring NTP Daemon: To monitor the NTP daemon running on your system in real-time, you can use the following command:

    ntpq -c monlist

    This command will provide a continuous stream of information about the NTP daemon, including the current state, associations, and system statistics.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.