I want to search multiple patterns in a directory containing recursive directories and files . I know command for grep which is as follows grep -e '(pattern1)|(pattern2)' or grep -r -E 'string1|string2|string3' /var/www/http What is the command for that using ack or ag ? This should be enough: ack -R 'string1|string2' As -R is the default, you can omit it: ack 'string1|string2' From man ack : -r , -R , --recurse Recurse into sub-directories. This is the default and just here for compatibility with grep. You can also use it for turning --no-recurse off. If you want to get the pattern from a