What command can delete duplicates in a directory tree?

0

When I migrated a user from Google Drive to OneDrive using Multcloud, there were created duplicates of a lot of directories and files. Not all, but a big lot. We're talking thousands of directories, ten thousands of files.

Duplicated files are named "* 1.*", directories are * 1" and the directories originally (badly) named for eksample "* m.m", are named "* m 1.m". Lots of files and directories originally contain " 1" earlier in the name and some even at the end.

I need a command that recursively finds and deletes those duplicates. Or can find them in windows explorer search?

If some files are left behind it wouldn't be a problem. I just need to get rid of the multiple thousands.

Thanks in advance

klugg

Posted 2017-12-15T00:51:49.267

Reputation: 1

Is there any reason you are looking for a command specifically and not using an application that does it? I would recommend you to try a program that does it, something like http://www.alldup.de/en_download_alldup.php

– Yisroel Tech – 2017-12-15T04:25:32.327

Answers

1

You could use a third-party app such as Duplicate cleaner or CCleaner to delete duplicate files.

Or write a PowerShell script and call it from a batch file, look at this link below.

find and delete duplicate files with just Powershell

https://n3wjack.net/2015/04/06/find-and-delete-duplicate-files-with-just-powershell/

Origami

Posted 2017-12-15T00:51:49.267

Reputation: 1 309