{"id":22677,"date":"2023-10-27T17:53:22","date_gmt":"2023-10-27T17:53:22","guid":{"rendered":"https:\/\/linuxways.net\/?p=22677"},"modified":"2023-10-27T17:54:32","modified_gmt":"2023-10-27T17:54:32","slug":"how-to-get-md5-hash-of-a-file-in-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-get-md5-hash-of-a-file-in-ubuntu-22-04\/","title":{"rendered":"How to Get md5 Hash Of A File in Ubuntu 22.04?"},"content":{"rendered":"<p>The verification of File Integrity helps the Administrators in protecting the files and folders from unauthorized users. Usually, files are sent or received through unauthorized or insecure channels that might lead to the Original Data being altered. The Hashing Algorithm in Ubuntu helps in comparing the file with the Original File through the Hash Values.<\/p>\n<p>This article discusses how you can get the md5 Hash Value of a File in Ubuntu 22.04.<\/p>\n<h2><strong>How to Get md5 Hash Of A File in Ubuntu 22.04?<\/strong><\/h2>\n<p>The md5sum or the Message Digest Algorithm 5 is a 128-bit Cryptographic Hash that helps in verifying the integrity of a file. It prints a 32-character checksum that can be verified with the original hash of the file. The MD5 Hash of a File in Ubuntu can be retrieved using Two Methods:<\/p>\n<ul>\n<li>Using the \u201cmd5sum\u201d Command.<\/li>\n<li>Using the File Manager<\/li>\n<\/ul>\n<p>Both methods are explained below.<\/p>\n<h2><strong>Method 1: Using the \u201cmd5sum\u201d Command to Get the MD5 Hash of a File<\/strong><\/h2>\n<p>To get the Hash of a File using the \u201cmd5sum\u201d command in Terminal, follow the below steps.<\/p>\n<h3><strong>Navigate to the File Directory<\/strong><\/h3>\n<p>To run the \u201c<strong>md5sum<\/strong>\u201d command, navigate to the file directory. In our case, we examine the \u201cmysql-server\u201d file in the \u201cDownloads\u201d Directory. To navigate to the Directory, we will use the \u201ccd\u201d command, and then the \u201cls\u201d command will list all the files included in that Directory:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"367\" class=\"wp-image-22678\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-1.png 730w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-1-300x151.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/p>\n<p>Once the files are listed, you can see the \u201cmysql-server\u201d tar file:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"372\" class=\"wp-image-22679\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-2.png 727w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-2-300x154.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/p>\n<h3><strong>Run the \u201cmd5sum\u201d Command<\/strong><\/h3>\n<p>To verify the integrity of a file in Ubuntu, the \u201cmd5sum\u201d Command is used along with the File Name. Once the \u201cmd5sum\u201d command runs, it will return the hash of the file in the Terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">md5sum <span class=\"sy0\">&lt;<\/span>fileName<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>In our case, the file is a tar bundle file \u201cmysql-server\u201d. To get the hash of the tar file, the \u201cmd5sum\u201d command will be executed as follows:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">md5sum mysql-server_8.1.0-1ubuntu22.04_amd64.deb-bundle.tar<\/div><\/div>\n<p>It will take some time to get the hash of the file and will return the hash along with the file name in the next line of Terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"76\" class=\"wp-image-22680\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-3.png 986w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-3-300x23.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-3-768x59.png 768w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><\/p>\n<h3><strong>Verifying<\/strong><\/h3>\n<p>Once you have the hash of the file by running the \u201cmd5sum\u201d command, verify its integrity by comparing the hash value to the original hash value from the official download source. In our case, we downloaded the \u201cmysql-server\u201d archive file from the official \u201cmysql\u201d website. The archive file downloaded was for the Ubuntu Linux 22.04 Version, which you can download according to your System compatibility. The MD5 Hash value of the archive file can be seen below the Download Button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1117\" height=\"675\" class=\"wp-image-22681\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-4.png 1117w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-4-300x181.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-4-1024x619.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-4-768x464.png 768w\" sizes=\"auto, (max-width: 1117px) 100vw, 1117px\" \/><\/p>\n<p>The Hash value retrieved with the \u201cmd5sum\u201d command is the same as the MD5 value on the official download repository which verifies and ensures the data is the same as it was initially, i.e. the file has not been changed or edited.<\/p>\n<h2><strong>Method 2: Using the File Manager to Get the MD5 Hash of a File<\/strong><\/h2>\n<p>The File Manager through the GUI can also be used to get the MD5 Hash Value of a file. Follow the steps below to get the md5 Hash of a file through the File Manager.<\/p>\n<h3><strong>Install \u201cnautilus-gtkhash\u201d<\/strong><\/h3>\n<p>The \u201cgtkhash\u201d is a desktop utility that uses the \u201cmhash\u201d library for computing the checksums and message digests. The \u201cmhash\u201d library is an interface that provides hash algorithms. The checksum checks for errors by comparing the data derived from one source with another source in a block whereas the message digests is a widely used cryptographic one-way hashing formula. The \u201cgtkhash\u201d is an extension for the \u201cnautilus\u201d file manager and can be installed with the \u201capt\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> nautilus-gtkhash<\/div><\/div>\n<p>It will ask for confirmation while adding packages to your Ubuntu System. Press \u201cY\u201d to continue:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"400\" class=\"wp-image-22682\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-5.png 875w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-5-300x137.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-5-768x351.png 768w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/p>\n<h3><strong>Quit nautilus<\/strong><\/h3>\n<p>Once the \u201cgtkhask\u201d utility downloads, quit the \u201cnautilus\u201d desktop file manager with the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nautilus <span class=\"re5\">-q<\/span><\/div><\/div>\n<p>This command will restart Nautilus as well and will enable Digests in the Properties of the file:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"871\" height=\"58\" class=\"wp-image-22683\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-6.png 871w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-6-300x20.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-6-768x51.png 768w\" sizes=\"auto, (max-width: 871px) 100vw, 871px\" \/><\/p>\n<h3><strong>Go to the File Directory<\/strong><\/h3>\n<p>Now, to get the MD5 Hash of the file. Navigate to the file directory. In our case, we have the \u201cmysql-server\u201d archive file in the Downloads Directory:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1262\" height=\"197\" class=\"wp-image-22684\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-7.png 1262w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-7-300x47.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-7-1024x160.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-7-768x120.png 768w\" sizes=\"auto, (max-width: 1262px) 100vw, 1262px\" \/><\/p>\n<p>Right-click on the \u201cmysql-server\u201d archive file to open the file options menu. In the options menu, click on the \u201cProperties\u201d option:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"544\" class=\"wp-image-22685\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-8.png 944w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-8-300x173.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-8-768x443.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/p>\n<p>The File Properties Menu appears, and you can see the \u201cDigests\u201d option as well which was enabled after installing the \u201cnautilus gtkhash\u201d utility. Click on the \u201cDigests\u201d Option:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"509\" height=\"515\" class=\"wp-image-22686\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-9.png 509w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-9-297x300.png 297w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><\/p>\n<p>In the Digests Menu, you can select the Hash Option from the List. In our case, we have to check the MD5 Hash of the file, so we will select the MD5 Option:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"524\" class=\"wp-image-22687\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-10.png 510w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-10-292x300.png 292w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>Once the desired options are selected, click on the \u201cHash\u201d button at the Bottom of the Properties Menu which will start getting the Hash Key:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"520\" class=\"wp-image-22688\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-11.png 513w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-11-296x300.png 296w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\n<p>It will take some time to retrieve the Hash Value, wait for the process to complete:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"524\" class=\"wp-image-22689\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-12.png 507w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-12-290x300.png 290w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/p>\n<p>When the process is completed, the Digest Column will display the Hash Values. Notice the MD5 Hash Value of the \u201cmysql-server\u201d file:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"505\" height=\"515\" class=\"wp-image-22690\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-13.png 505w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-13-294x300.png 294w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><\/p>\n<p>Apart from the md5 Hash of the File, the \u201cSHA256\u201d is also used for verifying the integrity of a file. To learn how to Verify File Integrity, follow the <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/verify-ubuntu-download\/\">Verify Ubuntu File<\/a> Guide.<\/p>\n<h3><strong>Verify<\/strong><\/h3>\n<p>To verify the file integrity, navigate to the official download web page of the file and locate the file version. In our case, we used the Official Website to download the \u201cmysql-server\u201d file. Each file has the MD5 Hash Value given below the Download Button option:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1117\" height=\"675\" class=\"wp-image-22691\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-14.png 1117w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-14-300x181.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-14-1024x619.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-22677-14-768x464.png 768w\" sizes=\"auto, (max-width: 1117px) 100vw, 1117px\" \/><\/p>\n<p>The Hash value retrieved using Nautilus File Manager with Digests is the same as the MD5 value on the official download repository which verifies that the file has not been changed or edited.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>The MD5 Hash Value of a File can be retrieved by either using the Terminal or the GUI. The \u201cmd5sum\u201d command gets the MD5 Hash Value of the file whereas for the GUI, the \u201cnautilus gtkhash\u201d has to be installed first and then the Hash value can be retrieved from the Digest Options in the File Properties. This article explains both methods in detail for getting the MD5 Hash Value of a File in Ubuntu.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>The MD5 Hash Value of a File can be retrieved by either using the \u201cmd5sum\u201d command in the Terminal or through GUI with the \u201cnautilus gtkhash\u201d File Manager.<\/p>","protected":false},"author":110,"featured_media":22692,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-22677","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/22677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=22677"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/22677\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/22692"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=22677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=22677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=22677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}