
{"id":43878,"date":"2023-04-12T13:11:02","date_gmt":"2023-04-12T13:11:02","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=43878"},"modified":"2023-04-12T13:11:13","modified_gmt":"2023-04-12T13:11:13","slug":"check-md5-sha-hash-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2023\/04\/check-md5-sha-hash-ubuntu\/","title":{"rendered":"How to Check File&#8217;s MD5, SHA (1, 256, 512) Hash in Ubuntu 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/09\/file-search-icon.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-34725\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/09\/file-search-icon-250x250.jpg\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/09\/file-search-icon-250x250.jpg 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/09\/file-search-icon-300x300.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/09\/file-search-icon-600x600.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/09\/file-search-icon-768x768.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/09\/file-search-icon.jpg 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This simple tutorial is going to show you how to check MD5, SHA1, SHA256, SHA512 file hash in Ubuntu and most other Linux systems.<\/p>\n<p>After downloading a file from the web, it&#8217;s important to verify the file integrity. This can be done by checking the hash code of the local file, then compare to the one from the download page. <b>The hash code of local file and the one from download page should be same, before safe for use<\/b>.<\/p>\n<h3>Method 1: Single command to check MD5 or SHA Hash<\/h3>\n<p>For most Linux, there&#8217;s built-in command line tool to check the file hash.<\/p>\n<p>1. First, open file manager and navigate to the folder that contains the file you want to check. Then, right-click on blank area and select &#8216;<b>Open in Terminal<\/b>&#8216; (or &#8216;Open Terminal Here&#8217;)<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-downloads-terminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43879\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-downloads-terminal-600x358.webp\" alt=\"\" width=\"600\" height=\"358\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-downloads-terminal-600x358.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-downloads-terminal-300x179.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-downloads-terminal-768x458.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-downloads-terminal.webp 857w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>2. When terminal opens, type <b>sha<\/b> and hit <b>Tab<\/b> key will show you available commands to do the job.<\/p>\n<p>For example, to <strong>check sha256 checksum<\/strong>, use command:<\/p>\n<pre>sha256sum file_name_here<\/pre>\n<p>To <strong>check sha1 checksum<\/strong>, use command:<\/p>\n<pre>sha1sum file_name_here<\/pre>\n<p>Or use command below instead by replacing number 256 with 1, 224, 384, 512, 512224, 512256 accordingly:<\/p>\n<pre>shasum -a 256 file_name_here<\/pre>\n<p>To <strong>check MD5<\/strong>, use command:<\/p>\n<pre>md5sum file_name_here<\/pre>\n<p>Depends on your machine, the command will take a few seconds to output the hash code. Then, you can compare it with the one from the file download page.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/shasum-terminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43880\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/shasum-terminal-600x407.webp\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/shasum-terminal-600x407.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/shasum-terminal-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/shasum-terminal-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/shasum-terminal.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Method 2: Check File Hash in File Manager<\/h3>\n<p>Without running a Linux command every time, user can choose to install a file browser extension. So, it&#8217;s possible to right-click on the file, and go to its &#8220;Properties&#8221; dialog to check the file hash.<\/p>\n<p>1. First, press <b>Ctrl+Alt+T<\/b> on keyboard to open terminal. When it opens, run command to to install the file manager extension:<\/p>\n<pre>sudo apt install nautilus-gtkhash<\/pre>\n<p><i>Depends on your Desktop Environment, replace <code>nautilus-gtkhash<\/code> with:<\/i><\/p>\n<ul>\n<li><b>thunar-gtkhash<\/b> for XFCE desktop&#8217;s file manager.<\/li>\n<li><b>nemo-gtkhash<\/b> for Cinnamon desktop&#8217;s nemo file manager.<\/li>\n<li><b>caja-gtkhash<\/b> for MATE desktop.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/apt-gtkhash.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43881\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/apt-gtkhash-600x407.webp\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/apt-gtkhash-600x407.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/apt-gtkhash-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/apt-gtkhash-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/apt-gtkhash.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>2. Once installed, run command to quit file manager:<\/p>\n<pre>nautilus -q<\/pre>\n<p>Also, replace <code>nautilus<\/code> depends on which file manager you&#8217;re using.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/nautilus-q.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43885\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/nautilus-q-600x220.webp\" alt=\"\" width=\"600\" height=\"220\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/nautilus-q-600x220.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/nautilus-q-300x110.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/nautilus-q.webp 753w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>3. Finally, open the folder that contains the file to check the hash. Right-click on it and click on &#8220;<strong>Properties<\/strong>&#8220;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-fileproperties.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43882\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-fileproperties-600x358.webp\" alt=\"\" width=\"600\" height=\"358\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-fileproperties-600x358.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-fileproperties-300x179.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-fileproperties-768x458.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/open-fileproperties.webp 857w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>4. In pop-up dialog, navigate to the last &#8220;<strong>Digests<\/strong>&#8221; tab. Tick the desired hash function, and click on the bottom right &#8220;<strong>Hash<\/strong>&#8221; button to start checking.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-checking-hash.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43883\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-checking-hash.webp\" alt=\"\" width=\"560\" height=\"552\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-checking-hash.webp 560w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-checking-hash-300x296.webp 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>When done, compare the hash code with the one from the download page and done!<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-hash-done.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43884\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-hash-done.webp\" alt=\"\" width=\"560\" height=\"552\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-hash-done.webp 560w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/04\/gtk-hash-done-300x296.webp 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>This simple tutorial is going to show you how to check MD5, SHA1, SHA256, SHA512 file hash in Ubuntu and most other Linux systems. After downloading a file from the web, it&#8217;s important to verify the file integrity. This can be done by checking the hash code of the local file, then compare to the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":34725,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-43878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/43878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=43878"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/43878\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/34725"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=43878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=43878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=43878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}