WHAT(1)
π WHAT(1) β bestie's guide to sniffing out binary ID strings
okay so real talk, this is the what page from the Korn shell utilities crew, and it's genuinely one of the most underrated little gremlins in your toolbox π«Ά
β¨ SYNOPSIS β¨
what [ options ] [ file ... ]
that's it. that's the whole vibe check. options optional, files optional, chaos always welcome π
πΈ DESCRIPTION πΈ
so what goes digging through the files you hand it, looking for every single occurrence of the identification pattern @(#) or $Id: β those little breadcrumb strings that live inside binaries and source files, iykyk π
when it finds one, it writes a line to standard output with all the text that comes after the pattern⦠up until it hits the first one of these little party-poopers:
" < > \ $ newline NUL
literally any of those and the line is done, no cap. that's the natural stopping point π₯
and here's the cute part β if you don't give it any file at all, or if one of your files is -, then it just reads from standard input like a good little bestie π₯Ί
also, for each input file it prints the name of the file, followed by a :, on its own separate line to standard output. so you always know which file you're looking at. main character energy for your filenames honestly π
π OPTIONS π
-m,--matchedβ only lists the names of the files that actually match the identification pattern. no text, no extra lore, just receipts π§Ύβ¨-s,--first|singleβ finds only the first occurrence of the pattern in each file and then minds its own business. one and done, periodt π
π¦ EXIT STATUS π¦
0β some matches were found π slay1β otherwise π no matches for you2β option error π you typed something cursed
π SEE ALSO π
(the whole friend group honestly, go say hi π«Ά)
β IMPLEMENTATION β
version
what (AT&T Research) 2012-02-11
author
Glenn Fowler <gsf@research.att.com>
author
David Korn <dgk@research.att.com>
copyright
Copyright (c) 1992-2012 AT&T Intellectual Property
license
http://www.eclipse.org/org/documents/epl-v10.html
aaaand that's the whole page bestie π this cutie pie of a manpage is dated 2012-08-01 β vintage but still iconic, fr fr. go find those @(#) strings, you got this πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: ksh 93vu-bp160.1.33 Β· CPL-1.0 AND EPL-1.0
- opensuse-leap 16.0: ksh 93vu-bp160.1.33 Β· CPL-1.0 AND EPL-1.0
- opensuse-leap 16.0: ksh 93vu-bp160.1.33 Β· CPL-1.0 AND EPL-1.0
- opensuse-leap 16.0: ksh 93vu-bp160.1.33 Β· CPL-1.0 AND EPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms