http://qs1969.pair.com?node_id=61600


in reply to Re: Detecting duplicate entries
in thread Detecting duplicate entries

That'd be a useless use of both cat and uniq.
sort -u file.txt

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Detecting duplicate entries
by turnstep (Parson) on Mar 01, 2001 at 22:13 UTC
    And to do it all at once as an inline edit:
    sort -uo file.txt file.txt

    Update: For those that asked, sort -u file.txt > file.txt
    will completely and happily change file.txt into a zero byte file, hence the need for the "o" flag.