System Administration Guide

How to List the Files on a Tape (cpio)


Note -

Listing the table of contents takes as long as it does to read the archive file because the cpio command must process the entire archive.


  1. Insert a tape into the tape drive.

  2. List the files on tape using the cpio command.


    $ cpio -civt < /dev/rmt/n
    

    -c

    Specifies that cpio should read files in ASCII character format.

    -i

    Specifies that cpio should operate in copy-in mode (even though its only listing files at this point).

    -v

    Displays the output in a format similar to the output from the ls -l command.

    -t

    Lists the table of contents for the files on the tape in the tape drive you specify. 

    < /dev/rmt/n

    Specifies the input file of an existing cpio archive.

Example--Listing the Files on a Tape (cpio)

In this example, the table of contents for the tape in drive 0 contains three files.


$ cpio -civt < /dev/rmt/0
drwxr-xr-x  2 rimmer users 0  Oct 28 09:17 1996, answers
drwxr-xr-x  2 rimmer users 0  Oct 28 09:17 1996, sc.directives
drwxr-xr-x  2 rimmer users 0  Oct 28 09:17 1996, tests
8 blocks