Installing tar in CentOS, RHEL, and Fedora

The tar package comes pre-installed in most if not all Linux distributions by default. But if it is not installed on your system, run the following command to install it.

# yum install tar

Once you have tar installed on your system, you can use it as follows. This example shows how to create an uncompressed archive file of a directory called test_app within the working directory.

# tar -cvf test_app.tar test_app/

Create Uncompressed Tarball

Create Uncompressed Tarball

In the above command, the tar flags used are -c which creates a new .tar archive file, -v enables verbose mode to show the .tar file creation progress, and -f which specifies the file name type of the archive file (test_app.tar in this case).

To compress the resulting archive file using gzip or bzip2, supply the -z or -j flag as follows. Note that a compressed tarball can also end with the .tgz extension.

# tar -cvzf test_app.tar.gz test_app/
# tar -cvzf test_app.tgz test_app/
# tar -cvjf test_app.tar.bz2 test_app/

#linux distros #redhat

Installation of RHEL 6.10 with Screenshots
1.10 GEEK