Extracting directories which are members of an archive is similar to extracting other files. The main difference to be aware of is that if the extracted directory has the same name as any directory already in the working directory, then files in the extracted directory will be placed into the directory of the same name. Likewise, if there are files in the pre-existing directory with the same names as the members which you extract, the files from the extracted archive will overwrite the files already in the working directory (and possible subdirectories). This will happen regardless of whether or not the files in the working directory were more recent than those extracted.
However, if a file was stored with a directory name as part of its file
name, and that directory does not exist under the working directory when
the file is extracted, tar
will create the directory.
We can demonstrate how to use `--extract' to extract a directory file with an example. Change to the `practice' directory if you weren't there, and remove the files `folk' and `jazz'. Then, go back to the parent directory and extract the archive `music.tar'. You may either extract the entire archive, or you may extract only the files you just deleted. To extract the entire archive, don't give any file names as arguments after the archive name `music.tar'. To extract only the files you deleted, use the following command:
$ tar -xvf music.tar practice/folk practice/jazz
@FIXME{need to show tar's response; used verbose above. also, here's a good place to demonstrate the -v -v thing. have to write that up (should be trivial, but i'm too tired!).}
Because you created the directory with `practice' as part of the file names of each of the files by archiving the `practice' directory as `practice', you must give `practice' as part of the file names when you extract those files from the archive.
@FIXME{IMPORTANT! show the final structure, here. figure out what it will be.}
Go to the first, previous, next, last section, table of contents.