Suppose I want to find all *tex
files recursively from a given directory containing foo and bar but not doe. I am looking for something like helm-do-ag, but that doesn't seem to support the not operator. So is there anything like that which supports search queries with full boolean operations, i.e. something like: "find all tex files containing (apple AND orange) OR (banana and pear) not apricot".
1 Answer
Try using the UNIX or GNU/Linux find
command. It supports Boolean operations.
In Emacs you can, for example, use command find-dired
, which runs find
and puts the set of found files in a Dired buffer. You can then mark any number of them and then act on the marked files (e.g. A
to search incrementally, Q
to query-replace). (Emacs also has a grep-find
command, at least for some platforms.)
find
can search to any depth. It is an amazing command - practically a language unto itself.
ag -L doe -G '\.tex$' --print0 | xargs -0 ag 'foo|bar'