How to Verify an MD5 or SHA Checksum on Linux

Verify an MD5 or SHA Checksum on Linux

by | Mar 14, 2024 | Useful Tech

Looking to verify the integrity of a download or shared file? Trying to compute the hash for a document so you can check whether it has been tempered with in the future? Find out here how to calculate and verify a MD5 or SHA checksum on Linux using Gnome, KDE Plasma or the command line.

First, Mice Like Cheese

Mice like cheese, of course, about as much as the average and domestic cat likes taking a bath. There’s still a chance of calories to be gained, though, and mice will content themselves with cheese (a buttery Gouda, it seems, more than a pungent Limburger) if that’s what they can get without much effort.

Such goes is the story commonly told about the origin of the curious idea that you can catch mice with cheese: the foods that mice do like (grain, vegetables and fruit) were safely stored while cheese was left out to ripen. That’s where our ancestors caught the mice by surprise!

How would we check if that backstory holds? I don’t know yet… let’s check file origins in the meantime (and that nobody has nibbled at the files):

How to Verify an MD5 or SHA Checksum on Linux

Gnome Linux: Collision

To verify the checksum for a file using Collision on Gnome:

  1. Open Collision.
  2. Click Open a File.
  3. Find and open the desired document.
  4. Find many hashes for the file listed on the Hash tab.
    Check: You can have Collision check a file against a known checksum on the Verify tab.
    Verify MD5, SHA and other checksums with Collision on Gnome Linux

KDE Plasma: Hash-o-matic

To check the MD5, SHA-1 and SHA-256 hash for a file on KDE Plasma using Hash-o-matic:

  1. Open Hash-o-matic.
    No Hash-o-matic: If the app is not availble, you can always use the command line to check hashes on Linux; see below.
  2. Go to the Generate tab.
  3. Click Select file.
  4. Choose the file whose hash you want to have computed.
  5. Find the MD5, SHA-256 and SHA-1 hashes under Hashes.

Linux Terminal: md5sum and shasum

Time needed: 3 minutes

To check the MD5 or SHA checksum for a file using the GNU/Linux Terminal:

  1. Open a terminal emulator.

  2. Navigate to the folder that contains the file whose checksum you want to compute.

    Here’s how: Use cd ~/Downloads to change to your account’s Downloads folder, for example.

  3. Type md5sum <filename> for the MD5 hash.

    Drag and drop: Often, you can drag and drop the file from the desktop environment’s file manager to insert the file name.
    SHA: For SHA-1, use shasum -a 1 <filename>; for other SHA algorithms, see below.

  4. Press Enter.

    Verify an MD5 hash checksum using md5sum on Linux

How to Verify an MD5 or SHA Checksum on Linux: FAQ

Which tool should I use for MD5 and SHA checksums?

If you use hashing to verify a file you downloaded or received has not been tempered with, it is best to use the tool that came with your Linux distribution, most typically the command line tools above.

You can check the tool against a file and checksum known to you (but not publicly).

(How to verify an MD5 or SHA checksum tested with md5sum 9.3, shasum 6.04, Collision 3.7 and Hash-o-matic 1.0; updated March 2024)

Home » Useful Tech » How to Verify an MD5 or SHA Checksum on Linux