Linux: untar unzip gunzip unrar etc

By Xah Lee. Date: . Last updated: .

here's how to unarchive or decompress files.

Untar (.tar)

Extract .tar
tar xvf filename
Extract .tar.gz, .tgz
tar xvfz filename
Extract .bz2, tar.bz2, .tbz2
tar xvfj filename
Extract .xz, tar.xz
tar xvfJ filename
List content of .tar
tar -tvf filename

unzip (.zip)

unzip filename

Decompress gzip (.gz)

gzip -d filename


gunzip filename

Extract lzip (.lz)

You have to install lzip. At

lzip -d filename

Decompress bzip2 (.bz2)

bzip2 -d filename

Decompress xz (.xz)

xz -d filename

Extract rar file (.rar)

unrar e fileName


7z x fileName

Linux Compress, Archive, Download