Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 266
Source Link
St.Antario
  • 283
  • 1
  • 7
  • 15

Unzip all files into directories with the same name

Ubuntu 16.04

I have a directory with zip files like this:

directory | |---zip1.zip |---zip2.zip | ... |---zip_very_large_number.zip 

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:

/home/usrname/anotherdir |---zip1(directory) | |---_FILES_FROM_zip1.zip | |---zip2(directory) | |---_FILES_FROM_zip2.zip | |---zip3(directory) | |---_FILES_FROM_zip3.zip | ... | |---zip_very_large_number(directory) |---_FILES_FROM_zip_very_large_number.zip 

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