How To grep for a list of options in Solaris
Posted on 2007-11-28
I am trying to figure out how to grep through log files, but rather than grepping for one item, I want to search for a number of items. I have tried a number of different approaches, but none have worked.
What I have is a list of domain names in a text file with one name per line. I then want to search through a number of log files looking for any log entry that matches any of the domains in the list. I also have a similar list, though it contains IP addresses instead of names that I also need to search for.
Does anyone know of a good way to search for a number of items in one command, or do I have to grep for each one - which would be extremely time consuming?
I would greatly appreciate any help on this.