You can compress files with the vxcompress command. The vxcompress command performs the following functions:
See the vxcompress
(1) manual page.
You can specify one or more filenames. If you specify the -r option, then you can specify directories, and the vxcompress command operates recursively on the directories.
You can specify the file compression algorithm and strength with the vxcompress -t command. The default algorithm is gzip, which is currently the only supported algorithm. The strength is a number from 1 to 9, with a default of 6. Strength 1 gives the fastest performance with least compression, while strength 9 gives the slowest performance with the greatest compression. For example, you specify strength 3 gzip compression as "gzip-3".
When reporting the compression details for a file, the vxcompress -l command or vxcompress -L command displays the following information:
Compression algorithm
Strength
Compression block size
% of file data saved by compression
% of extents that are compressed
This is the percentage of extents in the file that are compressed, without regard to the size of the extents. This percentage provides an idea of whether it is worthwhile to recompress the file. After recompression, the percentage is always 100%. However, shared extents are counted as uncompressed, and thus the percentage will be less than 100% if the file has shared extents.
If you attempt to compress a file with the vxcompress command and the extents have data that cannot be compressed, the command still marks the file as compressed and replaces the extents with compressed extent descriptors.
If you recompress a file, you do not need to specify any options with the vxcompress command. The command automatically uses the options that you used to compress the file previously.
The following command compresses the file1
file, using the default algorithm and strength of gzip-6:
$ vxcompress file1
The following command recursively compresses all files below the dir1
directory, using the gzip algorithm at the highest strength (9):
$ vxcompress -r -t gzip-9 dir1
The following command compresses the file2
file and all files below the dir2
directory, using the gzip algorithm at strength 3, while limiting the vxcompress command to a single thread and reducing the scheduling priority:
$ vxcompress -r -t gzip-3 file2 dir2
The following command displays the results of compressing the file1
file in human-friendly units:
$ vxcompress -L file1 %Comp Physical Logical %Exts Alg-Str BSize Filename 99% 1 KB 159 KB 100% gzip-6 1024k file1
The following command uncompresses the file1
file:
$ vxcompress -u file1