Grep Flashcards

1
Q

Grep: how to search for “search” in file?

A

grep search filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Grep: how to ignore case?

A

-i

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Grep: how to search recursively?

A

-r
or
-R

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Grep: how to search for whole word only?

A

-w

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Grep: how to search for two different words?

A

grep -w ‘word1|word2’ filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Grep: how to list filenames of matches only?

A

-l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly