LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Remove duplicate lines from a file?

[ILUG] Remove duplicate lines from a file?

Lars Hecking lhecking at nmrc.ie
Fri Jun 30 15:18:18 IST 2000


Conor Daly writes:
> Quick! Quick!  Before everyone stops reading for the weekend!  :-)
> 
> Anyone know of a way to remove duplicate lines from a file using something
> like grep, sed or perl?  I want something l can use in a pipe preferably.
> The duplicates are distributed randomly through the file and I don't want to
> sort if I can avoid it.  Something like
> 
> cat file_containing_masses_of_duplicate_lines_distributed_at_random |
> [duplicate_filter] > file_containg_unique_lines

 Hehehe ... beware of cats :)

> or
> 
> [duplicate_filter]
> file_containing_masses_of_duplicate_lines_distributed_at_random
> file_containg_unique_lines
> 
> Any ideas?
 
 man uniq. Next question.






More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell