====== AWK - Delete non-consecutive duplicate lines ====== awk '!a[$0]++' contents.txt ---- Example aaaaa bbbbb ccccc ccccc ddddd ddddd eeeee bbbbb returns: aaaaa bbbbb ccccc ddddd ddddd eeeee
awk '!a[$0]++' contents.txt
aaaaa bbbbb ccccc ddddd ddddd eeeee