Match all hidden files in directory

I’ve seen .^.]* syntax to match all hidden files within a directory.

Do you have another way to get hidden files without the current (.) or parent (…)?

I was looking at the set and shopt options and thinking with dotglob unset, that “." might match “.”, but not “…”. It didn’t seem to work out that way. It turns out, ".” can be kind of dangerous (matches the parent) depending on the command being used. :\

From the Bash manual: dotglob - If set, bash includes filenames beginning with a `.’ in the results of pathname expansion.

Thank you.

You seem to forget that . and … ARE files/directories inside a directory.

Also, from reading your text (it is not mentioned in the title of the thread) I suppose this is about file name expansion in bash (there are many more places where different kinds of Regular Expressions and the like are used, all a bit different).

Then rewording you question:
“How do I get a path/filename expansion in bash containning all the files starting with a . except . and …?”

When you agree with the rewording my answer would be: .^.]*
Now as you seem not willing to use this, I like to know why, because when I am spending time to find you an alternative and you will reject that also, I will not be very happy.

If you are sure that all the files you are interested in match .[a-zA-Z0-9]* then use that.