-2

I've been told to execute the ntpq command for some reason in my work. When I look for the command on a Unix-based machine, I found more commands with one daemon:

[Web-01 ~]$ #ntp with <tab> key, lists commands prefixed with ntp, in a typical linux

[Web-01 ~]$ ntp
ntpd        ntpdc       ntpq        ntptime
ntpdate     ntp-keygen  ntpstat

Can you let me know what for ntpq is used for, and about all the other NTP commands.

Dev Anand Sadasivam
  • 699
  • 7
  • 21
  • 49
  • 1
    You should know how to run `man ntpd` etc. That tells you what's relevant to your machine. (I'm not sure how running `ntp` listed commands with `ntp` at the start; it is more like the output from `cd /usr/bin; ls ntp*`, or something similar.) There's (probably) only one daemon listed there; that's `ntpd`. Daemons conventionally have names ending `d`, but not all commands ending `d` are daemons and some daemons have a name not ending in `d`. I'm not sure about `ntpdc` — but to find out, I'd do what you need to do: run `man ntpdc` or search on Google with a term such as 'ntpdc program'. – Jonathan Leffler Dec 22 '15 at 18:02
  • some alphabets of the command and `` gives the list commands preceding with that **prefix**.... Some environment setting involved behind this..... Some of the unix machines does not gives the list by `` key.... If I get to know about the what env. setting involved behind this to ease find the commands by prefix I will get you to know..... – Dev Anand Sadasivam Dec 23 '15 at 04:36
  • `ntpdc` is customized variant of `ntpq` vendor specific. I read by `--help`..... although `man` pages gives more elaborative information needed `--help` for any `unix` command is handy. – Dev Anand Sadasivam Dec 30 '15 at 04:22
  • 1
    Note that `--help` is a GNU convention, not a Unix or POSIX convention; the same with `--version`. Both are useful. Some programs support those options even if they are not otherwise GNU programs; others use alternatives. It is reasonable to try `-V` for version; it is less clear what to try for help, but `-h` sometimes works, and failing that, `-:` usually elicits some sort of usage message. – Jonathan Leffler Dec 30 '15 at 04:25

1 Answers1

2

Please see here for a good summary and examples:

http://www.cyberciti.biz/faq/linux-unix-bsd-is-ntp-client-working/

But, in summary:

  • ntpq: is to test/monitor all the NTP related daemons
  • ntpd: actual daemon running in the background
  • ntpstat: most useful in checking if clocks are in sync or not
  • ntpdate: force a clock update

and so on and so forth.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Mamun
  • 2,322
  • 4
  • 27
  • 41