This preserves line order:
$ cat file.txt
dd
aa
bb
cc
bb
aa
$ awk '!line[$0]++' file.txt
dd
aa
bb
cc
--
Best Regards, Oğuz
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedor
On Sun, 13 Jun 2021 at 06:51, Patrick Dupre 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
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?
Thanks
===
Patrick DUPRÉ | | email: pdu...@gmx.com
Laboratoire