Skip to content

Instantly share code, notes, and snippets.

@jnovack
Created April 22, 2019 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnovack/61d08890137fb28e0cabf203505e670e to your computer and use it in GitHub Desktop.
Save jnovack/61d08890137fb28e0cabf203505e670e to your computer and use it in GitHub Desktop.
Awk - Print ONLY Match
cat files | awk '{for(i=1;i<=NF;i++){ tmp=match($i, /PATTERN/); if(tmp){print $i}} }' | sort | uniq -c | sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment