Quick reference for md5sum, a tool to compute and verify MD5 checksums.
MD5 is considered cryptographically broken; use it only for legacy integrity checks, not for security.
Basic usage
md5sum file.iso– print MD5 hash and filename.md5sum file1 file2 file3– hash multiple files.echo -n "test" | md5sum– hash data from stdin.
Common options
-b– read files in binary mode (default on Linux).-t– read files in text mode (mainly for non-Unix systems).-c– check MD5 sums from a file.--tag– create BSD-style output (MD5 (file) = hash).
Creating and verifying checksum files
md5sum file.iso > file.iso.md5– save checksum.md5sum file1 file2 > checksums.md5– create checksum list.md5sum -c file.iso.md5– verify a single file.md5sum -c checksums.md5– verify multiple files.
Tips
- Use
sha256sumorsha512sumfor security-sensitive integrity checks. - When hashing from
echo, remember-nto avoid including the newline. - Checksum files are just text; you can version them in git or share them alongside downloads.