Note: The default installation directory of general software in /usr/local or/opt, you can go there to find.
Directive Name: Whereis
Features: Find eligible files in a specific directory. The strong of these files should belong to the original code, binary files, or Help files.
Syntax format: Whereis [-bfmsu][-b < catalogue; ...] [-M < catalogue; ...] [-s < directory;] [File ...]
Common parameter Description:
-B finds only binary files.
-B < directory > finds binaries only in the set directory.
-F does not display the path name before the file name.
-M finds only the description file.
-M < directory > Find the description file only in the directory you set.
-S finds only the original code file.
-S < directory > find the original code file only in the directory you set.
-U finds files that do not contain the specified type.
Application: #whereis software name--View Software Installation path
#which software Name--The running path of software software
The first thing to determine is whether it is installed through the Package Manager or through the source code.
One, the software installed through the RPM Package Manager :
1. RPM Package
You can use the command:
#rpm –QL package name such as RPM-QL GCC to see where the GCC files are installed.
#rpm-qa | grep package name to see if this package is installed,
#rpm-QA View all installed package names
2. Deb Pack
You can use the command:
#dpkg-L package name to view GCC files such as dpkg-l gcc.
#dpkg-L | grep package name to see if a package is installed,
# dpkg-l is a view of all packages
Ii. software installed through the source code:
1.If it is installed through the source code, in the Configure of the source code, there will be parameters for you to specify the installation directory, specifically in the makefile file of the install target (may also be *install* target, * for any character). For example, the following makefile file's install target:
Install-binprograms: $ (bin_programs)
@$ (Normal_install)
$ (mkinstalldirs) $ (DESTDIR) $ (BINDIR)
@list = ' $ (bin_programs) '; For p in $ $list; Do \
If test-f $ $p; Then \
echo "$ (Install_program) $ $p $ (DESTDIR) $ (bindir)/' echo $ $p |sed ' s/$ (exeext) $$//' |sed ' $ (transform) ' |sed ' s/$$/$ ( Exeext)/' "; \
$ (Install_program) $ $p $ (DESTDIR) $ (bindir)/' echo $ $p |sed ' s/$ (exeext) $$//' |sed ' $ (transform) ' |sed ' s/$$/$ (exeext)/' ; \
else:; Fi \
Done
is a script that copies the executable file to the directory represented by the $bindir variable, which is defined in the code in front of the makefile, where I define
prefix =/usr/local
Exec_prefix = ${prefix}
Bindir = ${exec_prefix}/bin
That's/usr/local/bin below.
2,Finally, if it is already installed, it can be called directly, to see if its path is well-done.
For example, I use the GCC command, I want to see the directory location of the GCC command, you can use the following command to query
[Email protected] ~]$ Whereis gcc
GCC:/usr/bin/gcc/usr/lib/gcc/usr/libexec/gcc/usr/share/man/man1/gcc.1.gz
A Whereis command is queried to the location.
CentOS Software Installation directory lookup