Detailed explanation of whereis example to find a specific program in Linux

Detailed explanation of whereis example to find a specific program in Linux

Linux finds a specific program where is

The whereis command is mainly used to find program files and provide the storage location of the binary executable file, source code file, and user manual of this file.

1. Find command program

For example, look for the touch command

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

The execution effect is as follows:

If you only need to find the binary file of the touch command, you can use the -b option:

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

The effect is as follows:

2. Find the application

For example, find the nginx service

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

Find java

[root@node1 /]# whereis java
java: /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, to find the hello program

[root@node1 /]# whereis hello
hello:

The above are all the relevant knowledge points introduced this time. Thank you for your learning and support for 123WORDPRESS.COM.

You may also be interested in:
  • The difference between Linux command search commands whereis and which
  • A Linux command every day whereis command

<<:  Tutorial on installing mysql under centos7

>>:  MySQL Advanced Learning Notes (Part 3): Introduction to MySQL Logical Architecture, Detailed Explanation of MySQL Storage Engine

Recommend

Do you know why vue data is a function?

Official website explanation: When a component is...

A QQ chat room based on vue.js

Table of contents Introduction The following is a...

Nginx learning how to build a file hotlink protection service example

Preface Everyone knows that many sites now charge...

Using CSS3's 3D effects to create a cube

Learning to use CSS3's 3D effects to create a...

JS cross-domain solution react configuration reverse proxy

Cross-domain solutions jsonp (simulate get) CORS ...

Hbase installation and configuration tutorial under Linux

Table of contents Hbase installation and configur...

Minimalistic website design examples

Web Application Class 1. DownForEveryoneOrJustMe ...

Upgrade MySQL 5.1 to 5.5.36 in CentOS

This article records the process of upgrading MyS...

Detailed explanation of the principle of creating tomcat in Eclipse

When creating a tomcat server on a local eclipse,...

Detailed explanation of the JVM series memory model

Table of contents 1. Memory model and runtime dat...

Graphical tutorial on installing JDK1.8 under CentOS7.4

Linux installation JDK1.8 steps 1. Check whether ...