Ubuntu 16.04

I have a directory with zip files like this:


Now, I have another directory /home/usrname/anotherdir. Is there a way to unzip all the files into the /home/usrname/anotherdir in the following way:

|    |---_FILES_FROM_zip1.zip
|    |---_FILES_FROM_zip2.zip
|    |---_FILES_FROM_zip3.zip

Is there a concise way to do this with unzip? I could write a shell-script but it doesn't look pretty well...


There is not a short way to do this with unzip, since it only accepts one zipfile for decompression at a time. Consider some sort of shell loop like:

for d in *.zip
  unzip -d "$dir" "$d"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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