RECURSIVE GREP
Here is a nasty One-Liner:
Did you wish you could grep through files recursively
down subdirectories:
find . -type f -exec grep -l "foo" {} \\; -exec grep -n "foo" {} \\;
-exec echo " " \\;
Or another version that was submitted is:
find . -type f -print | xargs grep foo
Here is the command in script form.
This is probably easier in the long run....
=============== CUT HERE =======================================
# Script : gref
# Shell : any
# Author : Thom Vaught, David Miller
# Date : 8/16/90
#
# Recursively greps down a directory tree.
# If no path is specified, default is working directory.
#
# NOTE: Some shells require the variables in the "if"
# statements be quoted.
if [ $# = 1 ]
then
dir=.
else if [ $# = 2 ]
then
dir=$2
else
echo "Usage: `basename $0` pattern [path]"
exit 1
fi
fi
find $dir -type f -exec grep -l "$1" {} \\; \\
-exec grep -n "$1" {} \\; \\
-exec echo " " \\;
--- kolay gelsin muratc.