There are several reasons you may want to create an archive of a file or directory. Here are some of the most common ones:
  • Archive and compress unused directories to conserve disk space
  • Create an archive of a directory and files before an upgrade allowing you to restore the original contents if there is a problem
  • Archive a directory before making any major changes
  • Create an archive to move several files and folders to another system as one
  • Create an archive as a means of software distribution
One of the most useful utilities for archiving a set of files and directories is tar.The following command is a basic way of archiving a directorynamed mydata into a tar archive file named vntutor.tar

tar -cvf vntutor.tar mydata
Then, you can also extract the archive into its original structure by using
tar -xvf vntutor.tar