Supposed you have a tar.gz file or tar.bz2 file, here is how you can extract them using the tar function.
Type at the command prompt. Make sure you have the ownership and permission of the file.
tar -xvzf file-1.0.tar.gz - to uncompress a gzip tar file (.tgz or .tar.gz) tar -xvjf file-1.0.tar.bz2 - to uncompress a bzip2 tar file (.tbz or .tar.bz2) tar -xvf file-1.0.tar - to uncompressed tar file (.tar)
x = extract. This indicates an extraction
v = verbose. The files with relative locations will be displayed.
z = gZip-ped or j = bzip2-zipped
f = from/to file
The files will be extracted in the current folder.
For more info type the following on your command line:
tar --help(Visited 4,481 times, 1 visits today)
You do need a “-” before xvzf, xvjf or xvf for this command to function properly.
I dont need “-” on my Arch Linux. I’m not sure about other distros. I think Debian-based distro like Raspbian or Mint would require the “-” sign.