unzip all with just one command

10/29/2015 By emehany

Task: a ton of data comes in the form of zipped massive folders require to be decompressed.  

The Problem

Whenever you use a wildcard (*), the shell itself will expand that and pass the results to the program rather than the program handling the expansion itself. That means that our previous command was actually expanded to the following before being executed:

unzip a.zip b.zip c.zip

The Solution

Just because the shell expands out wildcard characters automatically doesn’t mean that programs can’t as well. The simple solution to this problem is to quote the argument to prevent the shell from interpreting it:

unzip '*.zip'

Leave a comment

Login to Comment

Loading