How to check the checksum through commandline?

shasum httpd-2.4.7.tar.bz2 |
  awk '$1=="19asdasdasd56462e44d61a093ea57e964cf0af05c0e"{print"good to go"}'

So normally you get this output from shasum

19asdasdasd56462e44d61a093ea57e964cf0af05c0e *httpd-2.4.7.tar.bz2

What my command does it is takes the first field $1, and compares it against
your string. If the strings match, then awk prints “good to go”.

Note that for anything other than sha-1, you need to specify your algorithm. For example, for sha 256, you can do:

shasum -a256 httpd-2.4.7.tar.bz2

The -a flag specifies the algorithm.

Leave a Comment