Preserving name when bulk unzipping files?

Posted by Elip on Super User See other posts from Super User or by Elip
Published on 2012-10-01T14:55:28Z Indexed on 2012/10/01 15:42 UTC
Read the original article Hit count: 277

Filed under:
|

Sorry this question is trivial, but I couldn't get it to work: I have a folder full of .zip files, each .zip file contains exactly one .xml file. The zip files have sensible names like a.zip etc., while the .xml file contained in them have some "randomname".xml

Now I want to unpack all the .zip files in the folder, preserving the name of the .zip files, so that a.zip gets unpacked into a.xml, b.zip into b.xml etc...

I only managed to achieve a batch unpacking with the command:

for z in *.zip; do unzip "$z"; done How do I enhance this to keep the names?

© Super User or respective owner

Related posts about ubuntu

Related posts about bash