Skip to content

Instantly share code, notes, and snippets.

@arodbits
Created May 18, 2018 19:10
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 arodbits/fe90d5a71a0c63d0022416526121196d to your computer and use it in GitHub Desktop.
Save arodbits/fe90d5a71a0c63d0022416526121196d to your computer and use it in GitHub Desktop.
remove duplicates with awk
$ awk '!x[$0]++'
#which is a shorthand for:
$ awk ' !seen[$0] { print $0 } 1 { seen[$0]++ }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment