Skip to content

Instantly share code, notes, and snippets.

@wikiti
Last active January 2, 2019 13:07
Show Gist options
  • Save wikiti/8101fc9297057ee86fc034644b1de86b to your computer and use it in GitHub Desktop.
Save wikiti/8101fc9297057ee86fc034644b1de86b to your computer and use it in GitHub Desktop.
Use `sha1sum` command to calculate the SHA1 hash code for a set of files.
# Format
sha1sum <files>
# Example:
sha1sum document.docx
# ab9d7658e42da2a00c56d3bc6cdf1d9d5f0d3c6e document.docx
# Using multiple arguments:
sha1sum document.docx another_file.docx
# ab9d7658e42da2a00c56d3bc6cdf1d9d5f0d3c6e document.docx
# 34cf8ec781d7f8add928fb0303b21c2fb0dd9126 another_file.docx
# Using a glob:
sha1sum *.docx
# ab9d7658e42da2a00c56d3bc6cdf1d9d5f0d3c6e document.docx
# 34cf8ec781d7f8add928fb0303b21c2fb0dd9126 another_file.docx
# Piped to previous command, using stdout as data input.
echo 'Hello world!' | sha1sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment