This tutorial explains Linux “sha1sum” command, options and its usage with examples.
DESCRIPTION
Print or check SHA1 (160-bit) checksums. It is commonly used to verify the integrity of files
SYNOPSIS
sha1sum [OPTION] [FILE]…
sha1sum [OPTION] –check [FILE]
OPTIONS :
-b, –binary
read files in binary mode (default on DOS/Windows)
-c, –check
check SHA1 sums against given list
-t, –text
read files in text mode (default)
The following two options are useful only when verifying checksums:
–status
don’t output anything, status code shows success
-w, –warn
warn about improperly formated checksum lines
EXAMPLES
1. To create a file with an sha1 hash in it, if one isn’t provided execute:
$ sha1sum filename [filename] ... > SHA1SUM
2. To verify the file was downloaded correctly you can execute:
$ sha1sum -c SHA1SUM
filename: OK
filename...: OK
Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.
- Apply for Linux Internship
- Buy Information Technology Books
- Apply for Programming Internship
- Buy Linux Books
- Practice Programming MCQs