aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cli/grep.md
blob: a2001b9faf121cd95d7aae78290af0308bb3b5dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# grep(1)

```
sort [opts] [pattern] [files]
    -e <pattern>        pattern to search for (can be supplied multiple times)
    -i                  ignore case in patterns
    -v                  invert match

    -n                  add line numbers to matched lines
    -H                  add file name to matched lines

    -r                  recursively read all files
    -I                  skip binary files
    --include <glob>    search only files matching glob
    --exclude <glob>    skip searching files matching glob

    -c                  count occurrence of matched patterns
    -l                  list only file name which contain the pattern
```
> `<glob>` patterns may need to be quoted or escaped if the shell also does glob expansion.