commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Shorter, easier to remember version of cmd#7636
NTP is better, but there are situations where it can't be used. In those cases, you can do this to sync the local time to a server.
There is 1 alternative - vote for the best!
using -u is better for standardizing date output and timezones, for servers in different timezones.
Set Remote Server Date using Local Server Time (push)
If you are stuck behind a firewall and want to synchronize time with another server but you do not want to port forward NTP (which uses UDP) then this command is handy. It gets the time from a server and sets the local time. It is not that accurate but I can live with a second or so drift.
Neat idea! This variation works on FreeBSD.
If you can do better, submit your command here.
You must be signed in to comment.