Skip to content

Instantly share code, notes, and snippets.

@niepiekm
Last active January 19, 2018 09:57
Show Gist options
  • Save niepiekm/a71d9f6aa948c406cc851c236b89168d to your computer and use it in GitHub Desktop.
Save niepiekm/a71d9f6aa948c406cc851c236b89168d to your computer and use it in GitHub Desktop.
Linux bash examples

Print sorted and counted occurances of words in a file

$ cat commands | awk -F” ” ‘{print $4}’ | sort | uniq -c | sort -n

Print sorted and counted occurance of a 'word' in a file

cat some_commands | grep HINCRBY | awk ‘{print $5}’ | sort | uniq -c | sort -n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment