Search notes:

Shell command: md5sum

md5sum computes an MD5 message digest or checks a file against the previously created message digest.
First, we create a file (file.txt) and compute its MD5 digest and redirect it into file.md5sum.
echo "one: foo"    >  file.txt
echo "two: bar"   >>  file.txt
echo "three: baz" >>  file.txt

md5sum file.txt > file.md5sum
Github repository shell-commands, path: /md5sum/create-md5-sum
Then, we use file.md5sum to check the integrity of file.txt.
md5sum -c file.md5sum
Github repository shell-commands, path: /md5sum/check-sum
We tamper with file.txt
sed -i 's/two/TWO/' file.txt
Github repository shell-commands, path: /md5sum/tamper-with-file
… and check its integrity again:
md5sum -c file.md5sum
Github repository shell-commands, path: /md5sum/check-sum

See also

Shell commands

Index