Last active
December 18, 2015 15:49
-
-
Save DanielleSucher/5806898 to your computer and use it in GitHub Desktop.
One-liners
This file contains hidden or 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
Replace all instances of old_string with new_string recursively within the current directory and its sub-directories: | |
grep -rl old_string * | xargs sed -i '' 's/old_string/new_string/g' | |
Sum all numbers in your file (assuming that the numbers are the first column, one per line): | |
awk '{s+=$1} END {print s}' $filename | |
List all ports a process is using: | |
lsof -a -pPID -i4 (or -i6) | |
List what process is using a port: | |
lsof -i :PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment