1. Find
Find is the most common and powerful look-up command you can use to find any file you're looking for. Find uses the following format: $ find<Specify directory> <Specify Criteria> <Specify an action>-<Specify directory>: The directory to search for and all its subdirectories. The current directory is assumed by default. - <Specify Criteria>: The characteristics of the file you are searching for. - <Specify an action>: Specific processing of search results. If no parameters are added, find searches the current directory and its subdirectories by default, and does not filter any results (that is, all files are returned) and displays them all on the screen. Example of use of find: $ find. -name ' my* ' searches the current directory (with subdirectories, below), all files with the file name beginning with my. $ find. -name ' my* '-ls searches the current directory for all files with the file name beginning with my, and displays their details. $ find. -type f-mmin-10 searches the current directory for all the normal files that have been updated in the last 10 minutes. If you do not add the-type f parameter, search for normal files + special files + directories.
View Code
2. Whereis
The Whereis command can only be used for program name searches, and only binary files (parameter-B), man description file (parameter-m), and source code file (parameter-s) are searched. If the argument is omitted, all information is returned. Example of use of the Whereis command: $ whereis grep
3. Which
The purpose of the which command is to search for the location of a system command in the path specified by the path variable, and return the first search result. That is, with the which command, you can see whether a system command exists, and the command that executes exactly which location. Example of use of the which command: $ which grep