System Administration Guide, Volume I

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 an archive tape into the tape drive.

  2. List the files on the 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)

The following example lists the files on the tape in drive 0.


$ cpio -civt < /dev/rmt/0
drwxr-xr-x  2 rimmer users 0  Jun  9 16:07 1998, answers
drwxr-xr-x  2 rimmer users 0  Jun  9 16:07 1998, sc.directives
drwxr-xr-x  2 rimmer users 0  Jun  9 16:07 1998, tests
8 blocks