Text Processing: Find files that are not owned by a user

From WikiMLT

Get the files that are not owned by root or user1 re­cur­sive­ly:

sudo ls -laR /etc | \
sed -e '/root.*root/d' -e '/user1.*user1/d' \
    -e '/total/d' -e '/^\/.*\n\/.*/d' -e '/^\./d' -e '/\.$/d' -e '/^$/d' | \
awk '$1 ~ /^(-|d)/ {if (a && a !~ /^(-|d)/) print a; print} {a=$0}'

Ref­er­ences: