Skip to main content

You may be using a Web browser that does not support standards for accessibility and user interaction. Find out why you should upgrade your browser for a better experience of this and other standards-based sites...

Dartmouth Home  Search  Index

Dartmouth Home | Search | Index

Dartmouth home page
Computing at Dartmouth
Computing > Support >  Library >  Research > UNIX > Files >

Compressing a File

Compressing files generally makes files smaller and saves space. During the compression process, the original file is not removed until the compressed file is complete. This means you will need extra space in the directory to compress files, and if you have gone over your quota, you will not be able to compress your files. To get around this problem, you may want to move (mv command) the file you want to compress to one of the "scratch" spaces or to /tmp, then compress the file.

Note: In many cases, Gzip will do a better job than compress.

  • To compress a single file named data1, use compress data1 or gzip data1.
  • To compress all files in a directory that have the string data in their name, use compress *data* or gzip *data*.
  • To compress all files in a sub-directory named old_data, use find ./old_data -type f -exec compress {} \; or find ./old_data -type f -exec gzip {} \;.

See also: Uncompressing a File

Last Updated: 5/7/07