Windows
Linux
Security & Permissions
File System
Windows verify / certutil -hashfile equivalent in Linux
Generates or checks checksums to verify that files have not been corrupted or tampered with.
Windows
→
verify / certutil -hashfile
Linux equivalents
sha256sum
sha256sum
sha256sum
Overview
What this command does
Generates or checks checksums to verify that files have not been corrupted or tampered with.
Migration tip: Always verify downloads using the checksum provided by the source. SHA-256 is preferred over MD5 as it is more secure. Many Linux ISO download pages provide a .sha256 file.
Practical tasks
Common use cases
Verify file integrity with checksums
Generates or checks checksums to verify that files have not been corrupted or tampered with.
sha256sum file
Generate SHA-256 checksum
sha256sum -c file.sha256
Verify against checksum file
md5sum file
Generate MD5 checksum (legacy)
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
sha256sum ubuntu.iso
sha256sum -c ubuntu.iso.sha256
md5sum file1.txt file2.txt
Walkthrough
Examples with explanations
# Windows: certutil -hashfile file SHA256
# Generate:
sha256sum ubuntu.iso
a1b2c3d4... ubuntu.iso
# Verify a download:
sha256sum -c ubuntu.iso.sha256
ubuntu.iso: OK
# Compare two files are identical:
md5sum file1.txt file2.txt
Reference
Common options and variations
| Command or option | Use |
|---|---|
sha256sum file | Generate SHA-256 checksum |
sha256sum -c file.sha256 | Verify against checksum file |
md5sum file | Generate MD5 checksum (legacy) |
sha1sum file | Generate SHA-1 checksum |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | sha256sum |
Same command on this distribution. |
| Fedora | same command | sha256sum |
Same command on this distribution. |
| Arch | same command | sha256sum |
Same command on this distribution. |
Keep learning