Tar command is used to create maintain or modified and extract file which are archive in the tar format [$ tar (option)
{Option}
-c = creating an archive
-x = extract the archive
-v = display the verbose
-f = allow you specific the file name
-z = zip,tell tar command that create tar file using bzip
the above command will create a tar archive file “irfan.tar” for a directory “jack.data” in current working directory
use only selected data test.txt and text.text
The above command will create a tar archive file “irfan.tar” containing “test.txt” and “text.txt”
in current working directoryls
example
Extracting files from archive using option -xvf
Show the how many file in your irfan.tar we enter the command on our display see the example
Example
gzip command in linux
gzip is a compress tool which is used in linux
this command compresses more than the (–xvf) and save the file name (.tar.gz)
Example
Create tar.bz2 archive file
The bz2 feature compress and create archive file less than the size of the gzip. The bz2 compression takes more time to compress and decompress files as compared to gzip which takes less time. To create highly compressed tar file we use option as j. The following example command will create a (test.tar.bz2) file for a directory(test)
Example
Check the size of the tar archive file
To check the size of any tar  archive file, use the following command. For example the below command will display the size of archive file in Kilobytes (KB).
Example
Add file or directory in your tar archive file
To add files or directories to existing tar archived file we use the option r (append).
No responses yet