English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux whereis command is used to find files.
This command will search for files that meet the criteria in a specific directory. These files should be original code, binary files, or help files.
This command can only be used to locate binary files, source code files, and man pages. The location of general files usually requires the use of the locate command.
whereis ...-bfmsu...-B <Catalog>...-M <directory>...][-S <directory>...][file...]
Parameters:
Use the instruction "whereis" to view the location of the instruction "bash", enter the following command:
$ whereis bash
After executing the above command, the output information is as follows:
bash:/bin/bash/etc/bash.bashrc/usr/share/man/man1/bash.1.gz
Note: The output information above is from left to right, respectively, the name of the queried program, the path of bash, and the path of the bash manual page.
If the user needs to query the binary file or help file separately, the following command can be used:
$ whereis -b bash $ whereis -m bash
The following output information is as follows:
$ whereis -b bash # Display the binary program of bash command bash: /bin/bash /etc/bash.bashrc /usr/share/bash # Address of the binary program of bash command $ whereis -m bash # Display the help file of bash command bash: /usr/share/man/man1/bash.1.gz # Address of bash command help file