Posted on Leave a comment

How to unzip a zip file into a folder with the zip file’s name – Bash Script

cd into the directory containing the zip files
Run command


Add below code to file

for z in *.zip
d=`basename $z .zip`
mkdir $d && unzip $z -d $d

Make it executable

chmod +x

Run it


If you want to delete zip files after unzip, you only need to add
rm -rf $z after mkdir $d && unzip $z -d $d