Take the 2-minute tour ×

Occasionally, I need to move android resources from one project into another. For example, Android Holo Colors outputs a .zip file that when extracted yields a res folder with the usual Android directory structure.

  - drawable-ldpi/
  - drawable-mdpi/
  - drawable-hdpi/
  - drawable-xhdpi

Usually, a different sized resource is placed in each directory with the same name. So, button.png would exist in drawable-ldpi, drawable-mdpi, drawable-hdpi, and drawable-xhdpi. What command or script could be used to copy or move the outputted drawable folders into my project at once without copying over the entire res directory and overwritten other files?

share|improve this question
A 'mv' should do the trick: mv res/* {your_project}/res/, shouldn't it? –  Herr K Nov 20 '12 at 19:21
Does mv overwrite things that might already be in the directory? –  dbaugh Nov 20 '12 at 19:25
Yes, but you can protect against that with mv -i –  cdarke Nov 20 '12 at 20:24

1 Answer 1

up vote 0 down vote accepted

mv does not move directories but its content. You should use

 $ cd orig
 $ tar cf - res | (cd dest; tar xkf -)

The remove what you don't want from orig.

share|improve this answer

Your Answer


