Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quora thread snippets
cat a b | sort | uniq > c # c is a union b
cat a b | sort | uniq -d > c # c is a intersect b
cat a b b | sort | uniq -u > c # c is set difference a - b
find . -type f -ls
find . -name \*.py | xargs grep some_function
cat hosts | xargs -I{} ssh root@{} hostname
cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn
ps aux | grep mypattern | awk '{ print $2}' | xargs kill
pkill -f mypattern
# Top ten running processes sorted by memory usage
ps aux | sort -nk +4 | tail
diff -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.