How to: Calculate sha checksum of files using shasum family of commands

Almost any problem that can be answered in a single word or line is available as a command line utility on Linux. Using shasum family of commands you can calculate the sha hash/check sum of files in a single go. You can even use them in scripts to automate various tasks.

Members of family are - shasum, sha1sum, sha224sum, sha256sum, sha384sum and sha512sum. “shasum” is the all in one parent command, i.e. it includes all the features provided by rest of the members.

Here is how you use it to simply calculate the check sum for the algorithm of your choice.

[shredder12]$ shasum -a 256 file.ext

Using the ‘-a’ option we choose the algorithm to be used. Here we go for 256-bit version. You may have already guessed that the above command is equivalent to sha256sum and similarly for others. Default is the sha-1 message digest.

[shredder12]$ sha256sum file.ext

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.