- Locate file name
- Search by file name in the background database, search faster
- Background database location for search/var/lib/mlocate
- The background database defaults to an update one day, you can force the update by using the command updatedb
- The difference between which and Whereis commands
- which + command (search for command path and alias)
- Whereis + command (the path where the search command is located and the location of the help document)
- Simply put, the Whereis command searches for more information than the which command.
- $PATH system-defined environment variables
- You can use the Echo $PATCH to view its value
- Find [Search scope] [search criteria]
- Use the Find command when the best range is accurate, otherwise it consumes too much system resources
- The find command can use a wildcard character
- * Match any Content
- ? Match any one character
- [] matches any one of the characters in brackets
- Some of the specific options involved, you can check the Help document yourself
- As an example,
- sudo find/etc-size +20k-a-size-50k-mtime +10
- Files that are larger than 20k and less than 50k and have been modified 10 days ago in the ETC directory
- grep [Options] string file name
- Note that the grep command can also use regular expression matches, while the locate command cannot
Linux File Search command