Sample Header Ad - 728x90

How to show the incorrect checksum when the computed checksum did not match

3 votes
3 answers
8163 views
Suppose I try to verify the checksum of a file using:
echo '760382d5e8cdc5d0d079e8f754bce1136fbe1473be24bb885669b0e38fc56aa3  emacs-26.1.tar.gz' | \
  sha256sum --check
If the file is corrupt and the checksum is wrong, sha256sum will show this message:
emacs-26.1.tar.gz: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match
I would like to know the actual checksum of the file (i.e. incorrect checksum that caused this error message). What are my options? If possible, I do not want to compute the checksum twice (once to see the "FAILED" message, and a second time to see the incorrect checksum). (OS: Ubuntu 20.04)
Asked by Flux (3238 rep)
Mar 27, 2021, 07:28 AM
Last activity: Sep 3, 2021, 10:37 AM