Last active
April 18, 2019 17:23
-
-
Save justinmklam/3522741033a1ac61c3fc50b31884137d to your computer and use it in GitHub Desktop.
Useful snippets in bash.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find text in files in current directory | |
# -i - ignore text case | |
# -r - recursively search files in subdirectories. | |
# -n is line number, and | |
# -l - show file names instead of file contents portions. | |
grep -irn "search string" . | |
# Update system time from google (used to be able to do `sudo ntpdate time.nist.gov`, but ntpdate is considered deprecated as of 16.04 | |
# Caveat: Might be 8-50 ms behind | |
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d" " -f5-8)Z" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment