Showing posts with label linux file command. Show all posts
Showing posts with label linux file command. Show all posts

Oct 3, 2012

How to decompress multiple files on Linux


To unzip multiple zipped .zip files:

for file in *.zip; do unzip "${file}"; done

To unzip multiple zipped .gz files;

gunzip *.gz

To unzip multiple zipped .bz2 files;

bunzip2 *.bz2

To extract multiple .tar.gz files;

for file in *.tar.gz; do tar zxf "${file}"; done

To extract multiple .tar.bz2 files;

for file in *.tar.bz2; do tar jxf "${file}"; done