Next: , Previous: , Up: Command-line commands   [Contents][Index]


17.4.34 hashsum

Command: hashsum --hash hash --keep-going --uncompress --check file [--prefix dir]|file …

Compute or verify file hashes. Hash type is selected with option --hash. Supported hashes are: ‘adler32’, ‘crc64’, ‘crc32’, ‘crc32rfc1510’, ‘crc24rfc2440’, ‘md4’, ‘md5’, ‘ripemd160’, ‘sha1’, ‘sha224’, ‘sha256’, ‘sha512’, ‘sha384’, ‘tiger192’, ‘tiger’, ‘tiger2’, ‘whirlpool’. Option --uncompress uncompresses files before computing hash.

When list of files is given, hash of each file is computed and printed, followed by file name, each file on a new line.

When option --check is given, it points to a file that contains list of hash name pairs in the same format as used by UNIX md5sum command. Option --prefix may be used to give directory where files are located. Hash verification stops after the first mismatch was found unless option --keep-going was given. The exit code $? is set to 0 if hash verification is successful. If it fails, $? is set to a nonzero value.