grep
Recursive search for files with specific content using GREP
Fri, 2011-02-18 14:03 | Franco
So you know that somewhere in your source folder (/source) that there is a script that uses the foo() function but you cant remember which one and there are thousands of files, what do you do?
You grep them!
grep -R -i -n 'foo()' *
Lets break it down, first we are grepping files, the -R indicates to search recursively, -i indicates we want to ignore case, and -n indicates we want to know which line of the file grep finds our search string on. then the search string in single quotes and lastly, a finame wildcard, in this case, search through every file.
Franco's blog | Login to post comments |  1317 reads | Tags: command line, grep, linux, ubuntu
Popular content