When you create a .tar.bz2 file, you most likely want to have an entire folder compressed. This is easy by using tar utility with bzip2 compression.
Let’s assume that your folder is folder
. Enter thefollowing command in Linux terminal:
$ tar -jcvf folder.tar.gz folder/
j
stands for bzip2 compression methodc
creates a new archive filev
means verbose outputf
we specify the new filename as a next argumentTo view the contents of the new folder.tar.bz2, just type:
$ tar -tf folder.tar.bz2
This should output a list of files in this archive.