Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)

cpio(1)

ls(1)

btar(1)



  tar(1)                              CLIX                              tar(1)



  NAME

    tar - Archives tape files

  SYNOPSIS

    /bin/tar -c[lvwfb[#s]] device block file ...

    /bin/tar -r[lvwb[#s]] device block [file ... ]

    /bin/tar -t[vf[#s] device

    /bin/tar -u[lvwb[#s]] device block [file ... ]

    /bin/tar -x[movwf[#s]] device [file ... ]

  FLAGS

    -r  Writes the named files on the end of the tape.  The c flag implies
        this flag.  This flag cannot be used with the b modifier.

    -x  Extracts the named files from the tape.  If a named file matches a
        directory whose contents had been written onto the tape, this
        directory is (recursively) extracted.  Use the file or directory's
        relative path when appropriate, or tar will not find a match.  The
        owner, modification time, and mode are restored (if possible).  If no
        files argument is given, the entire content of the tape is extracted.
        Note that if several files with the same name are on the tape, the
        last one overwrites all earlier ones.

    -t  Lists the names and other information for the specified files each
        time they occur on the tape.  The listing is similar to the format
        produced by the ls -l command.  If no files argument is given, all the
        names on the tape are listed.

    -u  Adds the named files to the tape if they are not already there, or if
        they have been modified since last written on that tape.  This flag
        implies the -r flag.

    -c  Creates a new tape; writing begins at the beginning of the tape,
        instead of after the last file.  This flag implies the -r flag.

  DESCRIPTION

    The tar command saves and restores files on magnetic tape.  Its actions
    are controlled by the key.  The key is a string of characters containing
    one flag (c, r, t, u, or x) and possibly followed by one or more modifiers
    (v, w, f, b, and #).  Other arguments to the command are files (or
    directory names) specifying which files are to be dumped or restored.  In
    all cases, appearance of a directory name refers to the files and
    (recursively) subdirectories of that directory.



  2/94 - Intergraph Corporation                                              1






  tar(1)                              CLIX                              tar(1)



    The characters below may be used in addition to the flag that selects the
    desired function.  Use them in the order shown in the synopsis.

    #s   Determines the drive on which the tape is mounted (replace # with the
         drive number) and the speed of the drive (replace s with l, m, or h
         for low, medium or high).  The modifier tells tar to use a drive
         other than the default drive, or the drive specified with the -f
         optional flag.  For example, with the 5h modifier, tar would use
         /dev/mt/5h or /dev/mt0 instead of the default drives /dev/rmt/0m or
         /dev/mt0, respectively.  However, if -f /dev/rmt0 5h appeared on the
         command line, tar would use /dev/rmt5h or /dev/mt0.  The default
         entry is 0m.

    v    Causes tar to type the name of each file it treats, preceded by the
         function letter.  If used with the t function, v lists information
         about tape entries, similar to the format of the ls -l command.

    w    Causes tar to display the action to be taken, followed by the name of
         the file, and then wait for the user's confirmation.  If a word
         beginning with y is given, the action is performed.  Any other input
         means ``no''.  This is not valid with the t flag.

    f    Causes tar to use the device argument as the name of the archive
         instead of /dev/rmt/0m or /dev/mt0.  If the name of the file is -,
         tar writes to stdout or reads from stdin, whichever is appropriate.
         Thus, tar can be used as the head or tail of a pipeline.  The tar
         command can also be used to move hierarchies, as shown in the
         following example:

         cd fromdir; tar cf - . | (cd todir; tar xf -)


    b    Causes tar to use the block argument as the blocking factor for tape
         records.  The default blocking factor is 1, and the maximum is 20
         512-byte blocks.  This function should not be supplied when operating
         on regular archives or block special devices.  This function is
         mandatory, however, when reading archives on raw magnetic tape
         archives (see f above).  The block size is determined automatically
         when reading tapes created on block special devices (x and t flags).
         This modifier is not valid with the r flag.

    l    Causes tar to complain if it cannot resolve all of the links to the
         files being dumped.  If the l flag is not specified, no error
         messages are displayed.

    m    Causes tar not to restore the modification times.  The modification
         time of the file will be the time of extraction.

    o    Causes extracted files to take on the user and group identifier of
         the user running the program, rather than those on tape.  This is
         only valid with the x flag.



  2                                              Intergraph Corporation - 2/94






  tar(1)                              CLIX                              tar(1)



  EXAMPLES

    1.  This command creates a tar archive of the current directory on SCSI
        device 5:

        tar -cvf /dev/rmt/mt5 .

        This command uses the verbose option, and includes hidden files.

    2.  This command extracts all of a tar archive from SCSI device 6, using
        the verbose option:

        tar xvf /dev/rmt/mt6


  FILES

    /dev/rmt/*
           Directory for default tape devices.

    /dev/rmt/0m
           Default tape device (rewindable).

    /dev/rmt/0mn
           Default tape device (nonrewindable).

  NOTES

    The tar command doesn't copy empty directories or special files.

    The hyphen (-) for specifying flags is optional.

    If the f is not used, tar defaults to the floppy disk drive.

    The r and u flags do not work with 9-track or 8 mm cartridge tape drives.

    The u flag can be slow.

    The b flag should not be used with archives that are going to be updated.
    The current magnetic tape driver cannot backspace raw magnetic tape.  If
    the archive is on a disk file, the b flag should not be used at all,
    because updating an archive stored on disk can destroy it.

    There is no way to ask for the nth occurrence of a file.

    Tape errors are handled ungracefully.

    The current limit on pathname length is 100 characters.

  DIAGNOSTICS




  2/94 - Intergraph Corporation                                              3






  tar(1)                              CLIX                              tar(1)



    The tar command reports messages in the following cases:

    ⊕  Bad key characters and tape read/write errors.

    ⊕  Not enough memory available to hold the link tables.

  EXIT VALUES

    Exit values are not valid.

  RELATED INFORMATION

    Commands:  ar(1), cpio(1), ls(1), btar(1)









































  4                                              Intergraph Corporation - 2/94




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026