A collection of useful scripts designed to efficiently manipulate large quantities of files.
This script identifies and removes duplicate files based on their SHA-256 hashes.
- Duplicate Detection: By default, the script scans a specified directory and displays which files are considered duplicates without removing them.
- Safe Removal: Use the
--goflag to permanently delete duplicate files after reviewing the list.
./remove_duplicates.sh <directory> [--go]<directory>: The path to the directory that will be scanned for duplicate files.--go: Optional flag that triggers the script to actually remove the identified duplicate files.-h: Displays a help message with usage instructions.
To scan for duplicates without removing them:
./remove_duplicates.sh /path/to/your/folderTo scan and remove duplicates:
./remove_duplicates.sh /path/to/your/folder --go- Caution: Ensure you review the output before using the
--goflag, as it will permanently delete files.
To run the tests for remove_duplicates, ensure you have pytest installed:
pip install pytestRun the tests with:
pytest tests