what(1)

what1

Show what versions of object modules were used to construct a file

Usage

what [-s] file ...

Overview

what reads each file and searches for sequences of either the form ‘$’ immediately followed by the system name (sysname) as defined by uname(3), or the form “@(#)” as inserted by the source code control system (SCCS).

When ‘$’ followed by the system name is encountered, what prints the remainder of the string up to a ‘$’ or any non-printable character.

When “@(#)” is encountered what prints the remainder of the string, up to a NUL, newline, double quote, backslash, or ‘>’ character.

If the -s option is specified, only the first occurrence of an identification string in each file is printed.

Exit status

The what utility exits with a return value of 0 if any identification strings were found, or with a return value of 1 otherwise.

Releases

61 releases since OpenBSD 2.1; the text changed 14 times.

  1. 2.1–2.4
  2. 2.5
  3. 2.6
  4. 2.7–2.8
  5. 2.9–3.3
  6. 3.4–4.0
  7. 4.1
  8. 4.2–4.7
  9. 4.8
  10. 4.9–5.4
  11. 5.5
  12. 5.6
  13. 5.7–6.4
  14. 6.5–7.0
  15. 7.1–8.0

Standards

The what utility is compliant with the X/Open System Interfaces option of the IEEE Std 1003.1-2008 (“POSIX.1”) specification.

Processing $sysname$ sequences is an OpenBSD extension.

History

The what command first appeared in the SCCS package and was rewritten for 4.0BSD for licensing reasons.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.