Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Copying hidden files with Linux, I realized I should use :

cp -a /mnt/sda8/john/. /mnt/sdb2/john

instead of :

cp -a /mnt/sda8/john/ /mnt/sdb2/john

What's the point in adding a . after the source directory ? What does it mean exactly ? To me, the second version should work as well since no globbing is involved.

share|improve this question

migrated from dba.stackexchange.com Dec 26 '12 at 15:52

This question came from our site for database professionals who wish to improve their database skills and learn from others in the community.

1 Answer 1

a simpler and more common way of doing this would be:

cp -a /mnt/sda8/john /mnt/sdb2/

. means the current directory, and /mnt/sda8/john is equivalent to /mnt/sda8/john/.

however, adding a trailing / such as you have done may throw some programs in some distributions off and thus fail to do what you want.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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