Journal emj's Journal: Making sha1 hashes for backup and integrity checking..
This will link one hash to one file, so if two files have the same hash the latter will overwrite the formers name.
Thanks to Perl oneliners and lost+found recovery for inspiration.
find -type f -print0 |
xargs -0 openssl sha1 |
perl -ne '
sub parsesha1{
$sha1=substr($_,-41,40);
$filename=substr($_,5,-44)
}
&parsesha1;
$file_hashes{$sha1}=$filename;
END{
foreach $hash (keys %file_hashes){
print "$hash:",$file_hashes{$hash},"\n"}
} '
Making sha1 hashes for backup and integrity checking.. More Login
Making sha1 hashes for backup and integrity checking..
Slashdot Top Deals