A tarball (tar.gz file) is compressed tar archive.
The TAR program provides the ability to create tar archives, as well as various other kinds of manipulation. For example, you can use the Tar on previously created archives-extract files, to-store additional files, or to update or L ist files which were already stored.
Syntax
TarOptionsfile.Tar. GZ TarOptionsfile.Tar . GZ PatternTar-xffile.Tar. GZ Tar-xvffile.Tar. GZ Tar-zxvffile.Tar. GZ Tar-zxvffile.Tar.GZfile1 file2 Dir1 Dir2
Extract tar.gz File
Extract one or more members from an archive, enter:
tar -zxvf {file. Tar. GZ}
If your tarball name is backup.tar.gz, enter the following at a shell prompt to extract files:
Tar backup.tar.gz
Extract resume.doc file from backup.tar.gz tarball, enter:
Tar backup.tar.gz Resume.doc
Where,
- Z : Work on gzip compression automatically when reading archives
-x:extract Archives
- v : produce verbose output i.e. progress and extracted file list on screen
- F : Read The archive from the archive to the specified file.
-t:list the files in the archive
Extracting an entire archive
To extract a entire archive, specify the archive file name only, with no individual file names as arguments.
Tar backup.tar.gz
List Files in Archive
To view a detailed table of contents (List of file), enter:
Tar backup.tar.gz
Linux tar.gz file