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:
c : Create an archive.
x : Extract files from an archive.
t : Table of contents of files contained in the tar file.
p : Restore files with original permission mode, ignore
current umask.
f : Use a file instead of default system tape drive. The argument after -f
is the name of the file to be used.
v : Verbose. Have tar tell you what it is doing.
Care should be used when untar'ing a file to disk as it may clobber
existing disk files you may have.