Você pode fazer isso com o Regex, no diretório pai:
find . -type f -regextype posix-egrep -regex '\./([^/]+|Testing/.*)$'
\./([^/]+|Testing/.*)$
encontrará todos os arquivos ( -type f
) no diretório atual e apenas no diretório Testing
.
Para executar um comando, adicione -exec
action:
find . -type f -regextype posix-egrep -regex '\./([^/]+|Testing/.*)$' -exec echo {} \;
Substitua echo
pelo comando real.
Exemplo:
$ find . -type f
./foo
./Sourced/src
./Testing/test
./bar
./spam
./Models/model
$ find . -type f -regextype posix-egrep -regex '\./([^/]+|Testing/.*)$'
./foo
./Testing/test
./bar
./spam
$ find . -type f -regextype posix-egrep -regex '\./([^/]+|Testing/.*)$' -exec echo {} \;
./foo
./Testing/test
./bar
./spam