Grep: Searching for Keywords in a File
Last Updated by Code Sport. Filed under linuxGrep: Find Which Files Contain a Keyword Use the grep command to…
Use the grep command to search within files for a keyword
grep -Ri my_keyword /directory/to_search/
grep "Aug 28 .*2015" /directory/to_search/file_to_search.log |more
Where:
-
indicates that directive options will followR
read all files under the directoryi
. Grep is case sensitive by default.*
matches any character for any length|more
Pipe output “into more” and press Enter to see more results