3 ms·
The output format of md5sum and other checksum programs is well-defined, which lets you use the -c switch to verify. This is the format you see in checksum file
by coldpie 10y ago
The output format of md5sum and other checksum programs is well-defined, which lets you use the -c switch to verify. This is the format you see in checksum files when downloading source tarballs, distro ISOs, packages, etc.
$ echo hello > fileone
$ echo there > filetwo
$ md5sum fileone filetwo | tee /tmp/ck
b1946ac92492d2347c6235b4d2611184 fileone
c4ff45bb1fab99f9164b7fec14b2292a filetwo
$ md5sum -c /tmp/ck
fileone: OK
filetwo: OK
$ echo oops > filetwo
$ md5sum -c /tmp/ck
fileone: OK
filetwo: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
Edit: Of course, nothing wrong with using stdin:
$ wget -q -O- https://shells.aachen.ccc.de/~spq/md5.gif | md5sum
f5ca4f935d44b85c431a8bf788c0eaca -
- nicky0 10y agoWhat's the -O- for?
- coldpie 10y agoOutput to stdout instead of a file on disk. See: https://linux.die.net/man/1/wget https://linux.die.net/man/1/wget
- cobbzilla 10y ago-O is the file to write output. plain - means stdout. so, run wget and print results to stdout. tip: add -S to include response http headers.
- deleted 10y ago[deleted]