Can a shell loop unzip all the files in a directory?
- by helpwithshell
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?