In Linux, you can use the whereis command to view the software installation path. This command is used to find files. If you use this command to find uninstalled software, the path will not be displayed. The syntax is "whereis specifies the software name".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
1. Check the software installation path:
Linux software is installed in more than one place. Let’s check the software first. All paths (addresses) of the installation.
Here is Mysql as an example. For example, I installed Mysql, but I don’t know where the files are installed and in which folders. You can use the following command to view all file paths.
whereis MySQL
Press Enter. If you have installed Mysql, the address of the file installation will be displayed. For example, my display (the installation address may be different)
mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
It can be seen that mysql is installed in in these directories.
If you do not install mysql, the file path will not be displayed.
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 pages. Generally, you need to use the locate command to locate files.
Syntax
whereis [-bfmsu][-B <目录>...][-M <目录>...][-S <目录>...][文件...]
Parameters:
-b Only search binary files.
-B
#-f Does not display the path name before the file name.
-m Only search for documentation.
-M
-s Only search original code files.
-S
-u Find files that do not contain the specified type.
2. Query the path of the running file:
If you only want to query the address of the running file of the file, just use the following command. (still taking Mysql as an example):
which MySQL
The result will show:
/usr/bin/MySQL
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of How to check software installation path in Linux. For more information, please follow other related articles on the PHP Chinese website!