Consider following directory structure:
$ find m
m
m/f.sh
m/.a
I want to find hidden files in non-hidden directories with:
find . -not -path "*/.*" -and -name "*.*"
.
./m/f.sh
but only f.sh is found, where I expect to find also .a. When searching without -not -path part, all hidden files are found:
find . -name "*.*"
./m/f.sh
./m/.a
How can I specify to search non-hidden directories, but match also hidden files?
To clarify:
./non-hidden-dir/.hidden-dir/.hidden-fileshould be found../.hidden-dir/non-hidden-dir/.hidden-fileshould not be found.