Howto compress files in Unix

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

=Common Compression Formats=
 * gzip
 * bzip2
 * xz
 * zip
 * rar
 * 7z
 * lzma

=Introduction= 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
 * tar man page

bz2 format
tar -cjvf app.tar.bz2 app
 * tar man page

xz format
tar -cJvf app.tar.xz app
 * tar man page

zip format

 * directory: zip -r app.zip app
 * zip man page

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
 * 7za man page

Uncompressed archive
tar -cvf app.tar app
 * tar man page

=GUI=
 * please add

=References=
 * Compression comparisons
 * 7za man page
 * zip man page
 * tar man page
 * rar man page
 * lzma man page