filehash(1) General Commands Manual filehash(1)
NAME
filehash - print various hash digests and filesizes for the specified
files or subsets of those files
SYNOPSIS
filehash [-h(elp)] [-1(MD5)] [-2(SHA1)] [-3(SHA224)] [-4(SHA256)]
[-5(SHA384)] [-6(SHA512)] [-7(BLAKE2B_256)] [-8(BLAKE2B_512)]
[-b(ase64url)] [-B(ase64)] [-c(lassic)] [-C(lassic_BSD)] [-f file_list]
[-n byte_count] [-o offset] [-p(ipe)] [-q(uiet)] [-s(ize)] [-T threads]
[-v(erbose)] [file...]
DESCRIPTION
filehash prints out various hashes (MD5, SHA1, SHA224, SHA256, SHA384,
SHA512, BLAKE2B-256, and/or BLAKE2B-512) digests and (optionally)
filesizes for the specified files. Hashes for portions of those files
can also be requested.
OPTIONS
-h Print help and quit.
-1 Include the MD5 hash (128 bits) as part of the filehash output.
-2 Include the SHA1 hash (160 bits) as part of the filehash output.
-3 Include the SHA224 hash as part of the filehash output.
-4 Include the SHA256 hash as part of the filehash output.
-5 Include the SHA384 hash as part of the filehash output.
-6 Include the SHA512 hash as part of the filehash output.
-7 Include the BLAKE2B hash (at 256 bits) as part of the filehash
output.
-8 Include the BLAKE2B hash (at 512 bits) as part of the filehash
output.
-b Print each filehash in unpadded "base64url" encoding instead of
hexadecimal.
-B Print each filehash in unpadded "base64" encoding instead of
hexadecimal.
-c Print output in the "classic" format, with one filehash per
line. This overrides the -C, -q, and -v options.
-C Print output in "BSD-style" format, with one filehash per line.
This overrides the -q and -v options.
-f file_list
Read the names of files to be processed from the specified file.
-n byte_count
Read only the first byte_count bytes from each specified file.
-o offset
Seek past the first offset bytes in each specified file before
beginning filehash computations. Specifying an offset that is
greater than or equal to the length of the file yields the same
result as a zero-length file.
-p Read the names of files to be processed from stdin.
-q Quiet output. Do not print the filename with program output.
-s Include the filesize as part of the filehash output.
-T threads
Process up to the specified number of files in parallel. The
default value is 1, i.e., single-threaded operation.
-v Verbose output. Print the filename with the program output.
EXAMPLES
Print SHA256 and 256-bit BLAKE2B digests of a couple of files in base64
format:
filehash -4 -7 -B file001.dat file002.dat
Print SHA512 digests in BSD-style format for all files in a directory
tree: find . -name -type f -print | filehash -p -6 -C
NOTES
The filehash utility defaults to quiet for a single file and verbose
for multiple files. The -f and -p options can be used simultaneously
with filenames specified on the command-line. If no hash option is
specified, then SHA256 will be used by default.
Single-threaded operation is used by default, as modern CPUs can
usually compute hashes faster than data can be read from storage.
However, if you're using a very slow CPU with very fast storage, you
might want to try multi-threaded operation. Be warned that it might
cause thrashing. Be sure to benchmark.
COPYRIGHT
Main filehash program Copyright (C) 2004-2026 Brian Lindholm. This
program is free software; you can use it, redistribute it, and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 3, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
littleutils 2026 Jan 01 filehash(1)
littleutils 1.4.0 - Generated Wed Feb 18 06:58:38 CST 2026
