If you save files, you can compress them to take up less room.
If you want to save a file, but won’t be using it very often, then you can compress it to make it take up less space. For example, let’s suppose I have a PostScript file that I want to hold on to for sentimental reasons:
% ls -l kitty.ps -rw-r---- 1 lmui 1593548 Oct 18 16:56 kitty.ps
This is a big file, and my administrator could rightfully be annoyed that I want to keep it around. However, I can ease my conscience a little by compressing it with the compress command:
% compress kitty.ps
The file is compressed and given a .Z extension. If I list the compressed file, I see that it’s now much smaller:
% ls -l kitty.ps.Z -rw-r---- 1 lmui 45182 Oct 18 16:56 kitty.ps.Z
The file is now more than 35 times smaller! As it turns out, some file formats compress more tightly than others, and PostScript files compress particularly well.
In the compressed format, the file cannot be used as easily. For example, you cannot send this compressed PostScript file directly to the printer. However, whenever you want the file back in its full , uncompressed glory, just use the uncompress command:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access