Joseph Collins

Open a terminal, cd to the directory that includes the file and it’s seperate hash-file then:

shasum -c hash-file

That’s it. The hashfile is just the text file in the form “hash<double-space>filename”. Like this alpine linux sha256 checksum file.

If the hash is available as a link you can curl and pipe it into shasum -c.

cd <dir that contains file to verify>

curl -s https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/x86_64/alpine-standard-3.15.0-x86_64.iso.sha256 | shasum -c

If the hash is given as text, then type this here-string command including two spaces between the hash and filename.

cd <dir that contains file to verify>

shasum -c <<< “d8d3822b6fd8dd52d86b9b147ea218671eeb3df381dc2b9235f8f6e10c97008d alpine-standard-3.15.0-x86_64.iso”

NOTE: Make sure there is two spaces between the hash and the filename.

Hope this helps!

— Joe

Photo by Mauro Sbicego on Unsplash

--

--