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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.