cancel
Showing results for 
Search instead for 
Did you mean: 

tar the directories

SOLVED
Go to solution
gany59
Regular Advisor

tar the directories

Hi Guru's

I need to compress the directories in the name of p2xtmp using the tar command ,under the /tmp file system.

so for this the below command is exact or not.

tar -cvf p2xtmp* p2xtmp.tar

Pls let me know..

Thanks in adcance !!!!!!!!!!1
4 REPLIES
Jupinder Bedi
Respected Contributor

Re: tar the directories

it should be like this

tar -cvf p2xtmp.tar p2xtmp*


Good Luck

All things excellent are as difficult as they are rare
James R. Ferguson
Acclaimed Contributor
Solution

Re: tar the directories

Hi:

The 'tar' utility doesn't compress and the arguments are backwards. You could do:

# tar -cvf p2xtmp.tar p2xtmp*
# gzip p2xtmp.tar

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: tar the directories

Shalom,

You command will not work, but I recommend specifying the full path of the tar file

tar

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven Schweda
Honored Contributor

Re: tar the directories

> # tar -cvf p2xtmp.tar p2xtmp*
> # gzip p2xtmp.tar

Or, without the intermediate ".tar" file:

tar -cf - p2xtmp* | gzip > p2xtmp.tgz