What is GREP ?
The grep filter searches a file for a particular pattern of characters, and displays all lines that contain that pattern. GREP stands for Global regular expression print .
To see the help menu of GREP you have to use this command -:
So, this is the basic syntax of grep. Firstly grep then followed by an option then pattern of the file or text to match then the file name.
grep [OPTION...] PATTERNS [FILE...] grep [OPTION...] -e PATTERNS... [FILE...] grep [OPTION...] -f PATTERN_FILE ... [FILE...]