Article Title: file search commands in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Which: Only search for the directory set in the PATH variable and return the directory where the first matching result is located.
% Which bash
/Bin/bash
Whereis: searches not only the directories set in the PATH variable, but also man pages and source files (puzzled ?) It not only returns the location of the program, but also returns where to find help for the program.
Find: You can specify many parameters, such as the Directory and file creation time, to search for files.
Slocate: it is used to search for files in the entire file system. However, unlike find for a real file system, it searches for a database that reflects the file storage structure of the system. This database is set to automatically update every morning, or use the updatedb (1) command to manually update the database.