Hi All,
I wanted to list all the files in the current directory which contains the pattern "error". I tried the following grep command
Code:
grep -i 'error' *.*
but i got the error message "ksh: /usr/bin/grep: 0403-027 The parameter list is too long."
Any idea why the grep didn't work?
Note: There are hundreds of files which contains this pattern.
I used find command to achieve the same result.
Code:
find . -type f -exec grep -i "error" {} \;
find . -type f -exec grep -i "error" /dev/null {} \;
The first command displays me the lines from all files which contains the pattern "error". But it doesn't append the filename in the front.
But the second command gave me the same result with directory name and filename appended in the beginning of each line?
Any idea why both the above find commands work differently?