Tokyoahead

News
News
Architecture
Architecture
Asian Cooking
Asian Cooking
Finance
Finance
Galapagos
Galapagos
Technology
Technology
Trips & Sights
Trips & Sights
  

How to unzip many files to their respective directories under Linux?

You have a bunch of files called 1.zip, 2.zip etc.
you want to unzip them but each to another directory, called 1,2 etc. the files themselves do not contain any directory information.

Do the following:

for archive in *.zip; do mkdir `basename ${archive} .zip`; (cd `basename ${archive} .zip` && unzip -q ../${archive}); done

( all in one line !)


Last Update: 2004-10-18 17:44:20
 FAQ > Operating Systems  > Linux  > Non-Distro-Specific