Skip to content

Instantly share code, notes, and snippets.

@markuskreitzer
Created December 9, 2024 22:05
Show Gist options
  • Save markuskreitzer/60c3d5a376dc0748ed2b1517a19c9c77 to your computer and use it in GitHub Desktop.
Save markuskreitzer/60c3d5a376dc0748ed2b1517a19c9c77 to your computer and use it in GitHub Desktop.
Sync Time on Linux

Sync Time on Linux

Some quirky systems out there doesn't have the usual utilities to sync time. If they have access to the internet, here's a quick way. I found this somewhere on the internet, but don't remember where.

DATE=$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)
sudo date -s "${DATE}Z"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment