MD5SUM & HASHES
################
Check hashes – the fingerprint of the file – each file has thier own signature.
sha1sum (or shasum) works as well and has more bits
We use hashes to insure the file is still legit.
If you know the hash of some file should be abcd1234 and when you download it changes to 14234sdd, then might as well redownload it
md5sum only has so many possibilities, and sha1sum and other algos have more possibilities (thus more bits and characters in the answer).. The more bits/characters the less likely you are to have a collision.
Whats a collision? ITs when you have 2 different files or things that return the same fingerprint/hash, meaning the hash algo is broken (or not as good) or needs to have more bits.
IN WINDOWS!!!
#############
BEST TOOL:
It puts it in the explorer, meaning right click on a file and hit properties and you will have a new tab. This works on directories too
IN LINUX!!!
############
TO CHECK HASH OF EVERTHING
==========================
cd /dir
md5sum *
TO CHECK HASH OF A SELECTION OF THINGS
======================================
Select things with find tool
For example:
I want every file who has a folder with the name Jeremy and Chris in it
find -type f -iwholename “*Jeremy*” -or -iwholename “*chris*”
Now run md5sum thru it, a couple of ways:
With -exec:
find -type f -iwholename “*Jeremy*” -or -iwholename “*chris*” -exec md5sum {} \;
With xargs:
find -type f -iwholename “*Jeremy*” -or -iwholename “*chris*” -print0 | xargs -0 md5sum
If you dont use -print0 and -0 and your files have spaces this will not work

Leave a Reply

Your email address will not be published. Required fields are marked *