Easy Tutorial
❮ Linux Comm Tail Linux Comm Netconf ❯

Linux compress Command

Linux Command Manual

The Linux compress command is an old Unix file compression utility. Compressed files are appended with a .Z extension to distinguish them from uncompressed files, and can be decompressed using uncompress. To compress multiple files into one archive, you must first tar the files before compressing. Due to gzip providing better compression ratios, most people have switched to using gzip for file compression.

Syntax

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

Parameters:

Compressing Files

[root@tutorialpro.org ~]# compress abc.h
[root@tutorialpro.org ~]# ls

abc.h.Z

Decompressing Files

[root@tutorialpro.org ~]# compress -d abc.h.Z
[root@tutorialpro.org ~]# ls

abc.h.

Compressing with a Specified Ratio

[root@tutorialpro.org ~]# compress -b 7 abc.h

Forcibly Compressing a Directory

[root@tutorialpro.org ~]# compress -rf /home/abc/

Linux Command Manual

❮ Linux Comm Tail Linux Comm Netconf ❯