GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
XHASH(1) FreeBSD General Commands Manual XHASH(1)

xhashcompute multiple hashes on strings, files, and directories

xhash [OPTIONS] [-s STRING ...] [-c FILE] [-i FILE] [FILE ...] [-r FILE ... DIRECTORY ...]

xhash is a Go program that uses goroutines to calculate multiple hashes on strings, files, and directories. By default, it reads from standard input.

The output format is fully configurable.

, --all
Use all algorithms (except others specified, if any)
, --base64
Output hash in Base64 encoding format
Use BLAKE2b-256 algorithm
Use BLAKE2b-512 algorithm
Use BLAKE2s-256 algorithm
Use BLAKE3 algorithm
, --check file
Read checksums from file (use "" for stdin) (default "\x00")
, --format string
Output format (default "{{range .}}{{.Name}} ({{.File}}) = {{.Sum }}\n{{end}}")
Use the GNU md5sum output format
, --hmac key
Key for HMAC (in hexadecimal) or read from specified pathname (default "\x00")
Don't fail or report status for missing files
, --input file
Read pathnames from file (use "" for stdin) (default "\x00")
Use MD5 algorithm
, --quiet
Don't print OK for each successfully verified file
, --recursive
Recurse into directories
Use SHA1 algorithm
Use SHA256 algorithm
Use SHA3-256 algorithm
Use SHA3-512 algorithm
Use SHA512 algorithm
Use SHA512-256 algorithm
Include file size in output
, --status
Don't output anything; status code shows success
Exit non-zero for improperly formatted checksum lines
, --string
Treat arguments as strings
, --symlinks
Follow symbolic links while recursing directories
, --verbose
Verbose operation
Show version and exit
, --warn
Warn about improperly formatted checksum lines
, --zero
End each output line with NUL, not newline, and disable file name escaping

To hash every file in your home directory using both SHA-512 and SHA-256:

xhash -r -sha512 -sha256 $HOME

To hash the /etc/passwd file with all algorithms except MD5 and SHA-1:

xhash -all -md5 -sha1 /etc/passwd

To hash the string "abc" with all algorithms:

xhash -all -s "abc"

To check the hashes in /tmp/hashes.md5:

xhash -c /tmp/hashes.md5

To hash all files specified in /tmp/files.list:

xhash -i /tmp/files.list

The default format is the same as the BSD commands. Use --gnu to use the format used by md5sum.

To mimic the format used by hashdeep, use:

--size -f '{{range .}}{{.Sum}},{{end}}{{(index . 0).File}}\n'

Ricardo Branco

April 19, 2025 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.