Japanese
FAQDevelopment environment
■ | Go forward
FAQ/Development environment

UNIX environment


How to compress data in UNIX?

Q) Please tell me how to decompress UNIX compressed files.
A)
There are generally two types of UNIX compressed files:
DOS LHA etc. perform archiving and compression at the same time, but UNIX generally performs the two processes separately. For archiving, use a program called tar, and for compression, use gzip or compress. Therefore, if you want to compress an entire directory, first use tar to combine the directory image into a single file, and then compress it using gzip or compress.
Explaining how to use each,

compress file:
Files with extensions such as .Z or .taz can be decompressed using the uncompress program that comes standard with UNIX. The format is

 uncompress file name

However, if the extension is not .Z, it will search for a file name with .Z added to the file name, so you will need to change the file name of such files in advance.

gzip file:
The extension is .gz, .tgz, etc., and it is compressed using GNU gzip.
To unzip,

 gzip -df filename

Or

 gunzip file name

tar file:
When you unzip a .taz, .tgz, etc. file, it turns into a separate file called .tar. This is a collection of multiple files with directory information, and to disassemble it, use a program called tar that comes standard with UNIX.

 tar xvf file name

* If you have GNU tar (gtar),

 gtar zxvf foo.tgz

You can also decompress and unzip the archive at the same time.
Ask your system administrator if you have GNU tar.


■ | Go forward
FAQDevelopment environment
Copyright SEGA ENTERPRISES, LTD. 1997