I'm looking for a way to remove one specific line from a bunch of files, but only if it occurs more than once in that file. Other lines should be kept, even if they are duplicates.
For example, a file like this where I would like to remove the duplicates of
AAA BBB AAA BBB CCC
AAA BBB BBB CCC
I guess I should use
sed but I have no idea how to write the command.