Learning Grep Flashcards
What is Grep
Grep is a command in Linux that is used to display a specified character in a line of output
Grep command options
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.