LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to move a folder and replace files (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-move-a-folder-and-replace-files-457751/)

RAdams 06-23-2006 10:55 PM

How to move a folder and replace files
 
Hi. I want to move a folder using terminal. I know this is done by:
Code:

mv /foo/foofolder /bar/barlocation
My question is: how do I move a folder if there is another folder in that location of the same name, and I want it to replace any same-named files, and add any files not already there?

Thanks.

rickh 06-23-2006 11:08 PM

mv -f /foo/foofolder/* /bar/foofolder/

but, if there aren't too many files, mv -i would be more sensible unless you're absolutely positive you want to overwrite whatever is already there.

RAdams 06-24-2006 12:11 AM

Quote:

Originally Posted by rickh
mv -f /foo/foofolder/* /bar/foofolder/

but, if there aren't too many files, mv -i would be more sensible unless you're absolutely positive you want to overwrite whatever is already there.

Beautiful. Thanks a million.


All times are GMT -5. The time now is 03:28 AM.