Linux whereis command details how to use Linux whereis command

Source: Internet
Author: User

This command searches for files that meet the conditions in a specific directory. These files should belong to the original code, binary files, or help files.

This command can only be used to find binary files, source code files, and man manual pages. Generally, the locate command is used to locate files.

Syntax

Whereis [-bfmsu] [-B <Directory>...] [-M <Directory>...] [-S <Directory>...] [File...]

Parameters:

  • -B only searches for binary files.

  • -B <Directory> searches for binary files only in the set directory.

  • -F does not display the path name before the file name.

  • -M: only find the description file.

  • -M <Directory> searches for description files only in the specified directory.

  • -S only searches for original code files.

  • -S <Directory> only searches for original code files in the set directory.

  • -U searches for files that do not contain the specified type.

Instance

Run the following command to view the location of the command bash:

$ Whereis bash

After the preceding command is executed, the output information is as follows:

Bash:/bin/bash/etc/bash. bashrc/usr/share/man/man1/bash.1.gz

Note: The above output information is the queried program name, bash path, and bash man manual page path from left to right.

To query binary or help files separately, run the following command:

$ Whereis-B bash

$ Whereis-m bash

The output information is as follows:

$ Whereis-B bash # display the binary program of the bash command

Bash:/bin/bash/etc/bash. bashrc/usr/share/bash # address of the bash command binary program

$ Whereis-m bash # display the help file of the bash command

Bash:/usr/share/man/man1/bash.1.gz # bash command help file address

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.