Whereis < Program name >
Find [path] < expressions >
Locate < file name >
Find the line matching the specified string from the file contents:
$ grep "string found" file name
Find the line that matches the regular expression from the file contents:
$ grep–e "Regular expression" file name
Find is case insensitive:
$ grep–i "string found" file name
To find the number of matching rows:
$ grep-c "string found" file name
Find rows that do not match the specified string from the file contents:
$ grep–v "string found" file name
From the root directory, look for all text files with a. log extension and find the line that contains "ERROR"
Find/-type f-name "*.log" | Xargs grep "ERROR"
The system immediately displays httpd.conf file information on the screen after finding the httpd.conf file.
Find/-name "httpd.conf"-ls
Find a file under the root directory
Find. -name "Test"
Find a file containing a string in a directory
Grep-r "ZH_CN".
Linux find files or content common commands