Linux Administration - Time
Date
Commands
date
Displays current date/time. date 103123302007
Sets the current time 11:30pm on October 31, 2007. hwclock --systohc
Synchronize hardware clock to the software clock. hwclock --hctosys
Synchronize software clock to the hardware clock.
NTP
Files
/etc/ntp.conf - configuration file
/var/lib/ntp - ntp files
/var/lib/ntp/ntp.drift - file used to correct time drifting
Commands
/etc/init.d/ntpd restart
Restart ntp daemon via SysV script. ntpq
Ntp status program. ntpdate [host] (deprecated)
> ntpd -g
After the main NTP servers has been configured, point other clients in network to them.
Timezones
Files
/etc/localtime - local time zone information
/etc/timezone - sometimes is also called this
/usr/share/zoneinfo - timezone files
Cheatsheets






