The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-28-2002
Registered User
 

Join Date: Jul 2001
Location: India
Posts: 57
tar.gz

Hi ...

I am using HPUX11.00

can any one please tell me how to make a tar.gz (mean compresed tar file

I mean i want to take some directory and create a tar.gz file out of that directories then ftp it to another server and uncompress and restore it their.


i want to know the gzip command to do that...which will take all the files with in a directory and make tar.gz

Thanks and regards
Prafulla
Forum Sponsor
  #2  
Old 01-28-2002
thehoghunter
Guest
 

Posts: n/a
Read the man page on tar and gzip. Gzip should have been installed from the cdrom (on HPUX 11 placed in /usr/contrib/bin)
  #3  
Old 01-28-2002
Registered User
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Just a hint - you'll need to tar the file before you zip it.

If you want to check that your profile has 'access' to tar and gzip type

which tar gzip

This will display the PATH that is used for these utilities. If you don't have a PATH displayed for both or either - you need to locate them - which is typically going to be in /usr/bin - although you may need to search for them. You can then add them to your path.

Do this by editing the PATH in your .profile (found in your base directory for your user).
__________________
Pete
  #4  
Old 01-29-2002
Registered User
 

Join Date: Dec 2001
Location: UK
Posts: 23
In order to make a tar.gz file you should do the following. First use the tar command to make the .tar file, to do that either go to the parent directory, of the directory you want to make an archive file, and type <B><I>tar cfpv filename.tar dirname</I></B>. The options are <B>c</B> for creating a new archive, <B>f</B> for using an archive file, <B>p</B> for extracting all protection info and <B>v</B> for verbose. The are numerous others options which you can find from the manual page of tar. That will create the archive file filename.tar which then you have to compress it, to do so type <B><I>gzip fliename.tar</I></B>. That will create the file <I><B>filename.tar.gz</B></I>. Instead of going to the parent directory of the directory you want to make the archive file you can also write the obsolute path.
In order to uncompress and extract the file you type <B><I>tar zxpvf filename.tar</I></B>.

Last edited by developer; 01-29-2002 at 06:59 AM.
  #5  
Old 01-30-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Just a sidenote:
The tar command installed as default by HP-UX does not recognize the "z" option. This is, I believe, a GNU extension...

On a Linux system:
tar zcpf filename.tar.gz files...
tar zxpf filename.tar.gz

On HP-UX:
tar cpf filename.tar files... && /usr/contrib/bin/gzip filename.tar
/usr/contrib/bin/gzip -d filename.tar.gz && tar cpf filename.tar

There are other ways of doing it, like using pipes and redirection, but this gives you the difference between the two.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0