if you want to search all files (file size smaller than 256MBytes) for a match in it’s sha1 checksum:

#!/bin/bash
find / -type f -size -256M | while read fname; do
	checksum=$(sha1sum "$fname");
	CHECKSUM=${checksum^^};
	echo $CHECKSUM;
done

write it to a file and mark it as a runnable script:

chmod +x /scripts/search_file_by_sha1sum.sh

testrun:

/scripts/search_file_by_sha1sum.sh

… this computes the sha1 of ALL FILES on your system and external harddisks…

and when you run it like this:

/scripts/search_file_by_sha1sum.sh| grep AEE44EBB1B48FA98B41822B7922E2018A35A783A
AEE44EBB1B48FA98B41822B7922E2018A35A783A /BOOT/SYMVERS-3.10.0-693.11.6.EL7.X86_64.GZ

it should colorful show you a match…. and then continue searching.

admin