System Administration Guide, Volume 1

How to Retrieve Specific Files From a Tape (cpio)

  1. Change to the directory where you want to put the files.

  2. Insert the tape into the tape drive.

  3. Retrieve a subset of files from a tape using the cpio command.


    $ cpio -icv "*file" < /dev/rmt/n
    

    -i

    Reads in the contents of the tape. 

    -c

    Specifies that cpio should read headers in ASCII character format.

    -v

    Displays the files as they are retrieved in a format similar to the output from the ls command.

    "*file"

    Specifies that all of the files that match the pattern are copied to the current directory. You can specify multiple patterns, but each must be enclosed in double quotation marks. 

    < /dev/rmt/n

    Specifies the input file. 

  4. Verify the files are copied by listing the contents of the current directory.


    $ ls -l
    

Example--Retrieving Specified Files From a Tape (cpio)

The following example retrieves all files with the suffix chapter from the tape in drive 0.


$ cd /home/smith/Book
$ cpio -icv "*chapter" < /dev/rmt/0
Boot.chapter 
Directory.chapter 
Install.chapter 
Intro.chapter
31 blocks
$ ls -l

See cpio(1) for more information.