This document contains various TAR command examples for creating and extracting (compressed) archive files.
Creating an archive using tar command
|Creating a tar gzipped archive
|The used options:-c option is used to create a new archive.
-v verbosely list files which are processed.
-f following is the archive file name.
-z filter the archive through gzip.
Extracting (untar) an archive using tar command
|Extract a gzipped tar archive ( *.tgz ) using option xvzf
|Specify destination to extract.
|The used options:-x extract files from archive.
Listing an archive using tar command
|View the *.tgz file content without extracting using option tvzf
|The used options:-t list the contents of an archive.
Extract a single file or directory
|To extract a specific file from archive
|To extract multiple directories from archive
|To extract a single directory