Home > Article > Operation and Maintenance > How to check which directory the installed software is in in Linux
In Linux, you can use the whereis command to check which directory the installed software is in. This command is used to find files. It will also search for files that meet the conditions in a specific directory, but it can only be used to find binary files. files, source code files and man pages, the syntax is "whereis software name".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
The Linux whereis command is used to find files.
This command will search for files that meet the conditions in a specific directory. These files should be raw code, binary files, or help files.
This command can only be used to find binary files, source code files and man manual pages. Generally, you need to use the locate command to locate files
Syntax
whereis [-bfmsu][-B <目录>...][-M <目录>...][-S <目录>...][文件...]
Parameters:
-b Only searches for binary files.
-B7b799fe73e35dcfdc019b13f54de80e5 Only searches for binary files in the set directory.
-f does not display the path name before the file name.
-m Only search for documentation.
-M7b799fe73e35dcfdc019b13f54de80e5 Only search for description files in the set directory.
-s Only search original code files.
-S7b799fe73e35dcfdc019b13f54de80e5 Only search the original code files in the set directory.
-u Find files that do not contain the specified type.
Example
Use the command "whereis" to view the location of the command "bash", enter the following command:
$ whereis bash
After the above command is executed, output The information is as follows:
bash:/bin/bash/etc/bash.bashrc/usr/share/man/man1/bash.1.gz
Note: The above output information from left to right is the queried program name, bash path, and bash man manual page path.
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 output information is as follows:
$ whereis -b bash #显示bash 命令的二进制程序 bash: /bin/bash /etc/bash.bashrc /usr/share/bash # bash命令的二进制程序的地址 $ whereis -m bash #显示bash 命令的帮助文件 bash: /usr/share/man/man1/bash.1.gz #bash命令的帮助文件地址
Recommended learning: Linux video tutorial
The above is the detailed content of How to check which directory the installed software is in in Linux. For more information, please follow other related articles on the PHP Chinese website!