33

How do I silently extract files, without displaying status?

4 Answers 4

52

man unzip:

   -q     perform  operations  quietly  (-qq  = even quieter).  Ordinarily
          unzip prints the names of the files it's extracting or  testing,
          the extraction methods, any file or zipfile comments that may be
          stored in the archive, and possibly a summary when finished with
          each  archive.   The -q[q] options suppress the printing of some
          or all of these messages.
10

From the unzip man page:

-q

perform operations quietly (-qq = even quieter). Ordinarily unzip prints the names of the files it's extracting or testing, the extraction methods, any file or zipfile comments that may be stored in the archive, and possibly a summary when finished with each archive. The -q[q] options suppress the printing of some or all of these messages.

So unzip -qq yourfile.zip it is.

2
  • 1
    This answer exists already Commented Jan 16, 2017 at 23:00
  • 2
    I'm sorry, it did not when I started typing.
    – Artemis
    Commented Jan 16, 2017 at 23:01
2

PHP has an extension for that

http://php.net/manual/en/book.zip.php

<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
    $zip->extractTo('/my/destination/dir/');
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}
?>
3
  • Well, ZipArchive library and other libraries didn't work for my sever. Commented Jan 16, 2017 at 23:11
  • pecl.php.net/package/zip
    – Michael D.
    Commented Jan 16, 2017 at 23:15
  • Tried that too didn't work, had to do a unix function before it worked. Thanks Anyway Commented Jan 16, 2017 at 23:17
1

I suggest with this is using gunzip command

gunzip /path/to/file/filename.z

this will also output silently

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .