The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
How to remove duplicates without sorting
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
How to remove duplicates without sorting
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
01-17-2008
matrixmadhan
Technorati Master
Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
Quote:
sort File1 | uniq > File2
You don't need a sort and uniq for removing duplicates
same can be accomplished by "-u" option
Code:
sort -u filename > new.filename
matrixmadhan
View Public Profile
Find all posts by matrixmadhan
Find matrixmadhan's past nominations received
Find matrixmadhan's present nominations given