The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-25-2008
Registered User
 

Join Date: Apr 2008
Posts: 3
.tar and .tar.gz

a question that maybe has nothing to do with AIX, but on AIX it causes me to do two commands, while i can do it on linux in one command.

why are files always compressed in .tar.gz ???
i don't see the benefit over just compressing it to .tar

on linux i can decompress .tar.gz files with tar -zxvf file.tar.gz

on Aix i have to to first gunzip file.tar.gz, and thereafter tar -xvf file.tar. is there a way to do it in one command on aix???
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-25-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,494
Quote:
i don't see the benefit over just compressing it to .tar
.tar is not compressed at all, it is just an archive format.

Linux (GNU tar) has non-standard extensions added to tar that other implmentations of tar do not have. If the extra typing is a problem write a short shell script to do it.
Reply With Quote
  #3 (permalink)  
Old 04-25-2008
grial's Avatar
El UNIX es como un toro
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Quote:
Originally Posted by jim mcnamara View Post
.tar is not compressed at all, it is just an archive format.
Exactly. A tar file is like a "package" but not compressed at all.
A .tar.gz (or .tgz in some cases) is just a gzip compressed tar file.
Quote:
Originally Posted by jim mcnamara View Post
Linux (GNU tar) has non-standard extensions added to tar that other implmentations of tar do not have.
In this case, that extension is the "z" flag. Have a look to gtar man pages.
Quote:
Originally Posted by jim mcnamara View Post
If the extra typing is a problem write a short shell script to do it.
For instance, in one line:
gzip -c myfile.tar.gz | tar xvf -
or
tar cvf - whatever | gzip -c > myfile.tar.gz
Regards.
Reply With Quote
  #4 (permalink)  
Old 04-25-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,035
I would like to add that archiving and compressing are two distinct independent tasks. It is not very "UNIX-like" to combine distinct tasks into one tool, so GNU-tar, as handy as it may be, is a little bit against the cultural tradition of UNIX.

bakunin
Reply With Quote
  #5 (permalink)  
Old 04-25-2008
Registered User
 

Join Date: Oct 2003
Location: Singapore
Posts: 1
Quote:
Originally Posted by bakunin View Post
I would like to add that archiving and compressing are two distinct independent tasks. It is not very "UNIX-like" to combine distinct tasks into one tool, so GNU-tar, as handy as it may be, is a little bit against the cultural tradition of UNIX.

bakunin
I agreed GNU-tar is "against the cultural tradition of UNIX" but assume if we need to ftp many directory from one server into another every hours ??
1: maintain the dir
2: reduce the size so that FTP faster
By using GNU-tar it save us a lot of time,i believe.
In my environment we need to sync data between server in different country, this work the best.
Reply With Quote
  #6 (permalink)  
Old 04-27-2008
grial's Avatar
El UNIX es como un toro
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Quote:
Originally Posted by thye View Post
1: maintain the dir
2: reduce the size so that FTP faster
In that case, you may consider using "rsync"
Reply With Quote
  #7 (permalink)  
Old 04-27-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,035
Quote:
Originally Posted by thye View Post
I agreed GNU-tar is "against the cultural tradition of UNIX" but [...] By using GNU-tar it save us a lot of time,i believe.
I guess this is why the shell was invented in first place: to glue together all the little specialized tools which do only what they are intended to do, but that they do efficiently.

For the same reason one might need a tool that lists a directory and to translate its contents into chinese - that doesn't mean it would be a good idea to incorporate a translator for chinese into "ls".

If you buy tools (out in the real world, not on a computer) you'd usually buy screwdrivers, hammers, saws, etc.. These tools may serve only one purpose (a screwdriver for handling screws, a hammer for hammering, etc.), but ideally they serve this purpose well. If you try to buy a screwdriver which is a saw and a scissor and a hammer at the same time you'll end up with some sort-of "72-functions-swiss-army-knife", which does serve a lot of purposes all equally bad.

bakunin
Reply With Quote
Google UNIX.COM
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:03 PM.


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

Content Relevant URLs by vBSEO 3.2.0