regex only on certain extensions / find / sed
Posted December 16th, 2008 by WilliamCarrier
Log from IRC server Freenode (IPv6) channel ##Linux.
| <me> | I'd like to apply a regex only to certain files, with the extension .php and .inc how could I do that ? |
| <me> | could somoene help with my command problem ? |
| <Element14> | me: sed -i REGEX *.php *.ini ? |
| <me> | Element14: thank you kindly ! that's a big help |
| <me> | I'm trying to get the files in a certain directory with the command "grep -r '1969' *.php *.inc > /grep_1969" but I keep getting the error : grep: *.php: No such file or directory |
| <iasc> | me: use find. http://wooledge.org:8000/UsingFind |
Here's there command I've been using : find . -type f \( -name '*.htm*' -o -name '*.php*' -o -name '*.inc' -o -name '*.tpl' \) -exec grep -H 'REXEX' {} \;
