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


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

Try this:

cp -r .[^.]*/ _dotfiles

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.