954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

backup directory

would anyone please tell me how i cp the whole directory to another directory without the originalDir name....

ex: say the original contains multiple directory contains multiple directory.. and files how do i copy everything from one directory to another directory

i tried cp -r /home/henry/originalDir /home/henry/newDirectory..... however my newDirectory contains the directory originalDir........

how do i copy everything from the originalDir to the newDir?


by the way, what is the difference between cp and hard link? thank you

k2k
Posting Whiz
352 posts since Nov 2007
Reputation Points: 15
Solved Threads: 1
 

Perhaps
cp -r /home/henry/originalDir/* /home/henry/newDirectory

> by the way, what is the difference between cp and hard link?
A hard link isn't a copy of the file, but two directory entries pointing at the SAME part of the disk. Changing the file via one of them also changes the file as seen from the other link.

Also, to remove a file with say two hard links, you have to remove both directory entries.

It's a nice way of preventing accidental deletion, but it's no backup solution.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You