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

Detailed introduction to MySQL database index

Table of contents Mind Map Simple understanding E...

Basic usage of JS date control My97DatePicker

My97DatePicker is a very flexible and easy-to-use...

Detailed explanation of the difference between in and exists in MySQL

1. Prepare in Advance For your convenience, I cre...

Simple steps to encapsulate components in Vue projects

Table of contents Preface How to encapsulate a To...

Using shadowsocks to build a LAN transparent gateway

Table of contents Install and configure dnsmasq I...

How to expand the disk space of Linux server

Table of contents Preface step Preface Today I fo...

Detailed explanation of how to gracefully delete a large table in MySQL

Preface To delete a table, the command that comes...

The textarea tag cannot be resized and cannot be dragged with the mouse

The textarea tag size is immutable Copy code The c...

Shtml Concise Tutorial

Shtml and asp are similar. In files named shtml, s...

How to quickly modify the host attribute of a MySQL user

When you log in to MySQL remotely, the account yo...

Detailed explanation of Vue two-way binding

Table of contents 1. Two-way binding 2. Will the ...

Use docker to deploy tomcat and connect to skywalking

Table of contents 1. Overview 2. Use docker to de...

Example analysis of the impact of MySQL index on sorting

This article uses examples to illustrate the impa...

Several methods of implementing two fixed columns and one adaptive column in CSS

This article introduces several methods of implem...