Can a shell loop unzip all the files in a directory?
Posted
by helpwithshell
on Stack Overflow
See other posts from Stack Overflow
or by helpwithshell
Published on 2010-04-25T16:41:33Z
Indexed on
2010/04/25
22:53 UTC
Read the original article
Hit count: 176
I've seen loops to unzip all zip files in a directory. However, before I run this, I would rather make sure what I'm about to run will work right:
for i in dir; do cd $i; unzip '*.zip'; rm -rf *.zip; cd ..; done
Basically I want it to look at the output of "dir" see all the folders, for each directory cd into it, unzip all the zip archives, then remove them, then cd back and do it again until there are no more.
Is this something I should do in a single command or should I consider doing this in Perl?
© Stack Overflow or respective owner