tlsh_unittest(1)
π tlsh_unittest β the Debian manual page, but make it a group chat π
okay bestie, listen. you know tlsh_unittest(1)? that's the page we're doing today, and it's genuinely iconic. it computes TLSH digest values and it computes the distance between them. that's the whole vibe. let's get into it π¦
β¨ NAME β¨
tlsh_unittest β compute TLSH digest values and distance. that's it. that's the girl. π
πΈ SYNOPSIS πΈ
five whole moods, and every single one of them is valid:
tlsh_unittest [-c <file|digest>] -f <file> [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest -c <file|digest> -d <digest> [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest [-c <file|digest> | -xref] -r <dir> [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest [-c <file|digest> | -xref] -l <listfile> [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest -version
like. pick your fighter. they're all serving. π
π DESCRIPTION π
so tlsh_unittest is the bestie who either computes TLSH digest values or measures the distance between digest values. and it does it in three distinct ways, no cap:
- just compute the digest, babe β you give it a single file (
-f file) or a whole directory of files (-r dir), and it spits out the TLSH digest value. pro tip from the original page: this output can be used to create the listfile required by the-loption described further down. foreshadowing. we love her. β¨ - the comparison arc β you feed it a comparison file or TLSH digest (
-c <file|digest>) and it measures the distance against whichever thing you picked: a specified file (-f file), a TLSH digest (-d digest), a directory of files (-r dir), or a list (-l listfile). it's giving matchmaker. π«Ά - the xref era β you turn on
-xrefand it computes the distance between every element in a set and every other element in that set. that's the files in a directory (-r dir) or the files/digests in a list (-l listfile). everyone gets compared to everyone. it's a whole social network. π
π OPTIONS π
-c <file|digest>β names a filename or a digest whose TLSH value is gonna get compared to... something. which something? glad you asked. it could be a specified TLSH digest (-d), OR the TLSH value of a specified file (-f), OR the TLSH values of the files in a specified directory (-r), OR the TLSH values in a specified listfile (-l). main character energy, honestly. π-xrefβ this is the one that calculates the distance between each element in the set and every other element in the set. only usable when you've specified a set of files (-r dir) or TLSH values (-l listfile). it needs a crowd, bestie, it doesn't do solo performances. π-f fileβ names a file whose TLSH values are to be computed, or used for comparison when you passed-c <file|digest>. one file. one job. we respect it. π-d digestβ hands over a TLSH digest value that gets compared to the comparison file or digest you specified with-c <file|digset>. (yes, the original page writesdigsetright there β we're keeping it exactly as written, that's a canon typo and it's lowkey iconic π)-r dirβ recursive directory search, babes. finds files whose TLSH values are to be computed, or used for comparison (-c <file|digset>or-xref). it goes deep. π§-l listfileβ for comparison purposes only (-c <file|digset>or-xref). and here's the tea, every line in listfile can hold either of these two formats:- a TLSH digest value β and then the comparison output will display TLSH digests
- a tab separated TLSH digest value and its corresponding filename β and then the comparison output will display filenames
and where do you get a tab separated listfile, you ask? you generate it by running tlsh_unittest with either the -f or -r flag. see? told you it was foreshadowing. π
-xlenβ this one determines whether the lengths of the compared files get included in determining the distance. yes, size matters, that's literally the flag. π-detailsβ gives you extra detailed output. more lore. more content. we're obsessed. π₯-T threshold_valueβ only used during comparisons (-c <file|digset>or-xref). it specifies the maximum distance a comparison must generate before it gets reported. and the default?9999. so it's the "don't talk to me unless it's at least this dramatic" setting. π-versionβ yeah, it's in the synopsis. just show me the version, king. π
β EXAMPLE β
calculate the distance between two files:
tlsh_unittest -c <file 1> -f <file 2>
calculate the distance between two TLSH digest values:
tlsh_unittest -c <TLSH digest 1> -d <TLSH digest 2>
calculate the TLSH digest values for every file in a directory. (this creates input for the -l option, no big deal):
tlsh_unittest -r <dir>
get the distance between a reference TLSH digest value, and a list of TLSH digest values in a file:
tlsh_unittest -c <TLSH digest> -l <file>
compare the TLSH value for every file in a directory, to every other file in that directory:
tlsh_unittest -xref -r <dir>
π¦ NOTES π¦
this man page has been adapted from tlsh_unittest usage output for the Debian project. so it's a glow-up of the original, basically. β¨
π AUTHOR π
JΓ©rΓ©my Bobbio <lunar@debian.org> β thank you for your service, legend. π«‘π
πΈ COPYRIGHT πΈ
Apache-2.0
and that's the whole page, bestie. this was the tlsh_unittest(1) manual from Debian, and yes, we kept the entire thing β every flag, every default, every typo, every <file|digset> β because the facts do not change even when the vibe is immaculate. slay, go compute some digests. π
β¨ππ¦πΈπ«Άπ₯πππππ§π
π¦ where this page comes from
- ubuntu resolute: tlsh-tools 4.12.1+ds-1build1 Β· Apache-2.0 OR BSD-3-clause
- ubuntu stonking: tlsh-tools 5.0.0+ds-1 Β· Apache-2.0 OR BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms