Linux finds specific program whereis examples in detail
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.