Compressing Files in Unix

The sole reason for compressing files is to save space. You want to save space, so you make room. This is analogous to closet space in your home. Often, you can buy something that will allow you to organize and condense your space so that you have more room to put more things in. This theoretically is the same concept behind compression. You take something, squeeze it down, and organize it so that you can store more.

You can also compress files to send them to others. This is common with digital photography and today's email clients. Many people have email and digital cameras, and they want to send photos through email. Often an email of this size will be denied because the person you are sending it to may not have enough space on her system, or in the mailbox on the email server, to accept a file that size. Therefore, you will need to compress it.

Makes sense, right? Well, that's all you need to know about why to compress something. Now you need to know the actual mechanics of it.

If you happen to be using a system where disk space is restricted and you need to maximize available space, you can use the Unix commands you will learn here. These commands will reduce the amount of space your files occupy, and will allow you to store more files in the space you are allowed.

There are three major compression formats you will use when working with Unix:

  • Unix program compress makes compressed files

  • Personal or third party Unix programs (such as PKZIP program) make zipped files

  • Unix GNU program gzip makes gzipped files

We will cover all of these in both compressing and decompressing (or uncompressing) formats, as you will need to know how to decompress something that you compressed. Each of these formats has a set of programs for compressing and uncompressing. For our first example, we shall look at the standard (and hardly used) compress tool that comes with almost every distribution of Unix.

Why Compress? By applying an algorithm, you can compress files for the purpose of conserving space or speeding up file transfers.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.233.135