01. Archiving, compression and Backup

What is compression?

Compression is the reduction of the number of bits needed to store data.

Why is compression useful?

Compression saves storage space and allows for speedy file transfers and low bandwidth. Furthermore, it's useful in creating backups in case of disk failure.

The data-holding services we use today all use some sort of compression to limit file size. For example, mp3 players have a special .mp3 file format that compresses music files.

How is compression achieved?

Compression is mainly achieved by removing redundant data. For example, if you had an image of the flag below.

Italian Flag is easy to compress
The Italian flag is simply made up of three colors.

If you wanted to describe the flag to a friend, you wouldn't say "green on pixel 1x1, green on pixel 1x2, green on pixel 1x3..." and so on. You'd simply say "image-height: 300, image-width: 400, split into thirds vertically with green, white and red colors from left to right." Image compression works just like this, eliminating any redundant information.

Two types of algorithms

There are two types of compression algorithms - lossy and lossless.

Lossy algorithms

In a lossy algorithm, some of the data is lost in trade for a smaller file size. An example of this would be the .mp3 file format, which eliminites less audible sounds.

Lossless algorithms

Lossless files, on the other hand, preserves all data contained in the original file. Considering any loss of data is intolerable in files, we'll be looking at compressing using commands that use lossless algorithms.

Aching back from coding all day?

Acupressure Mat & Pillow

Aching back from coding all day? Try Back Problems

Relieve your stress, back, neck and sciatic pain through 1,782 acupuncture points for immediate neck pain relief. Made for lower, upper and mid chronic back pain treatment, and improves circulation, sleep, digestion and quality of life.

$$ Check price
144.87144.87Amazon 4.5 logo(1,890+ reviews)

More Back Problems resources

Take your Linux skills to the next level!

Linux for Beginners

Take your Linux skills to the next level! Try Linux & UNIX

Linux for Beginners doesn't make any assumptions about your background or knowledge of Linux. You need no prior knowledge to benefit from this book. You will be guided step by step using a logical and systematic approach. As new concepts, commands, or jargon are encountered they are explained in plain language, making it easy for anyone to understand.

$ Check price
24.9924.99Amazon 4.5 logo(101+ reviews)

More Linux & UNIX resources