#!/bin/bash
#ONLY_EXPLAIN
# Find files with .gz extension -- the sign ` used to enclose executable code 
for file in `find . -name "*.gz*" -type f` ; do  
for file in `find . -name "*.zip*" -type f` ; do 
# Skip the extension .zip 
dirname=`echo $file | sed -s '1,$s/^\.\///' | awk -F'.'  '{print $1}'`  
# Create the directory 
mkdir $dirname  
# Copy the zip file 
cp ${file} ${dirname} 
cd $dirname  
# Unzip the zip file from newly created directory 
gunzip ${dirname}/$(echo ${file  ##/*/ }) 
done 
