How to Extract ‘tar.bz2’ and ‘tar.gz’ file in Linux

In this post i will show you on how to extract the “tar.bz2” and “tar.gz” file in Linux operating system. Below are the definition of tar and it’s operation options.

           tar - The GNU version of the tar archiving utility
           tar  [options]
           [-]A --catenate --concatenate
           [-]c --create
           [-]d --diff --compare
           [-]r --append
           [-]t --list
           [-]u --update
           [-]x --extract --get
           Common Options:
           -C, --directory DIR
           -f, --file F
           -j, --bzip2
           -p, --preserve-permissions
           -v, --verbose
           -z, --gzip

To extract a tar.bz2 file, use the command below

    [root@server ~]# tar -jxvf ebook.tar.bz2

Meanwhile, To extract a tar.gz file, use the command below:

    [root@server ~]# tar -zxvf ebook.tar.gz
Leave a Reply

Your email address will not be published. Required fields are marked *

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.


* up to 30 days money back guarantee