Aside: the reason there isn't some special support for this task is that the only thing special about files named with a leading '.' is that there are not listed by ls unless specifically requested: they are completely ordinary files in every respect, its just that ls lets you ignore them by default.
– dmckee --- ex-moderator kittenJun 16 '10 at 0:32

2

Question: do you want to hide something like .hidden/visible.txt?
– Keith ThompsonOct 13 '11 at 0:20

@grawity I just found that, I don't know entirely how it works. Would yours not only hide hidden files, but hidden directories and all their sub-content and hidden files in subfolders?
– JarvinJun 16 '10 at 16:05

For example, you can find non-hidden files and directories inside of an explicitly-specified hidden directory with a command like findnh ~/.hiddendir/, which will show ~/.hiddendir/file but not ~/.hiddendir/.superhiddenfile.

Nice bit of coding. Except, when I try findnh ~/.hiddendir/, I get nothing. Other than that, how is this different from ! -path '*/.*' and find … | grep -v '/\.'?
– G-Man Says 'Reinstate Monica'Oct 22 '14 at 16:42