Back to CFM home             Brown University

Examples of compressing files

To compress a single file:

   ls -l
   -rw-------  1 erpl08      67584 Sep 30  1992

   ls -l *.Z
   -rw-------  1 erpl08      33950 Sep 30  1992

The command ls -l shows the size of the file to be 67584 bytes before compression and 33950 bytes with compression - reducing the size of the file by 50%.

To compress several files:

   compress sect[1-8].fm

This compresses files through

To recover compressed files:

   uncompress sect[1-4].fm.Z

This will decompress the compressed files through

To recover a file and retain the compressed .Z file:

   zcat presentation.html.Z | less

This recreates the uncompressed file presentation.html which is then piped into the less command to present the file for viewing. The output from the zcat command could also be redirected to a file:

   zcat bibliography.txt.Z > bib.txt; vi bib.txt

This redirects the output from the zcat command to a file named bib.txt which is then displayed using the editor vi.

[Home] [Search] [Index]