|
find with prune option
Hello-
I'm trying to write a find command that will exclude certain directories to speed up the find and search the rest of the directory structure to list any files that contain the specified values listed in my egrep.
Specifically, I want the command below to search the current directory and all sub-directories EXCEPT for the "log" and "out" directories and give me a list of file names that contain "sun1216, sun1586, sun1153, PRIVIS1, PRIVIS2". I expected the command below to do the trick but it appears to not work.
find . -follow \( -name "log" -o -name "out" \)
-prune | xargs egrep -li "sun1216|sun1586|sun1153|PRIVIS1|PRIVIS2"
Any suggestions on what's wrong?
Any suggestion on using exec versus xargs?
Thanks
|