Menu

19 August 2009

Find Duplicate Files in Linux

$ find . -name *.java -exec basename {} \; | sort -n | uniq -cd | sort -nr ;

This will list all duplicate Java files.

$ find . -name *.txt -exec basename {} \; | sort -n | uniq -cd | sort -nr ;

This will list all duplicate Txt files.


Try This --

# find . -name *.js -exec basename {} \; | sort -n | uniq -d | while read Filename ; do echo "=======================" $Filename "================" ; find . -name $Filename -exec ls -l {} \; ; done;

Post a Comment