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.

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin