Monday, August 16, 2010

Grep Command

The Linux grep command is used to extract lines of data from files or extract data from other Linux commands by using a pipe. When using the Linux grep command, there are many ways you can extract or print lines. You can use standard text to grep or you can use regex patterns.

The basic grep syntax is  

grep [options] [pattern] [file|files].

grep -R, grep -r, grep --recursive ==> used to grep files recursively in other directories.


grep -n  ==> displays the output with the line number

grep -i  ==> to ignore case while grep

grep -v  ==> returns all other data except the argument given.







1 comment: