Login
From:
learnbyexample
(Uncensored)
subscribe
CLI tip 26: removing duplicate lines with GNU awk
https://learnbyexample.github.io/tips/cli-tip-26/
links
backlinks
Roast topics
Find topics
Find it!
awk '!a[$0]++' is one of the most famous Awk one-liners. It eliminates line based duplicates while retaining input order. The following example shows it in action along with an illustration of how the logic works.