On Sun, 13 Jun 2021 at 06:51, Patrick Dupre <pdu...@gmx.com> 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



-- 
George N. White III
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to