You could also do it in a compact command line manner
To find only the duplicate enteries perl -ne 'print if $h{$_}++' filename To find unique data perl -ne 'print unless $h{$_}++' filename Of course , you could simply do cat filename | uniq at the shell prompt for the second case. HTH, chimni