Using the Linux whereis Command

The `whereis` command is used to locate the location of the executable file, source code file, and help document file for a specified command.

Use proper grammar.

whereis [选项] [命令名]

Common options include:

  1. -b: search only for executable files.
  2. -m: Only search for help documentation files.
  3. -s: Search only in source code files.
  4. u: search for files that do not contain a specified command.

Original: 我们需要尽快解决这个问题。
Paraphrased: We need to resolve this issue as soon as possible.

  1. Locate the command ls:
whereis ls
  1. Only search for executable files and help documentation files.
whereis -bm ls
  1. Search for files that do not contain the specified command.
whereis -u ls

It is important to note that the whereis command can only be used for commands that have already been installed, and does not work for user-defined scripts or commands.

bannerAds