Scroll to navigation

DIRHASH(1) User Commands DIRHASH(1)

NAME

dirhash - Python module and CLI for hashing of file system directories.

DESCRIPTION

usage: dirhash [-h] [-v] [-a] [-m [...]] [-i [...]] [--empty-dirs]

[--no-linked-dirs] [--no-linked-files] [-p
[...]] [-c]
[-s CHUNK_SIZE] [-j JOBS] [-l]directory

Determine the hash for a directory.

positional arguments:

Directory to hash.

optional arguments:

show this help message and exit
show program's version number and exit
Hashing algorithm to use, by default "md5". Alwaysavailable: ['md5', 'sha1', 'sha224', 'sha256','sha384', 'sha512']. Additionally available on currentplatform: ['blake2b', 'blake2s', 'md4', 'md5-sha1','ripemd160', 'sha3_224', 'sha3_256', 'sha3_384','sha3_512', 'sha512_224', 'sha512_256', 'shake_128','shake_256', 'sm3', 'whirlpool']. Note that the samealgorithm may appear multiple times in this set underdifferent names (thanks to OpenSSL)[https://docs.python.org/2/library/hashlib.html]

Filtering options:

Specify what files and directories to include. All files and directories(including symbolic links) are included by default. The --match/--ignore arguments allows for selection using glob/wildcard (".gitignore style") path matching. Paths relative to the root `directory` (i.e. excluding the name of the root directory itself) are matched against the provided patterns. For example, to only include python source files, use: `dirhash path/to/dir -m "*.py"` or to exclude hidden files and directories use: `dirhash path/to.dir -i ".*" ".*/"` which is short for `dirhash path/to.dir -m "*" "!.*" "!.*/"`. By adding the --list argument, all included paths, for the given filtering arguments, are returned instead of the hash value. For further details see https://github.com/andhus/dirhash/README.md#filtering
[ ...], --match [ ...] One or several patterns for paths to include. NOTE: patterns with an asterisk must be in quotes ("*") or the asterisk preceded by an escape character (\*).
[ ...], --ignore [ ...] One or several patterns for paths to exclude. NOTE: patterns with an asterisk must be in quotes ("*") or the asterisk preceded by an escape character (\*).
Include empty directories (containing no files thatmeet the matching criteria and no non-empty subdirectories).
Do not include symbolic links to other directories.
Do not include symbolic links to files.

Protocol options:

Specify what properties of files and directories to include and whether toallow cyclic links. For further details seehttps://github.com/andhus/dirhash/DIRHASH_STANDARD.md#protocol
[ ...], --properties [ ...] List of file/directory properties to include in the hash. Available properties are: ['name', 'data', 'is_link'] and at least one of name and data must be included. Default is [data name] which means that both the name/paths and content (actual data) of files and directories will be included
Allow presence of cyclic links (by hashing therelative path to the target directory).

Implementation options:

The chunk size (in bytes) for reading of files.
Number of jobs (parallel processes) to use.

Special options:

List the file paths that will be taken into account,given the provided filtering options.

SEE ALSO

The full documentation fordirhashis maintained as a Texinfo manual. If theinfoanddirhashprograms are properly installed at your site, the command

info dirhash

should give you access to the complete manual.

December 2021 dirhash 0.2.1