On Sun, 13 Jun 2021 at 06:51, Patrick Dupre <pdupre@xxxxxxx> wrote:
Hello,
I wish to remove lines which appear twice in a file, actually
only when they appear more than one time.
How can I do so?
Do you need to keep the lines in the same order? If not, then
"sort -u" should work. You may also want to use "uniq".
% cat nonuniq.txt
dd
aa
bb
cc
bb
aa
% sort -u nonuniq.txt
aa
bb
cc
dd
dd
aa
bb
cc
bb
aa
% sort -u nonuniq.txt
aa
bb
cc
dd
George N. White III
_______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure