DEV Community

Cover image for How to Unzip Multiple Files with Command Line
junian
junian

Posted on Originally published at junian.dev on

How to Unzip Multiple Files with Command Line

Recently I've download a lot of zip files from the internet to my Raspberry Pi.
After all download progress finished, I see the files and try to unzip them all.
My first reflect is to type unzip *.zip just like any other standard unix command (rm, cp, etc.).
But, to my surprise, it doesn't work at all.

Take a look at the following snippet.
This is an example output I get when I try to unzip multiple zip files with the wrong command.

$ unzip *.zip
Archive:  file-01.zip
caution: filename not matched:  file-02.zip
caution: filename not matched:  file-03.zip
Enter fullscreen mode Exit fullscreen mode

So, how to solve this problem?

It's actually pretty simple, just wrap the *.zip with apostrophe (') like the following snippet.

unzip '*.zip'
Enter fullscreen mode Exit fullscreen mode

Since now the command is written correctly, here is the expected output.

$ unzip '*.zip'
Archive:  file-01.zip
  inflating: file-01.iso

Archive:  file-02.zip
  inflating: file-02.iso

Archive:  file-03.zip
  inflating: file-03.iso

3 archives were successfully processed.
Enter fullscreen mode Exit fullscreen mode

It's a success!

I also made a video to visualize what I wrote here.

Subscribe to Junian Dev YouTube Channel

Thank you for reading, see you on my next tutorial.

References

Top comments (0)