Hi....
trying to search a drive for files for a given user, but i want to exclude certain dirs...
i've tried using the following with no luck...
find / (-path "/foo" -o -path "/foo2" ) -prune -o print.... which prints out files excluding the foo1/foo2 trees....
when i insert the -user "user1".. it blows up....
ie: find / (-path "/foo" -o -path "/foo2" ) -prune -o -user "user1" -o print.... <<doesn't work!!!
any solutions would be really helpful... i've been playing with this for a few hours!!
thanks
On Mon, Sep 03, 2007 at 03:10:17PM -0700, bruce wrote:
Hi....
when i insert the -user "user1".. it blows up....
ie: find / (-path "/foo" -o -path "/foo2" ) -prune -o -user "user1" -o print.... <<doesn't work!!!
Try this instead:
find / (-path "/foo" -o -path "/foo2" ) -prune -user "user1"
You don't really need the -print as it is implied if no other output command is indicate ( -ls, e.g.).
I think it's the -os outside the parentheses that are causing your problem. You want the default -and. To translate into English:
starting at root, find files in either /foo or /foo2, without descending into directories, and owned by user1. -prune always returns true, so it -ands nicely.
Since you are pruning, I would try it like so:
find /foo /foo2 -prune -user "user1"
I think those are equivalent, but would test it to see.