next up previous contents
Next: Disk Utilization Up: Basic Directory Commands Previous: Searching Directories

Archiving Directories and Files

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:

 
    tex2html_wrap_inline1080  c : Create an archive.

tex2html_wrap_inline1080 x : Extract files from an archive.

tex2html_wrap_inline1080 t : Table of contents of files contained in the tar file.

tex2html_wrap_inline1080 p : Restore files with original permission mode, ignore

current umask.

tex2html_wrap_inline1080 f : Use a file instead of default system tape drive. The argument after -f

is the name of the file to be used.

tex2html_wrap_inline1080 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.



Larry Latour
Fri Sep 12 08:12:59 EDT 1997