grep
Search for pattern in files using system grep.
Args:
pattern: Pattern to search for
paths: File or directory paths to search in (string or list of strings)
ignore_case: Case-insensitive matching (-i)
before_context: Number of lines before match (-B)
after_context: Number of lines after match (-A)
context: Number of context lines around match (equal before/after)
max_count: Stop after N matches (-m)
fixed_strings: Treat pattern as literal text, not regex (-F)
recursive: Search directories recursively (-r)
regexp: Use regular expressions for pattern matching
invert_match: Select non-matching lines (-v)
line_number: Show line numbers (-n)
file_pattern: Pattern to filter files (e.g., "*.txt")
Returns:
JSON string with search results