Dealing with archive file in Linux

Tar is command which can be used to extract, create , modify or maintain the file that are archived in tar format.

I recommended following basic argument must be remembered as beginner programmer to deal with compressed file.

c, –create

is  used to create new archive file

x, –extract, –get

is used to extract from archive file

-f, –file=ARCHIVE  

Use archive file (or device) ARCHIVE.

-j, –bzip2

to read or write archives using the bzip2 compressor.

-J, –xz

to read or write archives using the xz compressor.

-z, –gzip, –gunzip

to read or write archives through gzip

-Z, –compress, –uncompress

use the compress program when operating on files.

So these are the some of the basic command argument which is frequently used with tar function.

In linux single dash() is used with single letter and with full function name double dash() is used.Value can be assigned(=) to full funcation name only like

tar --create --file=archive.tar file1 file2

from above all arguments , lets take example of first argument

c, –create

here both are same , any one can be used to create archive

i.e tar -c file

i.e  tar –create  file

for other arguments rules will be same.

So i think you guys now able to play with compressed files. 🙂

Advertisements

One thought on “Dealing with archive file in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s