• grep (General Regular Expression Print)
$ grep options pattern files
grep searches the named files (or standard input if no files are named) for lines that match a given pattern. Thedefault behavior of grep is to print out the matching lines. For example:$ grep hello *.txtsearches all text files in the current directory for lines containing "hello". options that grep provides are:
-i (Displays list of filenames only)
-v (print out the lines that don't match the pattern)
$ grep -vi hello *.txt
searches all text files in the current directory for lines that do not contain any form of the word hello (e.g. Hello,HELLO, or hELlO).
Explain the significance of option –I, -v with grep command
Reviewed by enakta13
on
November 12, 2012
Rating: