DEV Community

Emilio Romero
Emilio Romero

Posted on • Edited on

Verify Windows ISO file in Bash

To check the integrity and authenticity of the data you have downloaded, especially to ensure it hasn't been corrupted during download or tampered with by malicious actors, follow these steps:

1. Download & Obtain the Hash

First, download the ISO file of the product you want.
Next, and very importantly, locate the corresponding SHA256 hash value provided by the official source (e.g., on their download page, a separate .sha256 file, or a documentation page).

2. Open Bash terminal

After successfully downloading the ISO file, open your Bash terminal and navigate to the directory where you downloaded the ISO file. Then, type the following command, replacing YOUR_OBTAINED_HASH with the actual hash value you got from the source, and FILE_NAME.iso with the exact name of your downloaded file:

echo "YOUR_OBTAINED_HASH *FILE_NAME.iso" | shasum -a 256 --check
Enter fullscreen mode Exit fullscreen mode

If everything went well, the terminal should return:

FILE_NAME.iso: OK
Enter fullscreen mode Exit fullscreen mode

If the result was an OK, it will confirm that the file has not been damaged, modified or altered in any way compared to the original.

Example

If your downloaded file is Win11_22H2_Spanish_x64v2.iso and the official hash is C8CXXX...

echo "C8CXXX *Win11_22H2_Spanish_x64v2.iso" | shasum -a 256 --check
Enter fullscreen mode Exit fullscreen mode
Win11_22H2_Spanish_x64v2.iso: OK
Enter fullscreen mode Exit fullscreen mode

Top comments (0)