southpau1
asked on
Linux script for searching logs
I have 31 log files in a directory. I want to search each log file for a specific string. It would be nice to search all 30 with a single command. For output I would just like a count of the matches. How can I accomplish this?
Directory name: /logs
Log file naming convention:
system.log - (today's log)
system.log.* - (previous 30 day's logs where * is the number 1-30)
Directory name: /logs
Log file naming convention:
system.log - (today's log)
system.log.* - (previous 30 day's logs where * is the number 1-30)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Use -c option to count matches