in reply to Searching word(s) in multiple file and directories
non-Perl unix approach:
find . -exec fgrep variable_name {} /dev/null ;
Of course, you can substitute any directory for '.'; you need to surround fgrep's argument with single-quotes if it has shell-interpretable characters like '$'; you can use grep instead of fgrep to search by regexp instead of for plaintext.
I have this in my .bashrc:
rfind() { find . -exec fgrep $1 {} /dev/null \; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Searching word(s) in multiple file and directories
by simonm (Vicar) on Dec 03, 2003 at 21:12 UTC | |
by TASdvlper (Monk) on Dec 03, 2003 at 23:44 UTC | |
|
Re: Re: Searching word(s) in multiple file and directories
by waswas-fng (Curate) on Dec 03, 2003 at 23:19 UTC |