Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have a zip file, and would like to unzip a subdirectory of it to another subdirectory, overwriting all existing files. How can this be done in Linux?

Example: The zip file has a "me" folder in it. I would like to extract only the files/folders inside "me" to a folder on the system named "/home/zzz/". However, "/home/zzz/" already has files in it with the same names. I'd like to replace those with the new ones in the file.

share|improve this question
In the future consider using – Caleb Apr 21 '11 at 8:53
unzip -o me/\* -d /home/zzz

should do the trick. I suggest you test it first to make sure you don't overwrite the wrong files.

share|improve this answer
This does not work for me; the top directory in the zip file is copied to the destination directory. – August Karlstrom Dec 1 '11 at 17:24

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.