Entire directory structures may be archived to a single file with the tar command. The format for archiving with the tar command is:
tar cvf filename.tar directory1
Where filename.tar is the name of the resulting tar file and directory1 is the name of the directory that you wish to archive. Note that the original directory is not affected by the archiving operation, the archive is a copy of all the files and information contained in the directory.
The format for unarchiving a tar file is:
tar xvf filename.tar
The directory structure that was saved to the tar file is restored to the directory where the unarchiving command is given.
Some of the more useful options for tar are: