find file containing specific string content
General Command Syntax
grep -r [string] [directory]Explanation:
Example 1: Search for a String in All Files
grep -r "CONFIG_OPTION" /home/user/aospExample 2: Search for a String in Files with a Specific Format
Example 3: Ignore Case Sensitivity
Example 4: Display Only File Names (No Content)
Example 5: Exclude Specific Paths
Example 6: Use Regular Expressions for Patterns
Example 7: Limit Search to a Specific Depth
Output Format
Last updated