How it works...

bzip2 is used to compress the files and folder at the same time. Just issue the command in the terminal and the files will be compressed. After the compression, the compressed file will get the extension .bz2.

zip compress the files individually and then collects them in a single file.

A TAR file is a collection of different files and directories, which combines them into one file. TAR is used for creating backups and archives.

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.