How to Compress and Extract tar.bz2 Files in the Terminal

Quick tip: to create a backup of a directory (like a website) with a .tar.bz2 format, you can compress it like this:

  1. To compress a directory, you can use: tar -cjvf BACKUP_my_directory.tar.bz2 ./www
  2. To extract the tar.bz2 file do: tar -xjf BACKUP_my_directory.tar.bz2


Let us know your comments by tweeting to @codeselfstudy or emailing [email protected].
(The commenting system here is offline for the moment but will return soon. This blog is still under construction.)

Return to the Code Self Study Blog.