DEV Community

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

Posted on • Originally published at junian.net 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

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay