Unix system(“unzip archive.zip”) Extracting Zip Files Silently
22,212
Solution 1
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.
Solution 2
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.
Solution 3
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';
}
?>
Solution 4
I suggest with this is using gunzip command
gunzip /path/to/file/filename.z
this will also output silently
Related videos on Youtube
Comments
-
Adedoyin Akande over 1 year
How do I silently extract files, without displaying status?
-
George Vasiliou over 7 yearsThis answer exists already
-
Shr4N over 7 yearsI'm sorry, it did not when I started typing.
-
Adedoyin Akande over 7 yearsWell, ZipArchive library and other libraries didn't work for my sever.
-
Michael D. over 7 years
-
Adedoyin Akande over 7 yearsTried that too didn't work, had to do a unix function before it worked. Thanks Anyway