Unzip a bunch of zips into their own directories

Alexander picture Alexander · Mar 17, 2010 · Viewed 10.3k times · Source

I have a bunch of zip files I want to unzip in Linux into their own directory. For example:

a1.zip a2.zip b1.zip b2.zip

would be unzipped into:

a1 a2 b1 b2

respectively. Is there any easy way to do this?

Answer

ghostdog74 picture ghostdog74 · Mar 17, 2010
for file in *.zip
do
  unzip -d "${file%.zip}" $file
done