aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-08-10 15:24:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-08-10 15:27:46 +1200
commit7ab10c6bbbeeebb9c1fae832e9466b2f1df2f7a1 (patch)
tree197fdb9618eb4471937ac52cd4f0b7d0cf464a05
parentMerge obvious two blocks (diff)
downloadcheckem-7ab10c6bbbeeebb9c1fae832e9466b2f1df2f7a1.tar.gz
checkem-7ab10c6bbbeeebb9c1fae832e9466b2f1df2f7a1.zip
Explain support for searching for duped files
We get this for free from File::Find
-rw-r--r--README.markdown13
-rwxr-xr-xcheckem2
2 files changed, 14 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown
index 1e7c8bc..a44e70d 100644
--- a/README.markdown
+++ b/README.markdown
@@ -27,6 +27,19 @@ There's a (presently) very basic test suite:
Q&A
---
+### Can I compare sets of files rather than sets of directories?
+
+Sure. This uses `File::Find` under the hood, which like classic UNIX `find(1)`
+will still apply tests and actions to its initial arguments even if they're not
+directories. This means you could do something like this to just look for
+duplicate `.iso` files, provided you don't have more than `ARG_MAX`:
+
+ $ checkem ~/media/*.iso
+
+Or even this, for a `find(1)` that supports the `+` terminator (POSIX):
+
+ $ find ~/media -type f -name \*.iso -exec checkem {} +
+
### Why is this faster than just hashing every file?
It checks the size of each file first, and only ends up hashing them if they're
diff --git a/checkem b/checkem
index c105c3e..f64044a 100755
--- a/checkem
+++ b/checkem
@@ -29,7 +29,7 @@ our $VERSION = 2.9;
# If no arguments, work with the current working directory
if ( !@ARGV ) {
- printf {*STDERR} "%s\n", 'Need at least one dir to search';
+ printf {*STDERR} "%s\n", 'Need at least one file or directory';
exit 2;
}