Monday, June 21, 2010

How to use grep command ??

To search for the given PATTERN in a current directory recursively :


grep -r PATTERN   DIR_PATH 

grep -r  init()  ./

it will displays the files which are having init() fn.


grep -r  init()  ./  -n

it will displays the files with init() fn and its occurence line number too...



 

No comments: