grep file
I have to find the file that contains the string "aaa" AND "bbb" ( have both string), I tried the below command but it only find OR condition , can advise what can i do ?
egrep -i -H "aaa|bbb" * Thx |
I do not know how to 'and' but I use a pipe:
grep -i "aaa" *|grep -i "bbb" |
didier beat me to it but I use a simpler
ls | grep aaa | grep bbb |
thx reply ,
It works , if I want to find the that in any directory in my server , I tried the below script , it is not work , can advise what can i do ? what is wrong in my script ? thx #find . -type f -exec grep -i "aaa" {} |grep -i "bbb" \; grep: ;: No such file or directory find: missing argument to `-exec' |
Code:
find . -type f -exec grep -i "aaa" {} + |grep -i "bbb" |
All times are GMT -5. The time now is 11:25 AM. |