Tuesday, September 13, 2011

The TAR command


it is used to collect number of files within a single file.Later u may compress it with gzip command.

Syntax

$ tar -cvf <output name> <file to tar>

Examples:

$ tar -cvf my.tar /u01/app/oracle/test/*

Options

-c------>create file.

-v------>verbose means list or show all processed files on screen.

-f------>Name of the tar file.

Now, you may compress it with gzip command.

$ gzip my.tar


it becomes now my.tar.gz.

Now, u may unzip it using gunzip command

$gunzip my.tar.gz


To separate(unarchive) an archive created by tar.

$ tar -xvf my.tar

-x------->Extract the files.

Enjoy:-)