WHAT(1P)
π what(1P) β the POSIX Programmer's Manual one, bestie π
okay so before we even start, a lil heads up because this is the POSIX Programmer's Manual version of what, and she comes with a whole situation:
PROLOG β This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
like. it might not even exist on your Linux. rude but true. moving on π«Ά
β¨ NAME β¨
what β identify SCCS files (DEVELOPMENT)
πΈ SYNOPSIS πΈ
what [-s] file...
π¦ DESCRIPTION π¦
okay so here's the tea, bestie. what goes digging through the files you hand it, searching for all occurrences of the pattern that get (yep, see get) swaps in for the %Z% keyword β and that pattern is literally "@(#)". no cap.
Then it writes to standard output whatever follows that pattern, and it keeps going until it hits the first occurrence of one of these lil terminators:
" > newline \ NUL
that's a double quote, a greater-than sign, a newline, a backslash, or a NUL byte. whichever shows up first. periodt. π
π OPTIONS π
The what utility shall conform to the Base Definitions volume of POSIX.1β2017, Section 12.2, Utility Syntax Guidelines. (yes bestie, there are rules. we follow them.)
The following option shall be supported:
-sβ Quit after finding the first occurrence of the pattern in each file. like, she found one, she's done, she's leaving the group chat. bye π
π OPERANDS π
The following operands shall be supported:
fileβ A pathname of a file to search. that's it. that's the whole vibe.
π STDIN π
Not used. she's not reading your keyboard input, bestie. not today.
π INPUT FILES π
The input files shall be of any file type. any. she does not discriminate. icon behavior honestly.
π ENVIRONMENT VARIABLES π
The following environment variables shall affect the execution of what:
LANGβ Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) yes that's a mouthful, i know, i'm just the messenger π«LC_ALLβ If set to a non-empty string value, override the values of all the other internationalization variables. she's the main character, she overrides everyone.LC_CTYPEβ Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files).LC_MESSAGESβ Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.NLSPATHβ Determine the location of message catalogs for the processing ofLC_MESSAGES.
π§ ASYNCHRONOUS EVENTS π§
Default. nothing special, no drama, just vibes. β¨
β STDOUT β
The standard output shall consist of the following for each file operand:
"%s:\n\t%s\n", <pathname>, <identification string>
like. pathname, then a newline, then a tab, then the identification string, then a newline. that's the whole shape of it. slay.
π₯ STDERR π₯
The standard error shall be used only for diagnostic messages. she's not gonna spam it, she's got manners.
π OUTPUT FILES π
None. she writes to stdout and she's done. no files created, no mess, no crumbs. π
πΈ EXTENDED DESCRIPTION πΈ
None. genuinely. that's the whole section. nothing here. moving on bestie π¦
π EXIT STATUS π
The following exit values shall be returned:
0β Any matches were found. yay! we ate!1β Otherwise. π
π CONSEQUENCES OF ERRORS π
Default.
The following sections are informative.
π APPLICATION USAGE π
The what utility is intended to be used in conjunction with the SCCS command get, which automatically inserts identifying information, but it can also be used where the information is inserted by any other means. so like, she doesn't need get, she's flexible, she's adaptable, she's everything.
When the string "@(#)" is included in a library routine in a shared library, it might not be found in an a.out file using that library routine. so don't come for her when that happens, that's just how it is. π
π EXAMPLES π
okay so imagine the C-language program in file f.c contains:
char ident[] = "@(#)identification information";
and f.c is compiled to yield f.o and a.out, then the command:
what f.c f.o a.out
writes:
f.c:
identification information
...
f.o:
identification information
...
a.out:
identification information
...
look at her go. three files, three identifications, zero problems. iconic. β
π§ RATIONALE π§
None. bestie said no thoughts, head empty. π
β FUTURE DIRECTIONS β
None. she's staying exactly how she is. queen behavior.
π SEE ALSO π
get
The Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie π«Ά shoutout to IEEE/The Open Group, 2017 for bringing us WHAT(1P) β we love her, we respect her, we read the manual. periodt. π
β¨
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms