Page is a not externally linkable
- Hardware and OS Related Technologies
-- Linux, Unix, and *nix like Operating Systems
---- Unix cp/mv help


suga - 6:42 pm on May 10, 2012 (gmt 0)


Here's my example:

I have a directory called forum with files and subdirectories with files. I want to upgrade my forum and have uploaded the new forum directory. Now, I need to copy the new forum directory over to my existing location but without deleting any of my custom files.

I know this works:

sudo mv /new/forum/*.php /old/forum/.
sudo mv /new/forum/*.jpg /old/forum/.
sudo mv /new/forum/admin/* /old/forum/admin/.

But is there a way to do this without first cd-ing into the directory and moving/copying contents of that directory? Is there a way to do it by whole directory?

sudo mv /new/forum/admin /old/forum/admin

This would simply overwrite the admin directory, right? But what if /old/forum/admin has custom files that I want to keep?

Thanks.


Thread source:: http://www.webmasterworld.com/linux/4451927.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com