====== Extract tar.gz, tar.bz2, zip, and other Compressed Files ======

If the file is owned by root, you may need to use sudo.

==== tgz, tar.gz, tbz, tar.bz2, and tar.xz ====

To extract a tgz, tar.gz, tbz, tar.bz2, or tar.xz file, open the terminal and type

<code>cd directory
tar -xvf filename</code>


==== .bz2 ====

<code>bunzip2 filename.bz2</code>

==== .gz ====

<code>gunzip filename.gz</code>

Note: Files such as tinycore.gz and microcore.gz are different. See below.

==== .rar ====

<code>unrar x filename.rar</code>

==== .xz ====

<code>unlzma filename.xz</code>

==== .Z ====

<code>uncompress filename.Z</code>

==== .zip ====

<code>unzip filename.zip</code>

==== .7z ====

<code>7z x filename.7z</code>

==== Equivalent File Types ====

    .tgz is equivalent to .tar.gz
    .tbz and .tb2 are equivalent to .tar.bz2
    .taz is equivalent to .tar.Z
    .tlz is equivalent to .tar.lz
    .txz is equivalent to .tar.xz

==== tinycore.gz and microcore.gz ====

To extract files such as tinycore.gz and microcore.gz, use

<code>cd directory
zcat tinycore.gz | sudo cpio -i -H newc -d</code>

For more information, see [[Remastering]].

==== .deb ====

To extract a .deb file, use

<code>cd directory
ar vx filename.deb
tar -xzvf data.tar.gz</code>

Another option is to use

<code>cd directory
ar p filename.deb data.tar.gz | tar xz</code>

==== .rpm ====

To extract an .rpm file, use

<code>cd directory
rpm2cpio filename.rpm | cpio -vid</code>
