Server Fault is a question and answer site for system and network administrators. 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

I would like to merge the contents of two folders with the same same, from the linux terminal.

Drive 1\Folder

Drive 2\Folder

I want all files and sub-files in drive 1's folder to go to drive 2's folder, i tried to use MV and i got an error saying:

unable to remove target: Is a directory

share|improve this question
up vote 1 down vote accepted

cp -r Drive\ 1/Folder/* Drive\ 2/Folder/

I always prefer to cp rather than mv as it means I still have a copy of the original if in case something happens in the transfer.

After the copy is complete you can rm -r Drive\ 1/Folder.

This should also deal with the issue mv is having with moving the directory.

Hope that helps

share|improve this answer
thanks will mark as answer when 10 mins is up!!!! – Taylor Gibb Sep 30 '12 at 19:45
Copying also sets the SELinux properties of the files being moved. The 'mv' command maintains the previous properties which can lead to confusing behavior in services and difficulties in accessing files otherwise completely correct permissions. – Magellan Sep 30 '12 at 22:02

Using cp -ru drive1/* drive2 will copy everything in drive1 to drive2. The -r means to copy recursively. The -u means to update by copying only when the source file is newer than the destination file or when the destination file is missing.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.