Example: Search for file types within the /testing directory that don't have an owner of nobody, group of staff and permission of 555. Files not matching this criteria would be displayed.
find /testing -type f ! \( -user operator -a -group nobody -a -perm 555 \) -ls
Results are as follows:
BEFORE: Contents of the entire directory
ls -al /testing/
drwxr-xr-x 3 root root 4096 2010-08-10 14:41 .
drwxr-xr-x 26 root root 4096 2010-08-10 13:53 ..
-rw------- 1 root root 5017 2010-08-10 13:53 access.log
-r-xr-xr-x 1 operator nobody 11383 2010-08-10 14:41 alert.log
-rwx---r-- 1 operator nobody 6315 2010-08-10 14:39 dummy_file1.txt
-rw------- 1 root root 5296 2010-08-10 14:39 dummy_file2.txt
-r-xr-xr-x 1 operator nobody 5068 2010-08-10 14:39 dummy_file3.txt
-rw-rw---- 1 root root 1140632 2010-08-10 13:53 errors
-rw------- 1 root root 6950126 2010-08-10 13:53 security.log
dr-xr-xr-x 2 operator nobody 4096 2010-08-10 14:40 testing2
AFTER: display after execution of example command
find /testing -type f ! \( -user operator -a -group nobody -a -perm 555 \) -ls
310697 6800 -rw------- 1 root root 6950126 Aug 10 13:53 /testing/security.log
310699 8 -rw------- 1 root root 5296 Aug 10 14:39 /testing/dummy_file2.txt
310695 8 -rw------- 1 root root 5017 Aug 10 13:53 /testing/access.log
310698 8 -rwx---r-- 1 operator nobody 6315 Aug 10 14:39 /testing/dummy_file1.txt
310696 1120 -rw-rw---- 1 root root 1140632 Aug 10 13:53 /testing/errors
NOTE: the below files were not displayed as they contained the matching user/group and permission set. The directory was also not displayed as it did not match the "file" criteria.
-r-xr-xr-x 1 operator nobody 11383 2010-08-10 14:41 alert.log
-r-xr-xr-x 1 operator nobody 5068 2010-08-10 14:39 dummy_file3.txt
dr-xr-xr-x 2 operator nobody 4096 2010-08-10 14:40 testing2