Dear, I prefer using find with script in this way: find $dir $pattern.where pattern=" -name *.sh ! -name *.txt ... etc."
The built findutils version is 4.7. it fails to work with such message find: paths must precede expression: 'test.sh' find: possible unquoted pattern after predicate '-name' I know when there are multiple files, such as a.txt b.txt c.txt, find . -name *.txt will cause such messages and solve with quoted the '*.txt' It is more convenient to define a pattern and no need to quote all extensions one by one, line by line using scripts. Thanks