$title = "Compressing files - the compress command"; $area = "Unix Support"; $metadata = "unix, file, compression, compress"; $pfloc = ""; require '/usr/local/wwwdocs/ucs/fragments/header.phtml'; require '/usr/local/wwwdocs/ucs/fragments/header-bc.phtml'; ?>
If you have large files which you no longer need to access regularly but which you do need to keep, the disk space which they occupy may be drastically reduced by compressing them. For example, if you have a large file called out3.dat then the command:
compress out3.dat
will replace the file out3.dat with a much smaller file called out3.dat.Z. To recover the original, the command:
uncompress out3.dat
will reinstate the file out3.dat and remove the file called out3.dat.Z.
See the online manual for a full description of compress.
IMPORTANT:
The files produced by compress are binary files, even if the original uncompressed files were text files. If you want to transfer such compressed files to other computer systems, then they should be transferred in binary mode not in text mode.
Avoid using the compress command in one of your directories if you have used nearly all of your disk quota. You can easily lose your file. It would be better to copy the file you want to compress to the /tmp directory, compress the file there, remove the original file from your directory, and then move the compressed version from /tmp to your directory.