# sha1sum Cheatsheet - Launch Pad

__ _______________________ _________._________________________ \_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/ | __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_ | \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \ \___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ / \/ \/ \/ \/ \/ \/ \/
← Back to Cheatsheets

# sha1sum Cheatsheet

Quick reference for `sha1sum`, a tool to compute and verify SHA-1 checksums. SHA-1 is considered weak for modern security; use it mostly for legacy compatibility, not new designs.

## Basic usage

- `sha1sum file.img` – print SHA-1 hash and filename.
- `sha1sum file1 file2` – hash multiple files.
- `echo -n "test" | sha1sum` – 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 SHA-1 sums from a file.
- `--tag` – create BSD-style output (`SHA1 (file) = hash`).

## Creating and verifying checksum files

- `sha1sum file.img > file.img.sha1` – save checksum.
- `sha1sum file1 file2 > checksums.sha1` – create checksum list.
- `sha1sum -c file.img.sha1` – verify a single file.
- `sha1sum -c checksums.sha1` – verify multiple files.

## Tips

- Prefer `sha256sum` or `sha512sum` for security-sensitive uses.
- Use SHA-1 mainly when you must match existing ecosystems or published hashes.
- Keep checksum files alongside downloads so users can verify integrity easily.