Formatted all pages according to guidelines.
This commit is contained in:
@@ -1,36 +1,36 @@
|
||||
# grep
|
||||
|
||||
> Matches patterns in input text
|
||||
> Supports simple patterns and regular expressions
|
||||
> Matches patterns in input text.
|
||||
> Supports simple patterns and regular expressions.
|
||||
|
||||
- search for an exact string
|
||||
- Search for an exact string:
|
||||
|
||||
`grep {{something}} {{file_path}}`
|
||||
|
||||
- search recursively in current directory for an exact string
|
||||
- Search recursively in current directory for an exact string:
|
||||
|
||||
`grep -r {{something}} .`
|
||||
|
||||
- use a regex
|
||||
- Use a regex:
|
||||
|
||||
`grep -e {{^regex$}} {{file_path}}`
|
||||
|
||||
- see 3 lines of context
|
||||
- See 3 lines of context:
|
||||
|
||||
`grep -C 3 {{something}} {{file_path}}`
|
||||
|
||||
- print the count of matches instead of the matching text
|
||||
- Print the count of matches instead of the matching text:
|
||||
|
||||
`grep -c {{something}} {{file_path}}`
|
||||
|
||||
- print line number for each match
|
||||
- Print line number for each match:
|
||||
|
||||
`grep -n {{something}} {{file_path}}`
|
||||
|
||||
- use the standard input instead of a file
|
||||
- Use the standard input instead of a file:
|
||||
|
||||
`cat {{file_path}} | grep {{something}}`
|
||||
|
||||
- invert match for excluding specific strings
|
||||
- Invert match for excluding specific strings:
|
||||
|
||||
`grep -v {{something}}`
|
||||
|
Reference in New Issue
Block a user