Skip to content

Instantly share code, notes, and snippets.

@aceberg
Created November 17, 2012 15:10
Show Gist options
  • Save aceberg/4096653 to your computer and use it in GitHub Desktop.
Save aceberg/4096653 to your computer and use it in GitHub Desktop.
remove files with equal size
#!/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