Home
Parent Directory
multiple
The program,
multiple,
a file-comparison-tool,
is a tool I wrote many years ago.
I think it was around in the middle/end of the 90's. (Don't know exactly.)
Later I picked it up again and rewrote it,
making the code cleaner and more efficient.
Again later I picked it up again and made me fun
out of it to do it in a Literate Programming way,
but doing this without any literate programming tools:
- You can compile the C-code with your compiler.
- You can create the (detailed) documentation from the C-code with troff/groff.
There is no need for additional tools, because the (t|g)roff-code
is embedded inside the C-Comments. :)
- With groff you can do the following for creating the detailed docs: $ groff -p multiple.c > multiple.ps
- (But there also is a classical manpage.)
What it does
It compares files and detects files with the same contents.
Invoked without parameters, if you have n equalfiles,
it shows you (n-1) of them, because it assumes, that theese
all are superflous (one is enough, you don't need extra copies).
It also can delete them immediately, if the -d switch is active.
If you want to compare email- or newsgroup-articles,
then it would make sense to only compare the bodies
of the mails / postings and ignore the headers.
You can invoke multiple with the switch -i (i: ignore headers)
to acchieve this goal.
When you delete(-d switch),
at least one true regular file will be left over.
So, if multiple has a true regualar file and a
symbolic link on it, it will remove the symbolic,
not the true regular file.
All CLI-options/switches of version 0.4 and 0.5.2:
usage: find | multiple [-a] [-i] [-v] [-h] [-0] [-d]
- option a: print ALL filenames instead of superflous.
- option i: compare after first empty line (IGNORE headers).
- option v: print version.
- option h: print this help message.
- option 0: don't ignore files with size == 0
- option d: delete superflous files and print name of the non-deleted files.
Attention! This option ignores read-only-permissions of your files!
!!! multiple Operation Warning:
!!! ===================================
!!!
!!! *** NEVER use option "-follow" of the find program. ***
!!!
!!! Check if it's enabled via an alias, when using
!!! find to feed multiple, because this might kill all your files,
!!! if you delete the superflous ones.
!!!
!!! -----------------------------------------------------------
AUR-Page (Arch-Linux)
Arch Linux AUR-Page for multiple
Different Variant of the Program
There is a newer version I wrote in the language
Ocaml.
It uses md5-hashes instead of byte-by-byte comparison.
Also has other advantages on comparison of big files.
It's not online so far, but I may put it online later.
The advantage here: faster comparison, especially on large files (e.g. binaries).
last change:
So 6. Jun 17:57:04 CEST 2021
Mail: oliver _at_ first.in-berlin.de