System Administration Guide, Volume 1

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 it's 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
drwx--x--x    2 kryten    users        0 Jul 14 09:34 1999, answers
-rw------t    1 kryten    users      800 Jul 14 09:36 1999, b
drwx--x--x    2 kryten    users        0 Jul 14 09:32 1999, sc.directives
-rw------t    1 kryten    users   200000 Jul 14 09:35 1999, direct241
drwx--x--x    2 kryten    users        0 Jul 14 09:32 1999, tests
-rw------t    1 kryten    users      800 Jul 14 09:36 1999, test13times
396 blocks