command lines in this article assumes zsh.
whatis(1)
whatis - display one-line manual page descriptions. useful options:
-r--regex: interpret each keyword as a regex-w--wildcard: keyword(s) contain wildcards
1 | $ whatis gcc |
which(1)
In zsh, this is a shell built-in command:, equivalent to whence -c. In bash, this is /usr/bin/which.
Useful options (for /usr/bin/which):
-a: print all matching pathnames of each argument
1 | $ whatis which |
whence
whence is a zsh built-in command. Useful options:
-w: For each name, print ‘name: word’ where word is one of alias, builtin, command, function, hashed, reserved or none-f: Causes the contents of a shell function to be displayed-p: Do a path search for name even if it is an alias, reserved word, shell function or builtin.-a: Do a search for all occurrences of name throughout the command path.-m: The arguments are taken as patterns (should be quoted)-c: Print the results in a csh-like format. e.g.whichin zsh.
where
where is a zsh built-in command, equivalent to whence -ca.
1 | $ where grep |
whereis(1)
whereis - locate the binary, source, and manual page files for a command.
Note: the supplied names are first stripped of leading pathname components and any (single) trailing extension.
Useful options:
-b: Search only for binaries-m: Search only for manual sections-s: Search only for sources
1 | $ whereis stdio |
type
type is a shell built-in command, equivalent to whence -v.
Bash shell also has this command with equivalent functionality.
1 | $ type zsh |
apropos(1)
apropos - search the manual page names and descriptions.
Each manual page has a short description available within it. apropos searches the descriptions for instances of keyword. Keywords are regex by default.
Useful options:
-r,--regex: Interpret each keyword as a regular expression. This is the default behaviour-w,--wildcard: Interpret each keyword as a pattern containing shell style wildcards-L locale,--locale=locale
1 | $ apropos '^std' |