Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

up vote 1 down vote accepted

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .