1.

What is the function of grep command?

Answer»

GREP (Global regular expression print) is a COMMAND that is USED to the global search for a string of characters in a specified file. The text search PATTERN is generally KNOWN as a regular expression. It simply makes use of pattern-based searching.  

Syntax: grep [options] pattern [files] 
Example: $ grep -c "linux" interview.txt   

The above command will usually print the total count of the word “Linux” in the file “interview.txt”. 



Discussion

No Comment Found