Last active
May 16, 2020 01:57
-
-
Save lfoppiano/2bc14c96affc721f33234edb49cb5cfe to your computer and use it in GitHub Desktop.
Find duplicated files
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
# Just return the sha of the duplicated files | |
sha1sum * | gsort | gawk '{a[$1]++}END{for(i in a){if(a[i]-1)print i, a[i]}}' | |
# Return the last file name for each duplicated files | |
sha1sum * | gsort | gawk '{a[$1]++; b[$1]=$2}END{for(i in a){if(a[i]-1)print i, b[i]}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment