![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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 |