Take the 2-minute tour ×

Why does cp -r .*/ _dotfiles/ copy all files and directories and not just hidden directories?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

The glob pattern .* matches the current directory (.) and the parent directory (..).

Try this:

cp -r .[^.]*/ _dotfiles
share|improve this answer
add comment

Your Answer


