以下のようなディレクトリ構成があるとする。
dir
┗subdir1
┗file1.txt
┗subdir2
┗file2.txt
┗subdir3
┗file3.txt
┗file4.txt
このうち、subdir1、subdir2以外にある、.txtの拡張子を持つファイルに対して755権限を付与する。
find ${path} -type f -name "*.txt" ! -path "${path}subdir1/*" ! -path "${path}subdir2/*" -exec chmod 755 {} \;
この場合、file3.txtとfile4.txtが対象になる。