[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shell for gunzip so I don't have to remember?



Ray <maillists@sonictech.net> writes:
| On Tue, May 11, 1999 at 04:56:30PM -0500, Andri Bell wrote:
| > 
| > I ask because I must be doing something wrong.  When I ungzip <file>.gz the
| > system converts my .gz file to one file with no extension instead of
| > unzipping the file and all of its contents.
| > 
| > I know there are multiple files in the gzips that I look at because I can
| > view all of the compressed files when I view the contents of the gzip file
| > on my pc, just not with gzip on linux :(
| 
| A gzip file only contains one file.  Sometimes that one file happens to be a
| tar file (ie an archive) in which case you use tar to extract it's contents
| after you have unzipped it.  For example:
| 
| You start with foo.tar.gz
| 
| gunzip foo.tar.gz   		Now you have a file called foo.tar which
| 				should be much larger than foo.tar.gz was.
| 
| tar -xvf foo.tar 		Now all the files are extracted from foo.tar
| 
| 
| As others have said, you can do this all in one step with tar -zxvf
| foo.tar.gz.
| 
| In general, files that end in .tgz or .tar.gz are gziped tar archives while
| files that just end in .gz are really just one file.

Just to add to this excellent explanation by Ray, in the Unix world it 
is still pretty common to see files compressed with the Unix compress
utility, in which case you might see file names like:

foo.Z

and 

foo.tar.Z

all the things Ray mentions apply to these files as well, gzip and tar 
can handle them in exactly the same manner as *.gz files are handled.

Gary


Reply to: