64

I have a lot of Zip archives that I want to unpack in a script. Is there any way to run them silently?

Here is what I have:

bash> unzip  02b852e3571e46f25fdfc79f43ceb726ddff9ba7.zip 
Archive:  02b852e3571e46f25fdfc79f43ceb726ddff9ba7.zip
02b852e3571e46f25fdfc79f43ceb726ddff9ba7
  inflating: .editorconfig           
  inflating: .gitattributes      
bash>  

Here is what I want:

bash> unzip <something to silence zip> MyArchive.zip      
bash>  
syntagma
  • 10,888
Whitecat
  • 763
  • 4
    man unzip is your friend (works for more or less all commands you can run in Terminal) – nohillside Mar 28 '17 at 05:48
  • 3
    I know about man but I believe most people will agree it is difficult to find what you want looking through man pages. I think it was faster and easier to ask here. – Whitecat Mar 30 '17 at 16:07
  • It takes some time tontet used to it, but things like command line options are easy to be found there. – nohillside Mar 30 '17 at 18:37
  • 3
    Asking here is a lot more effort than using man command. But googling and jumping to the best answer after this has been asked is easier than using man. So bless this guy for asking. – Ben Barkay Jun 08 '19 at 20:17

2 Answers2

114

As stated in the manual, -q (quiet) or -qq (even quieter).

unzip -qq filename
fd0
  • 10,708
7

If you don’t want to see the output from your terminal commands then you can redirect both standard output and standard error to /dev/null by adding > /dev/null 2>&1 to the end of your command. Of course, this can hide errors, so you might want to redirect it to a file instead, depending on your use case.

Jivan Pal
  • 1,215
  • 10
  • 20