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/
jstands for bzip2 compression method
ccreates a new archive file
vmeans verbose output
fwe specify the new filename as a next argument
To 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.