Command Line Basics: Create And Extract Tarballs

“To create a tarball, it’s good to have all of the files you
want in the package to be contained in a directory. Although this
is not necessary, it’s convenient when you then go to extract the
file later. That way the archive will be extracted to its own
directory rather than dumping its contents into the current

You can then create a tarball from the command line like

tar -cvzf archive.tar.gz directory_to_archive

Complete Story