Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux compress Command

Linux compress Command

Linux Command Reference Linux Command Reference

The Linux compress command is a rather old Unix archive compression utility. Compressed archives are given a .Z extension to distinguish them from uncompressed files, and can be decompressed with uncompress. To compress several files into one archive, you must first tar the files and then compress them. Since gzip produces a better compression ratio, most people have switched to gzip as their compression tool.

Syntax

compress [-dfvcV] [-b maxbits] [file ...]

Parameters:

Compress a file

[root@runoob.com ~]# compress abc.h

[root@runoob.com ~]# ls

abc.h.Z

Decompress a file

[root@runoob.com ~]# compress -d abc.h.Z

[root@runoob.com ~]# ls

abc.h.

Compress with a specified compression ratio

[root@runoob.com ~]# compress -b 7 abc.h

Force compression of a folder

[root@runoob.com ~]# compress -rf /home/abc/ 

Linux Command Reference Linux Command Reference