How To Wiki

This shows how to compress files or folders via command line, of many formats.

Common Compression Formats


for these examples "app" is a file or folder that you want to compress, and compressed fire that is created is "app.tar.*"

Command Line

gzip format

tar -czvf app.tar.gz app

bz2 format

tar -cjvf app.tar.bz2 app

xz format

tar -cJvf app.tar.xz app

zip format

rar format

  • directory: rar a app.rar app/
  • file: rar a app.rar app
  • rar man page

LZMA format

  • Fast compression:
    • tar -cv app |lzma e -a0 -d15 -fb16 -mfhc4 -si -so >app.tar.lzma
  • Normal compression:
    • tar -cv app |lzma e -d21 -fb32 -si -so >app.tar.lzma
  • Maximum compression:
    • tar -cv app |lzma e -si -so >app.tar.lzma
  • Ultra compression:
    • tar -cv app |lzma e -d25 -si -so >app.tar.lzma
  • lzma man page

7zip format

file: 7zr a app.7z app

Uncompressed archive

tar -cvf app.tar app


  • please add