I am having a large number of output files produced by repeated runs of a test suite and would like to see, approximately, how different they are. Ideally they should all be identical (indicating a fully reproducible test) or nearly identical (e.g. if timestamps are present). So I am looking for a script like:show-greatest-diff /path/to/files/*.outSo, if 100 *.out files are present the script should diff them all against each other and perhaps produce the maximum number of lines / characters that any pair amongst them differ (and maybe identify the most different pair) or just print the diff output of the pair that differs the most or produce some other heuristically helpful output.The solution suggested here is not appropriate for my use case due to the large number of files.
heuristically find how different a set of files are
shell;ubuntu;diff
How about something likemostdifs=-1;for f1 in path/to/files/*.out; do     for f2 in path/to/files/*.out; do         difs=$(diff $f1 $f2 | wc -l);         [ $difs -gt $mostdifs ] && mostdifs=$difs && mostdif=$f1 : $f2;    done done echo $mostdifThis is very simplistic, you could improve it by testing whether $f1 is the same file as $f2 and by various other tweaks but if we're talking about a few hundred text files, it will run in seconds so the extra complexity might not be worth it.The idea is to run diff on each pair of files and look at the number of lines returned. If that number is greater than the current greatest, save the file names.