Home How To How To Perform Compression Of A File/Folder In Windows, Mac And Linux

-

How To Perform Compression Of A File/Folder In Windows, Mac And Linux

We run out of storage space with the growing number of data we deal with in our everyday lives. One way to save space is to compress files. You reduce their size when compressing files so that they have less space on your hard drive. Another advantage of file compression is that you can easily share it on social media websites and message platforms that usually limit the size of your file.

What Is The Definition Of Compression? And What Are Its Types?

Compression means removing a file’s redundancy and thereby reducing its size. Most tools use algorithms to delete unnecessary bits of data from a file. Two types of compression methods are available:

#1 Lossy

A technology of compression that does not decompress digital information to 100% of the original. Lossy techniques can produce elevated compression and produce lower compressed documents, but a number of the initial pixels, sound waves or video frames are always removed. The most commonly used JPEG picture, MPEG video and MP3 audio formats are examples.

The more compression, the lower the file. In very big printed images, however, a high compression loss can be noted and individuals with an outstanding hearing can notice a major distinction between MP3 music and high-resolution audio files. Moving video frames can typically tolerate more pixel loss than still images.

#2 Lossless

As the name shows, lossless compression compresses a file without losing its quality. This is done by deleting unnecessary metadata from the file. With the lossless method, the original file can easily be restored without damaging the quality. Lossless compression for any file format not possible with the loss format can be applied. The lossless method of compression uses algorithms such as Run Length Encoding (RLE), Huffman Coding, and Lempel-Ziv-Welch (LZW).

What Is The Difference Between Lossy And Lossless Compressions?

The lossy compression, on the other hand, reduces a file by permanently deleting certain data, in particular, redundant information. Only a portion of the initial data is still present when the file is uncompressed (though the customer may not notice it). Lossy compression is generally used for video and sound, where most users don’t detect a certain amount of information loss. The JPEG image file, which is commonly used for photographs and other complex images on the web, is a lossy compressed image. The creator can decide by using JPEG compression how much loss to introduce and compensate between file size and image quality.

Every single piece of data that was originally in the file will remain uncompressed with lossless compression. All data is fully restored. This is usually the technique of choice for text or tablet files, where losing words or financial information could be a problem. The Graphics Interchange File (GIF) is a compressed picture format used on the web which provides lossless compression.

What Will Happen After A File Is Compressed?

You use either the lossy or lossless method when compressing a file. Most file compression tools, including WinZip, use a lossless compression technique as the original file is preserved while the size is reduced. Different file compression methods are available in Windows, Mac, and Linux. Below, we discussed various ways of doing the same thing:

How To Perform Compression Of A File/Folder In Windows?

Performing Compression using Windows’ native file archive tool

You do not need a third-party tool to compress a file/folder in Windows 10 since a Windows native tool already exists to zip files and folders.

Compressed zip

This is how you can compress a file/folder in Windows 10:

  1. Go to Windows Explorer and right-click on file/folder which needs to be compressed.
  2. Select the option ‘Add to archive’
  3. You will find options in the next window for archive format, file rename, and compression method.
  4. To extract files from a compressed folder, double-click on the zip folder and drag it to a new location.

Extract all

Performing Compression Using Third-Party Tools On Windows

For Windows operating system, there are several third-party file compression tools available. WinRar, WinZip, 7zip, and PeaZip are some of the most popular tools.

How To Perform Compression Of A File/Folder In Mac?

Compressing files could be useful if you are short on disk space on your macOS device. Mac devices feature an integrated ZIP compression and decompression tool, one of the most frequently used archive formats these days. The tool uses a loss-free compression technique that ensures that your files can be restored without losing any valuable data or quality.

mac compress

  1. Go to the finder, where you can select the file/folder which needs to be compressed.
  2. Right-click to open the pop-up menu and select the Compress option.
  3. The compression time of the file/folder completely depends on the RAM and Processor.
  4. A new compressed file will be created with a.ZIP extension
  5. If you want to decompress the file and view its contents, double-click and the built-in Mac tool automatically decompresses it and opens it for you.

mac compress 2

Performing Compression Using Third-Party Tools On Mac

You may use third-party compression tools for Mac if you do not want to use the ZIP file archive format and select any other format of archive file for efficient file compression.

Some of the most popular macOS compression tools are WinZip, Better Zip, Entropy and iZip. These tools protect passwords, multi-volume archives, cloud support, etc.

How To Perform Compression Of A File/Folder In Linux?

Linux and UNIX use the default file format TAR and gzip. Tar utility tool does not use gzip alone to produce a tar.gz extension file archive known as the tarball. You should remember some commands if you want to compress Linux files. Some of the most commonly used Linux file compression commands are:

tar -czvf name_of_archive.tar.gz/location_of_directory

If in your present folder, you have a folder called “dir1” and want to save it to a folder named “dir1archived.tar.gz,” then the following command is necessary:

tar -czvf dir1archived.tar.gz dir1

Things To Be Considered Before Compressing A File

Some points must be taken into account if you plan to compress/decompress a file or folder:

  • Do not convert a lossy format to a lossless format as it is merely a waste of disk space.
    Compressing a file repeatedly degrades its quality.
  • Some antivirus and anti-malware programs do not open compressed documents and folders and therefore expose your computer to safety risks.
  • Before you uncompress a compressed file, be sure to scan it with an antivirus that can scan it.
  • Technical mistakes could occur when compressing or decompressing a file for low memory and disk space use.

Now you understand what file compression is, and how to use Windows, Mac, and Linux to compress a file, you can store files/folders in much lower in size and save room on the hard disk of your device. We have seen the distinction between lossy and lossless compression methods so that you can attempt distinct compression tools according to your requirements.

Nikhil Guptahttps://thenikhilgupta.com/
Engineer | Amateur Internet Scholar | Incurable Web Fan | IoT Geek | General Social Media Geek | Thinker And An Introvert

What's More