At the moment I'm using two commands, I'm sure there must be a better way...
wim@wim-acer:~/ffmpeg$ find . -name "*.h" -print0 | xargs -0 grep -i invalid\ preset wim@wim-acer:~/ffmpeg$ find . -name "*.c" -print0 | xargs -0 grep -i invalid\ preset
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
ack (or, on Debian/Ubuntu, ack-grep) will ignore non-source files like version control or binaries. Very useful.
to search just .c and .h files, as above:
ack-grep -i --cc "invalid preset"
--cc (the longer form is
--type cc) only looks at .c .h & .xs files. The full list of filetypes is viewable with
ack-grep --help type. Most of the time, you won't particularly need the
--type, as it will generally only have the files to search, and then files you won't see by default, like binaries, backups and version control files.