System Administration Guide: Basic Administration

How to List the Files on a Tape (cpio)


Note –

Listing the table of contents takes a long time 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.


    $ cpio -civt < /dev/rmt/n
    

    -c

    Specifies that the cpio command should read files in ASCII character format.

    -i

    Specifies that the cpio command should operate in copy-in mode even though it's only listing files at this point.

    -v

    Displays the output in a format that is 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 that 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 shows how to list the files on the tape in drive 0.


$ cpio -civt < /dev/rmt/0
drwx--x--x    2 kryten    users        0 Jul 14 09:34 2001, answers
-rw------t    1 kryten    users      800 Jul 14 09:36 2001, b
drwx--x--x    2 kryten    users        0 Jul 14 09:32 2001, sc.directives
-rw------t    1 kryten    users   200000 Jul 14 09:35 2001, direct241
drwx--x--x    2 kryten    users        0 Jul 14 09:32 2001, tests
-rw------t    1 kryten    users      800 Jul 14 09:36 2001, test13times
396 blocks