awk ‘/string1/ && /string2/’ file
awk ‘/string1/ && /string2/’ file
A server I had been monitoring had multiple installations of apache web server. The system had about 10-15 httpd.conf files. I needed to figure out the httpd.conf that was configured to start website a. Below is a shell script that I wrote at the command promt:
for i in `locate httpd.conf`; do grep -l a.com $i;done