The word \u201ctarball\u201d is often used to describe the type of file used to back up a select group of files and join them into a single file. The name comes from the .tar file extension and the tar command that is used to group together the files into a single file that is then sometimes compressed to make it smaller for its move to another system.\nTarballs are often used to back up personal or system files in place to create an archive, especially prior to making changes that might have to be reversed. Linux sysadmins, for example, will often create a tarball containing a series of configuration files before making changes to an application just in case they have to reverse those changes. Extracting the files from a tarball that\u2019s sitting in place will generally be faster than having to retrieve the files from backups.\n\nHow to create a tarball on Linux\nYou can create a tarball and compress it in a single step if you use a command like this one:\n$ tar -cvzf PDFs.tar.gz *.pdf\n\nThe result in this case is a compressed (gzipped) file that contains all of the PDF files that are in the current directory. The compression is optional, of course. A slightly simpler command would just put all of the PDF files into an uncompressed tarball:\n$ tar -cvf PDFs.tar *.pdf\n\nNote that it\u2019s the z in that list of options that causes the file to be compressed or \u201czipped\u201d. The c specifies that you are creating the file and the v (verbose) indicates that you want some feedback while the command is running. Omit the v if you don't want to see the files listed.\nAnother common naming convention is to give zipped tarballs the extension .tgz instead of the double extension .tar.gz as shown in this command:\n$ tar cvzf MyPDFs.tgz *.pdf\n\nHow to extract files from a tarball\nTo extract all of the files from a gzipped tarball, you would use a command like this:\n$ tar -xvzf file.tar.gz\n\nIf you use the .tgz naming convention, that command would look like this:\n$ tar -xvzf MyPDFs.tgz\nTo extract an individual file from a gzipped tarball, you do almost the same thing but add the file name:\u00a0\n$ tar -xvzf PDFs.tar.gz ShenTix.pdf\nShenTix.pdf\nls -l ShenTix.pdf\n-rw-rw-r-- 1 shs shs 122057 Dec 14 14:43 ShenTix.pdf\n\nYou can even delete files from a tarball if the tarball is not compressed. For example, if we wanted to remove tile file that we extracted above from the PDFs.tar.gz file, we would do it like this:\u00a0\n$ gunzip PDFs.tar.gz\n$ ls -l PDFs.tar\n-rw-rw-r-- 1 shs shs 10700800 Dec 15 11:51 PDFs.tar\n$ tar -vf PDFs.tar --delete ShenTix.pdf\n$ ls -l PDFs.tar\n-rw-rw-r-- 1 shs shs 10577920 Dec 15 11:45 PDFs.tar\n\nNotice that we shaved a little space off the tar file while deleting the ShenTix.pdf file. We can then compress the file again if we want:\n$ gzip -f PDFs.tar\nls -l PDFs.tar.gz\n-rw-rw-r-- 1 shs shs 10134499 Dec 15 11:51 PDFs.tar.gzFlickr \/ James St. John\n\nThe versatility of the command line options makes working with tarballs easy and very convenient.