I'm trying to use uniq to find all non-unique lines in a file. By non-unique, I mean any line that I have already seen on the previous line. I thought that the "-D" option would do this:
-D print all duplicate lines
But instead of just printing the duplicate lines, it prints *all* the lines when there is more than one. I want to only print the second and subsequent copies of a line.
How can I do this?
Asked by Michael
(544 rep)
Nov 7, 2019, 10:18 PM
Last activity: Apr 8, 2025, 06:45 PM
Last activity: Apr 8, 2025, 06:45 PM