Oct 24, 2017

Compress and extract a directory using tar.bz2:

Compress a directory using tar.bz2:


# tar -jcvf archive_name.tar.bz2 directory_to_compress

To extract the files (to a different directory) use:

# tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/