Google-drive – Google Drive weirdly allow files/folder with the same name in the same location. How to fix it

google-drive

Google Drive weirdly allows files/folder with the same name in the same location.
This leads to having a lot of duplicate files/folders in my drive that I don't know any way to merge.
How to merge them and prevent this in future?

OneDrive does not allow duplicate file name that totally makes sense. Any way to make GDrvie function as expected?

The problem is also more frankly express here by another user https://freefilesync.org/forum/viewtopic.php?t=6483&sid=d16c0cee85bac283e6ed7160e21f6d32

Best Answer

As marikamitsos notes, it's intended behavior. A de-duplication app or script should be able to deal with the problem. There are many, but it depends on your OS which can run. I haven't found a really good one. To me that means one that can understand and make use of hard links, and is quite customizable. So all I've done is write some shell commands I haven't worked into a script yet to replace a duplicate file with a hard link to the same file. Also, as you have different versions, the problem is tougher, and situation and document-dependent. Word is good at merging documents it can handle. Maybe you want the older files deleted; maybe something else. I run something like this crap to find dupes in Downloads folders from people who unintentionally download the same thing repeatedly:

cat crc32s.txt >> crc32s.old.txt ; time crc32 * > crc32s.txt ; \
cat crc32s.txt  crc32s.old.txt | \
sort --key=1 | uniq -u | \
sort --key=2 | uniq -d -f 1 | tee crc32s.changed.txt 

There should be FAR better solutions out there... (and there are many alternatives to crc32, such as md5 and sha.)

It sure is weird! I can't think of an OS that does. NOT DOS, Win32, HFS,APFS(MacOS), NFS, ext3, or AFS, as I recall. MacOS has time machine, which allows versioning, as does Google Docs, etc. But "two files with the same name in the same folder"? (No, not a different extension? Nope.) Sure is odd. And, if the two files are identical, it still stores them separately, using double the space! According to the UI anyway!

I have "two files with the same name in the same folder in Google Drive" and was wondering if that's a feature or a bug too.

I googled that phrase and the only thing that turned up was a deleted superuser.com post but now this Q&A will turn up.

I'm also curious what happens if I have my google drive sync'd (w/ "Backup and Sync") to my local drive, where this can't happen Like the OP, I copied a file into a folder that already contained the file and now there are two copies. I've seen this a few times.