Skip to content

Instantly share code, notes, and snippets.

@flaccid
Created November 29, 2017 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flaccid/692ba7c71996f7dd7cce82a8a7ab30ab to your computer and use it in GitHub Desktop.
Save flaccid/692ba7c71996f7dd7cce82a8a7ab30ab to your computer and use it in GitHub Desktop.
show duplicates in gdrive
drive md5sum -depth 10000 | sort -k 1 > /tmp/filelist.txt
awk 'BEGIN { FS=" " } { c[$1]++; l[$1,c[$1]]=$0 } END { for (i in c) { if (c[i] > 1) for (j = 1; j <= c[i]; j++) print l[i,j] } }' /tmp/filelist.txt > /tmp/dupes.txt
cat /tmp/dupes.txt
echo "number of duplicates: $(wc -l /tmp/dupes.txt)"
@flaccid
Copy link
Author

flaccid commented Nov 29, 2017

Uses go get -u github.com/odeke-em/drive/cmd/drive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment