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
Then, we use file.md5sum
to check the integrity of file.txt
.
md5sum -c file.md5sum
We tamper with file.txt
…
sed -i 's/two/TWO/' file.txt
… and check its integrity again:
md5sum -c file.md5sum