whereis Command Purpose Locates source, binary, or manual for program. Syntax whereis [ -s ] [ -b ] [ -m ] [ -u ] [ { { -S | -B | -M } Directory ... }... -f ] File ... Description The whereis command locates the source, binary, and manuals sec- tions for specified files. The supplied names are first stripped of leading path name components and any (single) trailing exten- sion of the form .ext (for example, .c). Prefixes of s. result- ing from use of the Source Code Control System (see SCCS) are also dealt with. The command then attempts to find the desired program from a list of standard locations. A usage message is returned if a bad option is entered. In other cases, no diagnostics are provided. Flags If any of the -b, -s, -m or -u flags are given, the whereis com- mand searches only for binary, source, manual, or unusual sec- tions respectively (or any two thereof). -b Searches for binary sections of a file. -m Searches for manual sections of a file. -s Searches for source sections of a file. -u Searches for unusual files. A file is said to be unusual if it does not have one entry of each requested type. The -B, -M, and -S flags can be used to change or otherwise limit the places where the whereis command searches. Since the program uses the chdir subroutine to run faster, path names given with the -M, -S and -B flag directory list must be full; for example, they must begin with a / (slash). -B Like -b, but adds a directory to search. -M Like -m, but adds a directory to search. -S Like -s, but adds a directory to search. -f Terminates the last -M, -S or -B directory list and signal the start of file names. Examples 1. To find files in the current directory that have no documenta- tion, enter: whereis -m -u * 2. To find all of the files in the /usr/ucb directory that either are not documented in the /usr/man/man1 directory or do not have source in the /usr/src/cmd directory, enter: cd /usr/ucb whereis -u -M /usr/man/man1 -S /usr/src/cmd -f * Implementation Specifics This command is part of Base Operating System (BOS) Runtime. Files /usr/share/{doc, man}/* Location of manuals for programs /lib, /etc, /usr/{lib,bin,ucb,lpp} Locations of program files. Related Information The chdir subroutine.