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

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

| improve this answer | |
  • thanks a lot !!! – Leon Mar 15 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.