dedup - remove duplicate files


dedup [--batch] [--debug] [--link] [--no|-n] [--stdin] [--stdin0] [--verbose|-v] file file...


dedup scans all the given file arguments and removes any duplicates. Files of 0 length are silently skipped. When choosing which file to retain older files are preferred over newer ones, and files given earlier on the command line are preferred over those given later.



Don't complain if fewer than 2 files are given or if fewer than 2 remain after screening out non-files and the like.


Turn debugging on.


Rather than removing duplicates, (hard) link them together so they share storage.


Show the usage message and die.

--no, -n

Print what would have been done, but don't actually do anything.


Read stdin for a list of files and add these to those given on the command line.


Same, but the files on stdin are separated by null characters rather than newlines.

--verbose, -v

Be more verbose. A single --verbose causes dedup to display which files are being removed. Adding another causes it to additionally output the names of files which are the same length but which differ.


Show the version number and exit.


dedup doesn't try to deal with files which have multiple links, it just ignores them. It doesn't even allow symlinks.


The code is licensed under the GNU GPL. Check for updated versions.


Roderick Schertler <>