Skip to content

Instantly share code, notes, and snippets.

@nknote
Created May 25, 2015 10:46
Show Gist options
  • Save nknote/5e929d88a92500990ffc to your computer and use it in GitHub Desktop.
Save nknote/5e929d88a92500990ffc to your computer and use it in GitHub Desktop.
Useful scripts
#!/bin/bash
######################################################################################
# script by ischo.
# http://www.ischo.net
# mail:[email protected]
# script description :
# unzip files into it's own sub-directory names
######################################################################################
FILELIST=`ls -l *.zip | awk {'print $9'}`
for FILENAME in ${FILELIST}
do
DIR=`echo ${FILENAME} | sed 's/.zip//g'`
mkdir ${DIR}
mv ${FILENAME} ${DIR}
cd ${DIR}
unzip -q ${FILENAME}
cd ..
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment