Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux finds specific program whereis examples in detail

Shulou Source: shulou.com Published: 2022-06-02 00:58:15 10月02日 Update

Linux finds a specific program whereis

The whereis command is mainly used to find the program file and provide the location of the file's binary executable, source code files, and user manuals.

1. Find the command program

For example, find the touch command

[root@node1 /] # whereis touchtouch: / usr/bin/touch / usr/share/man/man1/touch.1.gz

The execution results are as follows:

If you only need to find the binaries of the touch command, you can use the-b option to do this:

[root@node1 /] # whereis-b touchtouch: / usr/bin/touch

The effect is as follows:

2. Find the application

For example, find a nginx service

[root@node1 /] # whereis nginxnginx: / usr/sbin/nginx / usr/lib64/nginx / etc/nginx / usr/share/nginx / usr/share/man/man8/nginx.8.gz

Find java

[root@node1 /] # whereis javajava: / usr/java/jdk1.8.0_191/bin/java / usr/local/jdk1.8.0_191/bin/java

If the queried program does not exist, an empty string is returned.

For example, find the hello program

[root@node1 /] # whereis hellohello:

These are all the relevant knowledge points of this introduction. Thank you for your study and support.

Tags: Programs files commands binaries effects locations that is applications manuals source code knowledge knowledge points empty characters learning application support services queries instances Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei OPPO Reno vpn Microsoft