WHAT(1)

πŸ“¦ version 93vu, in opensuse-leap 16.0

πŸ’… 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 πŸŽ‰ slay
  • 1 β€” otherwise 😭 no matches for you
  • 2 β€” 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 (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