When you compute a digest of a file, you can check to see that the file has not been tampered with by comparing digest outputs. A digest does not alter the original file.
% digest -l md5 sha1 sha224 sha256 sha384 sha512
Provide an algorithm with the digest command.
% digest -v -a algorithm input-file > digest-listing
Displays the output in the following format:
algorithm (input-file) = digest
The algorithm to use to compute a digest of the file. Type the algorithm as the algorithm appears in the output of Step 1.
The input file for the digest command.
The output file for the digest command.
In the following example, the digest command uses the SHA1 mechanism to provide a directory listing. The results are placed in a file.
% digest -v -a sha1 docs/* > $HOME/digest.docs.legal.05.07 % more ~/digest.docs.legal.05.07 sha1 (docs/legal1) = 1df50e8ad219e34f0b911e097b7b588e31f9b435 sha1 (docs/legal2) = 68efa5a636291bde8f33e046eb33508c94842c38 sha1 (docs/legal3) = 085d991238d61bd0cfa2946c183be8e32cccf6c9 sha1 (docs/legal4) = f3085eae7e2c8d008816564fdf28027d10e1d983