Created
November 17, 2012 15:10
-
-
Save aceberg/4096653 to your computer and use it in GitHub Desktop.
remove files with equal size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "" > zduplog.txt | |
a='zduplog.txt' | |
size_a=`stat -c %s $a` | |
for b in `ls` | |
do | |
size_b=`stat -c %s $b` | |
if [ $size_a -eq $size_b ]; | |
then | |
echo 'Duplicate file: '$a' size_a = '$size_a' size_b = '$size_b >> zduplog.txt | |
rm $a | |
fi | |
a=$b | |
size_a=`stat -c %s $a` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment