It works fine when I copy all hidden files using regex:
cp -r source/\.[^.]* destination/
and it just copies exactly files beggining with a dot .
.
However, I found the following works also:
cp -r source/.[^.]* destination/
In regular expression, doesn't dot .
mean "any singular character"? So why does not the second command copy regular files (those not hidden) ?
Why is the dot .
interpreted literally in cp
command?