The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-28-2002
Prafulla Prafulla is offline
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
  #2 (permalink)  
Old 01-28-2002
thehoghunter
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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 (permalink)  
Old 01-28-2002
peter.herlihy peter.herlihy is offline
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).
  #4 (permalink)  
Old 01-29-2002
developer developer is offline
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 09:59 AM..
  #5 (permalink)  
Old 01-30-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0