1

I have run a program that writes a lot of log files in a lot of directories. For example, there are hundreds directories, and every one includes thousands of log files. I need to find out the files those include the keywords "WARNN", "ERROR" and "FATAL" in command-line shell. I tried to use "grep WARRN */*", but I got "-bash: /usr/bin/grep: Argument list too long".

Would any good man please tell me a method? Any reply or hint will be much aprreciated!

1 Answer 1

1

You could try to apply grep on the results of find, for example:

find . -type f -print | xargs grep WARNN

To know which file matches use option -n of grep

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .