NTP Commands Cheat Sheet

Here is a cli commands cheat sheet for NTP command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is NTP command?

Add some data here

        # To verify if ntpd is running:
service ntp status

# To start ntpd if not running:
service ntp start

# To display current hardware clock value:
sudo hwclock -r

# To apply system time to hardware time:
sudo hwclock --systohc

# To apply hardware time to system time:
sudo hwclock --hctosys

# To set hwclock to local time:
sudo hwclock --localtime

# To set hwclock to UTC:
sudo hwclock --utc

# To set hwclock manually:
sudo hwclock --set --date="8/10/15 13:10:05"

# To query surrounding stratum time servers
ntpq -pn

# To config file:
/etc/ntp.conf

# To driftfile:
# location of "drift" of your system clock compared to ntp servers:
/var/lib/ntp/ntp.drift
    

Check out the NTP command documentation .


You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list