Compressing Files with compress

Compressing a file just means making it smaller so that it takes up less hard-disk space. It’s like filling a toy box, closing the lid, then sitting on it to moosh the contents so that they fit into a smaller space. Any time you create a file that you’ll be sending via FTP or that people will access through the Web, you’ll want to compress the file so that it takes less time to send and download. As Code Listing 13.8 shows, you compress files using the compress command.

Code Listing 13.8. Listing files before and after compressing them lets you see how much smaller the new file is.
[ejr@hobbes compression]$ ls -l l*
-rw-r-r-1 ejr   users   501760 Jul 27
→ 10:06 labrea.tar
[ejr@hobbes compression]$ compresslabrea.tar ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.