Get the Checksum of a File in Console/Terminal

MD5

MD5 is o.k. to check if the download of a file was complete, but it is not suitable to verify data integrity.

Change in the directory of the file to check:
cd DIRECTORY_OF_THE_FILE

    Type...
  • Linux: md5sum FILE_TO_CHECK
  • Windows: certUtil -hashfile FILE_TO_CHECK MD5
  • Mac: md5 FILE_TO_CHECK
  • BSD and other Unix systems: cksum -a sha256 FILE_TO_CHECK
    oder md5 FILE_TO_CHECK
  • AIX: csum -h MD5 FILE_TO_CHECK
  • OpenSolaris: digest -a md5 FILE_TO_CHECK
  • HP-UX: md5sum FILE_TO_CHECK
  • If OpenSSL is installed you can always type:
    openssl md5 FILE_TO_CHECK

Get the SHA-256 checksum of a file

Change in the directory of the file to check:
cd DIRECTORY_OF_THE_FILE

    Type...
  • Linux: sha256sum FILE_TO_CHECK
  • Windows: certUtil -hashfile FILE_TO_CHECK SHA256
  • Mac: shasum -a 256 FILE_TO_CHECK
  • BSD und anderen Unix-Systeme: cksum -a sha256 FILE_TO_CHECK
    oder sha256 FILE_TO_CHECK
  • OpenSolaris: digest -a sha256 FILE_TO_CHECK

If OpenSSL is installed you can also type: openssl dgst -sha256 FILE_TO_CHECK

Blake2b

Blake2b is faster than SHA256 (sometimes even faster than MD5) and more secure than SHA-256, but it is still not much supported.

If at least openssl-1.1 is installed you can type:
openssl dgst -blake2b512 FILE_TO_CHECK

You can also use the binaries for Linux/Windows of b2sum, you can find them here:
BLAKE2 site