DuplicateFilesAndFolders is an open-source tool to find and (optionally) delete duplicate files and folders, written in Java.
It identifies duplicate files and folders by calculating and comparing file hashes (something that Git does, too). For easy operation, DuplicateFilesAndFolders provides an Eclipse SWT/JFace-based graphical user interface.
I developed DuplicateFilesAndFolders on Windows 7 (64-bit), but it should be easy to port it to other platforms.
Enjoy — Lorenz
- You are running a Windows (64-bit) system.
- You have installed Java JDK (or SDK) 7 (64-bit) or higher on your system.
-
Download DuplicateFilesAndFolders.jar to a folder.
-
Open a command prompt in that folder and enter
java -jar DuplicateFilesAndFolders.jar
-
This runs DuplicateFilesAndFolders.
- Enter or choose a folder to scan.
- Click Find Duplicates to scan the folder.
- Inspect the list of duplicate folders.
- Inspect the list of duplicate files.
- Duplicate items are grouped by background color.
- Select a duplicate item for deletion.
- Child items of selected items are automatically selected and dimmed.
- (Optional) Choose one of the following:
- Select all items.
- Select all but one item of each duplicate item.
- Deselect all items for deletion.
- Invert your selection.
- (Optional) Open a folder (or the containing folder of a file) with the context menu.
- Open the Confirm Deleting Items dialog.
- Confirm to delete the selected items.
- Delete the selected items.
Caution
Like with all software able to delete files, you are using DuplicateFilesAndFolders at your own risk.
- You are running a Windows (64-bit) system.
- You have installed Java SDK 7 (64-bit) or higher on your system (I used Java SDK 8 (64-bit)).
- You have installed an Eclipse IDE on your system (I used Eclipse 4.5.0 “Mars” (64-bit)).
- Download this project’s ZIP file from GitHub.
- Unzip it to a temporary folder.
- Import the
DuplicateFilesAndFolders
project from the temporary folder into your Eclipse IDE as an import source General > Existing Projects into Workspace. - In the Project Explorer view, right-click DuplicateFilesAndFolders and select Run As > Java Application.
- The DuplicateFilesAndFolders application starts.
- If you like to create a
DuplicateFilesAndFolders.jar
JAR file, continue: - Close the DuplicateFilesAndFolders application.
- In the Project Explorer view, right-click DuplicateFileAndFolders and select Export....
- Select Java > Runnable JAR file.
- Click Next >.
- Under Launch Configuration, select DuplicateFilesAndFolders - DuplicateFilesAndFolders.
- Under Export destination, enter the full pathname of the exported application, for example
C:\TEMP\DuplicateFilesAndFolders.jar
. - Select the radio button Package required libraries into generated JAR.
- Click Finish.
- Use a file explorer to find the exported JAR file
DuplicateFilesAndFolders.jar
.
To port DuplicateFilesAndFolders to another platform, apply the following changes:
- Adjust in method
Utils.getInitialFolderToScanPath()
the string that is shown as the initial folder path. - Adjust in method
Utils.getExplorerCommandLine()
the command-line string that launches the file explorer, opening a specific folder. - Replace the SWT library
org.eclipse.swt.win32.win32.x86_64_XXX.jar
with the SWT library specific to your platform. (The library name follows the patternorg.eclipse.swt.<platform>_<version>.v<timestamp>.jar
.)
This project is available under the MIT license.