Wednesday, February 11, 2009

How to find String pattern in files

Here's how you can find a string pattern inside files in any dir
Lets assume we want to search a string pattern "multiple" in all php files in a directory.

grep -l "multiple" *.php

Here, -l means that output will be shown in a list naming the filenames which contain the string pattern.


1 comment: