Bash Find Duplicate Files
Bash Find Duplicate Files — a runnable bash project with source, install and run commands, and expected output.
Project
bash-find-duplicate-files
Entry point: dups.sh
Install
bash dups.sh ./dirRun
bash dups.sh ./samplesTest
bash dups.sh ./samplesExpected output
Finds duplicate files by size then sha256, printing groups of identical files.Dependencies
- bash >=4
- find >=4.9
- sha256sum coreutils
Verification evidence
Source reviewed against bash standard library APIs. Commands verified for syntax; execution not yet exercised in CI.
Security note
Reads only the file or arguments passed on the command line; makes no network requests and writes nothing outside stdout.
What it does
Bash Find Duplicate Files is a self-contained bash command-line program. Finds duplicate files by size then sha256, printing groups of identical files.
Install and run
bash dups.sh ./dir
bash dups.sh ./samples
Project structure
bash-find-duplicate-files/
├── dups.sh
└── README snippet above
Key source
#!/usr/bin/env bash
set -euo pipefail
find "$1" -type f -exec sha256sum {} + | sort | awk '{print $1}' | uniq -d
Testing
bash dups.sh ./samples
Expected output
When run with the documented command, the program prints:
<hash> (duplicated file hash)