find: Classifying Files

1 
1 9.6 Classifying Files
1 =====================
1 
1 If you want to classify a set of files into several groups based on
1 different criteria, you can use the comma operator to perform multiple
1 independent tests on the files.  Here is an example:
1 
1      find / -type d \( -perm -o=w -fprint allwrite , \
1        -perm -o=x -fprint allexec \)
1 
1      echo "Directories that can be written to by everyone:"
1      cat allwrite
1      echo ""
1      echo "Directories with search permissions for everyone:"
1      cat allexec
1 
1    'find' has only to make one scan through the directory tree (which is
1 one of the most time consuming parts of its work).
1