Used to calculate the SHA-256 hash value of files.
The sha256sum command prints or checks SHA256 (256-bit) checksums.
sha256sum [OPTION]... [FILE]...
-b, --binary # read in binary mode
-c, --check # read SHA256 sums from the FILEs and check them
--tag # create a BSD-style checksum
-t, --text # read in text mode (default)
-z, --zero # end each output line with NUL, not newline, and disable file name escaping
--help # display this help and exit
--version # output version information and exit
Here are some examples of using the sha256sum command:
sha256sum file.txt
This will output the SHA-256 hash value of file.txt and the filename.
sha256sum file1.txt file2.txt
This will output the SHA-256 hash values of file1.txt and file2.txt and their filenames.
sha256sum file.txt > hash.txt
This will save the SHA-256 hash value of file.txt into the file hash.txt.
sha256sum -c hash.txt
This will verify whether the SHA-256 hash value of the file matches the value in hash.txt. If it matches, it outputs OK; otherwise, it outputs FAILED.