Apple Blog

How to tell if a file has been downloaded successfully with MD5 and Mac

We show you how to check if your files have been downloaded correctly from the Internet or, on the contrary, if they have been downloaded with some defect. To do so, we will not have to install any program, we will use the Mac terminal. This process can be especially useful when downloading critical software such as operating systems or firmware.

When we download files from the Internet there is always a chance that some of them have been downloaded incorrectly. This is really worrying when it comes to ISO images of operating systems, firmware for hardware devices… Or any other type of software which in case of malfunction can be a serious problem for your user.

How to tell if a file has been downloaded successfully with MD5 and Mac
How to tell if a file has been downloaded successfully with MD5 and Mac

To make sure that the file has been downloaded properly and that we can burn it to a DVD or use it without fear of it not working, we can check the MD5. The MD5 is a 32-digit number in hexadecimal that is created by an algorithm with the same name and that, we can use to compare the MD5 of the file before and after the download. If this has not changed, the file has been downloaded correctly.

To check the MD5 from the Mac, we don’t have to download any program or utility but we can do it directly from the Terminal. To do this, go to your Applications> Utilities> Terminal folder. Once in the Terminal, we don’t need to have superuser permissions to type the following:

md5 file-route.extension

An example of use would be: md5 ~ubuntu.iso

When typing this command, the terminal will respond with this one:

Where the numbers placed to the right of the equal are the MD5 of the file , which we will have to compare with the one that has provided us the server and that had the file before being downloaded.

On the other hand, if we want to use, instead of md5, openssl, we can use the following command :

openssl md5

An example of the latter would be: openssl md5 ~ubuntu.iso

There is no difference between using openssl and using md5 directly , it's just a matter of preferences and being used to using one or the other command, but the result is the same.

This is not something we will use every day, but it can save us more than a headache in case we download a critical file and it could have been transferred to our computer with any defect. We hope you found it useful and we'll be happy to answer your questions about MD5 on Mac in the comments to this post or on our Twitter.

Similar Posts