I would like to do something like
ls -RA .?* >> LSRA.list
but with this command and some other variants I tried, I always get also all non-hidden files in the directory where I am.
Namely, if the directory contains files
.hiddenfile foo
with above command I get ther recursive list of both, while I would like to ave only the recursive list of files and directory starting with . (but not the . directory itself!)
I checked answers to this question but I did't find the solution to my problem.
Update: best options found so far:
ls -RA .!(|.)*
and
find -path './.*' -name '.*' -empty -printf %P\\n
the latter recursively list all hidden files in all hidden directory (so if am hidden directory contains a non-hidden files, it does not show that file).
Further update. both answers of bac0n and vanadium work: I cannot accept both! (first one recursively shows nonhidden files in hidden directory, latter one recursively shows only hidden files)
find. Can you indicate which OS version you use? For me, the option-Aforlsyou mention does not work. Perhaps working under a different shell? – vanadium Feb 27 '21 at 13:45'\.*. This "escapes" the dot, and prevents it from being interpreted as a wildcard for one character. Not needed for me, but I added it to the question nevertheless. – vanadium Feb 27 '21 at 13:52-Aoption: I forgot I haveexainstalled, an alternativelscommand that does not support the option. – vanadium Feb 27 '21 at 14:03