In this post, i will share with you on how to extract the tar file and then unzip the file on Red Hat Enterprise Linux 6 (RHEL 6). This post assumed that the file has been compressed using the following command and method : How to Create the tar file then gzip the file on RHEL 6
Start to extract the tar file named testing.tar.gz in the directory you currently are in as below :
[root@rhel6 ~]# tar -xzvf testing.tar.gz testing/ testing/file3.txt testing/file1.txt testing/file2.txt
Note : In the above example command, the system would extract and uncompress (untar) the testing.tar.gz file in the current directory.
c = create a new tar file
t = List the contents of an archive.
x = Extract the contents of an archive.
f = create the tar file with filename provided as the argument
M = The archive can span multiple floppies.
v = Print verbose output (list file names as they are processed).
u = Add files to the archive if they are newer than the copy in the tar file.
z = use gzip to zip it