La perfection est atteinte non quand il ne reste rien à ajouter, mais quand il ne reste rien à enlever.
Perfection is not reached when there is nothing more to add, but when there is nothing more to take away.
The samefile
utility finds files with identical
contents, independent of file name. This program is for you if you
are notoriously low on disk space, keep exceeding your disk quota,
pay for your storage by the megabyte, run any kind of file server,
need to reduce the size of your backups, or just want to get a
feeling for how much redundant files are there on your system. This
program may be the reason for not buying a bigger disk or another
set of backup media. It is pretty fast and can even check file
systems with hundreds of thousands of files.
As one satisfied user put it: "Among the many uses of
samefile
is figuring out just how many copies of your
digital camera images you have in various places on your hard
disk(s). Just cleared up about a gig of space on my laptop drive -
thanks!"
Typical usage would be find / | samefile
. The
result is a list of file name pairs which you can use for your
storage spring-cleaning. It can also tell you how many kilobytes are
wasted in duplicate files. Try it! You will be surprised how much
wasted disk space you uncover.
The current Version is samefile-2.14.tar.gz (Size: 64K)
.
See the Downloads Page for a list of releases,
release dates, and user visible changes between releases.
The reference documentation is the Manual Page. It is also available as a printer-ready PostScript® (Size: 20K) file.
The installation of samefile
is quite simple.
Prerequisite is a Unix-like system with the usual toolchain for
compiling C sources obtained from the 'net.
samefile-2.14.tar.gz (Size:
64K)
, or possibly usingwget http://www.schweikhardt.net/samefile-2.14.tar.gz
gunzip samefile-2.14.tar.gz
tar xf samefile-2.14.tar
cd samefile-2.14
./configure
make
make test
make install
make clean
For more details see also the distribution's INSTALL
file.
For some operating systems the installation is even easier:
sysutils/samefile
port withcd /usr/ports/sysutils/samefile; make install
samefile
RPM
packages.pkgsrc
format), as well as some other popular vendors. I have only limited
access to other operating systems, so if you can contribute a
package for your favorite system, please contact me.The samefile
utility was written by Jens
Schweikhardt, schweikh@schweikhardt.net.
Please use this address for your bug report (preferably with a
patch), suggestion, feature request or comment. For other
contributions to the net.community see the author's home page.
Did you know that an obfuscated version of samefile
was a winning entry
in the 1998 International
Obfuscated C Code Contest (IOCCC)?
The distribution includes a regression test suite which tests a
number of features and proper operation of the compiled binary. It
is invoked via make test
(see Installation above). The author recommends
to run the test before installation or if you modify the source
code.
The web pages for samefile
conform to the W3
Consortium's Recommendations. They validate as correct XHTML and
correct CSS. You are encouraged to verify this claim by clicking the
respective icons in the menu on the left.