How to hash files in Linux?

How many times have you needed to get the hash of any file in Linux? For whatever purpose you have needed to do that, rest assured that there is a set of commands that will make your life easier. These commands are part of Linux core utils.

MD5

md5sum <file_name>

SHA-1

sha1sum <file_name>

SHA-256

sha256sum <file_name>

SHA-384

sha384sum <file_name>

SHA-512

sha512sum <file_name>

Blake2

b2sum <file_name>

Note that <file_name> has to be replaced with the name of the file that you want to hash or * in case you want to hash all files in the current folder.

Sources:

  • http://www.gnu.org/software/coreutils/manual/html_node/Summarizing-files.html#Summarizing-files

Leave a Comment

Your email address will not be published. Required fields are marked *