I presume you wouldn't have asked unless you needed something rather more sophisticated than the following, but FWIW: for dir in `find hierarchyRoot -type d | fgrep -v -x -e excludedName1 -e excludedName2 ` do find $dir -maxdepth 1 -type f -someOtherQualifier -yetAnotherQualifier >>unsortedList done sort -u <unsortedList >sortedList