Learning Grep Flashcards

1
Q

What is Grep

A

Grep is a command in Linux that is used to display a specified character in a line of output

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

Grep command options

A

Grep “character”
Grep “character” * - search in the current directory

Grep -i “character “ - for case insensitive

Grep - c “ character “ - number of lines present

Grep -ci “character “ - number of lines for case insensitive

Grep -n “character” - to see which number line the pattern is present

Grep -v “character” - display where that pattern is not present

Grep -l “character” * - to know the file that the pattern is present (the star is to search in the current directory.

Grep -i “character” - only output the pattern(don’t give complete line)

Grep –color “character” - display pattern but colored.

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