Using -print0 with -o in find

Viewed 2263

I am using -print0 to modify the output of find to use NULL terminators instead of newlines. However I can't get this to work when using find's -o (OR) function.

This works fine, it prints out a newline-separated list of files that are either not owned by user 'pieter' OR not owned by group 'www-data':

find . ! -user pieter -o ! -group www-data

But when I append -print0 to this I get no output anymore:

find . ! -user pieter -o ! -group www-data -print0

This however works fine:

find . ! -user pieter -print0

What am I missing? I have tried adding various placements of pairs of parentheses but to no avail.

1 Answers
Related