.tar and .tar.gz | Unix Linux Forums | AIX

  Go Back    


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

.tar and .tar.gz

AIX


Tags
linux, linux commands

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-25-2008
Leilah Leilah is offline
Registered User
 
Join Date: Apr 2008
Last Activity: 25 April 2008, 4:06 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
.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???
Sponsored Links
    #2  
Old 04-25-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 19 December 2014, 11:40 PM EST
Location: NM
Posts: 10,312
Thanks: 297
Thanked 822 Times in 764 Posts
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.
Sponsored Links
    #3  
Old 04-25-2008
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
 
Join Date: Jun 2006
Last Activity: 1 December 2008, 8:39 AM EST
Location: Madrid (Spain)
Posts: 531
Thanks: 0
Thanked 1 Time in 1 Post
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.
    #4  
Old 04-25-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 20 December 2014, 1:13 AM EST
Location: In the leftmost byte of /dev/kmem
Posts: 4,371
Thanks: 47
Thanked 853 Times in 674 Posts
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
Sponsored Links
    #5  
Old 04-25-2008
thye thye is offline
Registered User
 
Join Date: Oct 2003
Last Activity: 22 September 2011, 9:25 PM EDT
Location: Singapore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Sponsored Links
    #6  
Old 04-28-2008
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
 
Join Date: Jun 2006
Last Activity: 1 December 2008, 8:39 AM EST
Location: Madrid (Spain)
Posts: 531
Thanks: 0
Thanked 1 Time in 1 Post
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"
Sponsored Links
    #7  
Old 04-28-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 20 December 2014, 1:13 AM EST
Location: In the leftmost byte of /dev/kmem
Posts: 4,371
Thanks: 47
Thanked 853 Times in 674 Posts
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
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -4. The time now is 12:28 PM.