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:
- Open Collision.
- Click Open a File.
- Find and open the desired document.
- 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.
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:
- 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. - Go to the Generate tab.
- Click Select file.
- Choose the file whose hash you want to have computed.
- 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:
- Open a terminal emulator.
- 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. - 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, useshasum -a 1 <filename>
; for other SHA algorithms, see below. - Press Enter.
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–9.4, shasum 6.04, Collision 3.7–3.8 and Hash-o-matic 1.0; first published March 2024, last updated August 2024)