duplicate rows in a file

hi all

can anyone please let me know if there is a way to find out duplicate rows in a file. i have a file that has hundreds of numbers(all in next row).
i want to find out the numbers that are repeted in the file.
eg.
123434
534
5575
4746767
347624
5575

i want 5575

please help

HI,

sort filename | uniq -c | awk ' $1 > 1 { print $2}'

Thanks
Penchal

1 Like

One solution using awk.

awk 'arr[$1]++' data.file

thanks

that worked

cheers