Skip to content

Instantly share code, notes, and snippets.

@ufuk
Created July 10, 2017 09:08
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 ufuk/f99e79313a0c8b473bca8fad32799f3c to your computer and use it in GitHub Desktop.
Save ufuk/f99e79313a0c8b473bca8fad32799f3c to your computer and use it in GitHub Desktop.
Concatenate files, grep lines, split by a delimeter using awk and print some columns as sorted and uniqe. May be useful for parsing logs.
cat file1 file2 ... fileN | grep "<SEARCHING TEXT>" | awk -F'<DELIMETER>' '{print $1 $2 ... $n;}' | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment