Skip to main content

Compress & Extract

To compress one file or folder to a tar file:


tar -cvf xxx.tar file

To extract a tar file:


tar -xvf file.tar

To compress one file or folder to a tar.gz file:


tar -cvzf xxx.tar.gz file

To extract a tar.gz file:


tar -xvzf file.tar.gz

To compress one file or folder to a tar.bz2 file:


tar -cvjf xxx.tar.bz2 file

To extract a tar.bz2 file:


tar -xvjf file.tar.bz2

To compress a file or folder to a zip file:


zip -r file.zip file


 To explode folder you can use this 


zip -r folder1-19-07-2016.zip folder1 -x folder1/media/**\* 

 

 

To extract a zip file:


unzip file.zip

To Extract a zip file to specific Folder

unzip file.zip -d folder1

Tags