Home > Operation and Maintenance > Linux Operation and Maintenance > How to check which directory the installed software is in in Linux

How to check which directory the installed software is in in Linux

WBOY
Release: 2022-06-22 17:01:17
Original
7428 people have browsed it

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".

How to check which directory the installed software is in in Linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to check which directory the installed software is in in Linux

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 <目录>...][文件...]
Copy after login

Parameters:

  • -b Only searches for binary files.

  • -B 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.

  • -M Only search for description files in the set directory.

  • -s Only search original code files.

  • -S 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
Copy after login

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
Copy after login

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
Copy after login

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命令的帮助文件地址
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template