This project helps users find duplicate files in a specified directory and its subdirectories. It scans files based on their SHA-256 hash and provides a detailed report of duplicate files. The tool also allows users to ignore specific directories from the scan process.
- Search for duplicate files by hashing the content of the files.
- Option to ignore specific directories during the scan.
- Save the results of the scan in a JSON file.
- Display duplicate file paths in the console.
- Python 3.x
tqdmlibrary for progress bar (can be installed viapip)
git clone https://github.com/MRAmin0/Duplicate-File-Scanner.git
cd Duplicate-File-ScannerInstall dependencies This project requires the tqdm package for showing a progress bar during the scan. Install the required dependencies using pip:
pip install -r requirements.txtOr you can simply install tqdm manually:
pip install tqdm- Run the script by executing the following command:
python duplicate_finder.py-
Enter the target directory you want to scan when prompted.
-
Choose whether to ignore specific directories:
-
If you don't want to scan certain directories, enter their paths when prompted (one per line). Type done when you're finished entering directories to ignore.
-
If you don't need to ignore any directories, simply respond with no.
-
Wait for the scan to finish. The script will calculate the hash of each file and check for duplicates.
-
View the results:
-
The results will be displayed in the console.
-
A JSON file (duplicates.json) will be created, containing the list of duplicate files.
-
Console Output: Duplicate files are listed in the console along with a separator line for each hash group.
-
JSON Output: A file named duplicates.json will be generated, containing a JSON object where each key is a file hash and each value is a list of file paths that share that hash.
-
Example of duplicates.json:
{
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": [
"/path/to/duplicate/file1.txt",
"/path/to/duplicate/file2.txt"
],
"7a5a28c3798ed929fd9cc9adcf517771bcf26a4014899e6b8a5777f70bc1cc71": [
"/path/to/duplicate/file3.jpg"
]
}This project is licensed under the MIT License - see the MIT License for details.