It is possible that you have used the commands which, whereis, and whatis multiple times on Linux.. All three commands are used to find information about other Linux commands. These commands look similar, but they do have some differences.
#The following is a detailed comparison of which, whereis and whatis commands on Linux.
which command
Some commands have multiple executable files in different directories. The Shell will search for executable files in the folder specified by the PATH environment variable to run the corresponding command.
To find the directories contained in the PATH environment variable, run the following command in a Linux terminal:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ echo $PATH
Tip: You can also manually add directory to your PATH environment variable.
As soon as the first executable path is found in Linux, the shell will execute it immediately. Using the which command you can determine the path to the executable file.
It can be useful in this situation: when two identical programs with different versions are installed on your system, or two software with the same name but different programs are installed. Using the which command you can find out which one will be executed first.
The following is the syntax of the which command:
which [选项] [命令]
For example, to check the actual path of the tar command, you can enter:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ which tar
This command will display the first executable path of the tar command in PATH, which is located in /usr/bin. Every time you run the tar command, the binary file located in the /usr/bin directory is executed by the shell, and this is what it means.
To display all available executable paths for a command, use the which command with the -a option:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ which -a tar
You can also display multiple commands at the same time The executable path is as follows:
which [命令1] [命令2] [命令3]
whereis command
whereis command can display the executable files, source code files and manual page files related to the specified command path of. Unlike the which command, it searches not only $PATH for executable files, but also $MANPATH and other predefined locations.
Without any command line options, the whereis command displays the binary files, source files, and manual page files for the command:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ whereis tar
To display only the binary files path, use the -b option:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ whereis -b tar
To display only source files, use the -s flag:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ whereis -s tar
To display only manual pages, use the -m option:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ whereis -m tar
whatis command
The whatis command provides a one-line description of a given Linux command. It gets this information from the command's man page.
For example, to find out what the tar command does, run:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ whatis tar
You can also find information about multiple commands at the same time, for example:
┌──(linuxmi㉿linuxmi)-[~/www.linuxmi.com]└─$ whatis ls cp mkdir cat head
#What is the difference between which, whereis and whatis?
If you need to find the executable path of a command in the shell, try using the which command. Use the whereis command to find source files, binaries, and man pages for a command. The
whereis command lists all binary executable files, while the which command displays only the first executable file that is executed when the command is entered in the shell.
which command searches in the PATH variable, while whereis command searches in standard Linux directories, including $PATH and $MANPATH.
Finally, the whatis command will extract a short description from the command's man page.
Find information about Linux commands
The which, whereis and whatis commands can help you find information about other Linux commands, such as the full path of the executable file, binary files, source files, manual pages, and the function of the command .
In addition to whatis command, you can also use other commands such as apropos, man, info and help to get detailed information and better understanding about Linux commands and their functions.
The above is the detailed content of Linux mystery showdown: which vs. whereis vs. whatis. For more information, please follow other related articles on the PHP Chinese website!

NGINXUnit can be used to deploy and manage applications in multiple languages. 1) Install NGINXUnit. 2) Configure it to run different types of applications such as Python and PHP. 3) Use its dynamic configuration function for application management. Through these steps, you can efficiently deploy and manage applications and improve project efficiency.

NGINX is more suitable for handling high concurrent connections, while Apache is more suitable for scenarios where complex configurations and module extensions are required. 1.NGINX is known for its high performance and low resource consumption, and is suitable for high concurrency. 2.Apache is known for its stability and rich module extensions, which are suitable for complex configuration needs.

NGINXUnit improves application flexibility and performance with its dynamic configuration and high-performance architecture. 1. Dynamic configuration allows the application configuration to be adjusted without restarting the server. 2. High performance is reflected in event-driven and non-blocking architectures and multi-process models, and can efficiently handle concurrent connections and utilize multi-core CPUs.

NGINX and Apache are both powerful web servers, each with unique advantages and disadvantages in terms of performance, scalability and efficiency. 1) NGINX performs well when handling static content and reverse proxying, suitable for high concurrency scenarios. 2) Apache performs better when processing dynamic content and is suitable for projects that require rich module support. The selection of a server should be decided based on project requirements and scenarios.

NGINX is suitable for handling high concurrent requests, while Apache is suitable for scenarios where complex configurations and functional extensions are required. 1.NGINX adopts an event-driven, non-blocking architecture, and is suitable for high concurrency environments. 2. Apache adopts process or thread model to provide a rich module ecosystem that is suitable for complex configuration needs.

NGINX can be used to improve website performance, security, and scalability. 1) As a reverse proxy and load balancer, NGINX can optimize back-end services and share traffic. 2) Through event-driven and asynchronous architecture, NGINX efficiently handles high concurrent connections. 3) Configuration files allow flexible definition of rules, such as static file service and load balancing. 4) Optimization suggestions include enabling Gzip compression, using cache and tuning the worker process.

NGINXUnit supports multiple programming languages and is implemented through modular design. 1. Loading language module: Load the corresponding module according to the configuration file. 2. Application startup: Execute application code when the calling language runs. 3. Request processing: forward the request to the application instance. 4. Response return: Return the processed response to the client.

NGINX and Apache have their own advantages and disadvantages and are suitable for different scenarios. 1.NGINX is suitable for high concurrency and low resource consumption scenarios. 2. Apache is suitable for scenarios where complex configurations and rich modules are required. By comparing their core features, performance differences, and best practices, you can help you choose the server software that best suits your needs.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.