How to verify a checksum using one command line?
11
votes
10
answers
53105
views
Suppose I type and run the following command:
sha256sum ubuntu-18.04.1-desktop-amd64.iso
After a delay, this outputs the following:
5748706937539418ee5707bd538c4f5eabae485d17aa49fb13ce2c9b70532433 ubuntu-18.04.1-desktop-amd64.iso
Then, I realize that I should have typed the following command to more rapidly assess whether the SHA‐256 hash matches:
sha256sum ubuntu-18.04.1-desktop-amd64.iso | grep 5748706937539418ee5707bd538c4f5eabae485d17aa49fb13ce2c9b70532433
Is there a way to act on the first output without using the
sha256sum
command to verify the checksum a second time (i.e., to avoid the delay that would be caused by doing so)? Specifically:
1. I'd like to know how to do this using a command that does not require copy and pasting of the first output's checksum (if it's possible).
2. I'd like to know the simplest way to do this using a command that does require copy and pasting of the first output's checksum. (Simply attempting to use grep
on a double‐quoted pasted checksum (i.e., as a string) doesn't work.)
Asked by Patrick Dark
(233 rep)
Aug 22, 2018, 12:58 AM
Last activity: Sep 13, 2024, 04:24 AM
Last activity: Sep 13, 2024, 04:24 AM