Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cpio(1) — UTek W2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)

cp(1)

file(1)

find(1)

tar(1)

cpio(5)



CPIO(1)                 COMMAND REFERENCE                 CPIO(1)



NAME
     cpio - copy file archives in and out

SYNOPSIS
     cpio -i [ [ -B ] [ -F number ] [ -N size ] [ -P prompt ] [
     -R path ] [ -S ] [ -V volume ] [ -b ] [ -c ] [ -d ] [ -f ] [
     -m ] [ -n blocks ] [ -r ] [ -s ] [ -t ] [ -u ] [ -v ] [ -6 ]
     ] [ patterns ]

     cpio -o [ -B ] [ -N size ] [ -P prompt ] [ -V volume ] [ -a
     ] [ -c ] [ -n blocks ] [ -v ] ]

     cpio -p [ -a ] [ -d ] [ -l ] [ -m ] [ -r ] [ -u ] [ -v ] ]
     directory

DESCRIPTION
     Cpio -i (copy in) extracts files from the standard input
     which is assumed to be the product of a previous cpio -o.
     Only files with names that match patterns are selected.
     Patterns are given in the name-generating notation of
     sh(1sh).  In patterns, meta-characters ?, *, and [...] match
     the slash / character.  Multiple patterns may be specified
     and if no patterns are specified, the default for patterns
     is * (for example, select all files).  The extracted files
     are conditionally created and copied into the current
     directory tree based upon the options described below.

     This procedure is usually used to extract files from a cpio
     archive file or tape.

     Cpio -o (copy out) reads the standard input to obtain a list
     of pathnames and copies those files onto the standard output
     together with pathname and status information.  The normal
     procedure is to redirect the standard output to a file or
     device (such as a tape drive), thus archiving the files.

     Cpio -p (pass) reads the standard input to obtain a list of
     pathnames of files that are conditionally created and copied
     into the destination directory tree based upon the options
     described below.  This is similar to using cp(1) with the -r
     option.

     Multi-volume Archives
     Cpio with the options -i and -o has the ability to handle
     multi-volume files.  The name of the device that data is to
     be read from or written to can be specified by the -V
     option.  The number of 512-byte blocks on a volume can be
     specified with the -n option (if this is not specified, cpio
     goes until the system says the volume is full or empty).

     When the volume is full or empty, the program enters an
     interactive mode and prints the message



Printed 10/17/86                                                1





CPIO(1)                 COMMAND REFERENCE                 CPIO(1)



          No more (data or space)  on (Volume).

     followed by a short explanation, which may either be the
     default explanation or the text specified by the -P option.

     If a device or filename was specified with the -V option, or
     if a device or filename was specified in interactive mode
     before, the same file or device can be used by typing
     return.  If no device or file has been named, the name of
     the device or file to be used must be entered.  (The
     exception to this is when cpio was invoked to read or write
     a regular file.  In this case, typing return will cause cpio
     to continue using the same file.) In case of disk or tape,
     this should be the same device name that was used when the
     command was invoked.

     When using tapes or diskettes in this mode, you must have
     the new tape or diskette ready to read or write before you
     hit return.

     This information is also supplied during interactive mode.

     It is important to note that any type of file can be read or
     written in this mode.  This makes it possible to break up
     archives into smaller pieces for easier transport.

     Portability
     Cpio archive headers contain the device numbers of the files
     on the archives.  The standard device number is 16 bits
     wide, but it may be longer on some systems.  This version of
     cpio handles this difference in a portable way.  On systems
     with longer device numbers, device numbers for regular files
     are hashed so that they will fit in the header and still be
     unique for purposes of relinking.  Device numbers for
     special files are marked specially and stored in the data
     area.

     Because of this possible difference, cpio archives should
     not be extracted (with -i ) by the superuser.

OPTIONS
     -6  Process an old file (for example, UNIX System Sixth
         Edition format).  Only useful with -i (copy in).

     -B  Input/output is to be blocked 5,120 bytes to the record
         (does not apply to the pass option; meaningful only with
         data directed to or from tape or floppy disk.

     -F number
         Stop extracting or listing after number files have been
         extracted/listed.  This is only usable with the -i
         option.



Printed 10/17/86                                                2





CPIO(1)                 COMMAND REFERENCE                 CPIO(1)



     -N size
         Input/output is to be blocked size times 512 bytes to
         the record (does not apply to the pass option;
         meaningful only with data directed to or from tape of
         floppy disk.  The -B option is equivalent to -N 10.
         (See CAVEATS.)

     -P prompt
         Print the given text instead of the default media change
         text (see Multi-volume Archives above).  The text is
         printed as given, with no special processing done.

     -R path
         Copy relative to path. The given path is prepended to
         all names beginning with a /.  This action takes place
         before the rename (-r option) process.  This is only
         usable with the -i option.

     -S  Swap half words.  Use only with the -i option.

     -V volume
         Specifies the name of the file or device to read/write.
         Can not be used with -p.

     -a  Reset access and modification times of input files after
         they have been copied.

     -b  Swap both bytes and half words.  Use only with the -i
         option.

     -c  Write header information in ASCII character form for
         portability.

     -d  Directories are to be created as needed.

     -f  Copy in all files except those in patterns.

     -i  Extracts files from the standard input which is assumed
         to be the product of a previous cpio -o.

     -l  Whenever possible, link files rather than copying them.
         Usable only with the -p option.

     -m  Retain previous file modification time.  This option is
         ineffective on directories that are being copied.

     -n blocks
         Specifies the number of 512-byte blocks that can be read
         from or written to the volume (does not require the -V
         option).  When this number is reached, the program
         enters interactive mode so that a new volume can be
         mounted.  Cannot be used with the -p option.



Printed 10/17/86                                                3





CPIO(1)                 COMMAND REFERENCE                 CPIO(1)



     -o  Reads the standard input to obtain a list of pathnames
         and copies those files onto the standard output together
         with pathname and status information.

     -p  Reads the standard input to obtain a list of pathnames
         of files that are conditionally created and copied into
         the destination directory tree based upon the options.

     -r  Interactively renames files.  If the user types a null
         line, the file is skipped.

     -s  Swap bytes.  Use only with the -i option.

     -t  Print a table of contents of the input.  No files are
         created.

     -u  Copy unconditionally (normally, an older file will not
         replace a newer file with the same name).

     -v  Verbose:  causes a list of filenames to be printed.
         When used with the -t option, the table of contents
         looks similar to the output of an ls -l command (see
         ls(1)).

EXAMPLES
     The first example below copies the contents of a directory
     into an archive; the second duplicates a directory
     hierarchy:



          ls | cpio -o >/dev/mt0


          cd olddir
          find . -print | cpio -pdl newdir


     This next example shows a typical use of cpio to archive a
     directory and all subdirectories and place the archive in
     the file ``arch.cpio''.



          find dir -print | cpio -ov -V arch.cpio

     The trivial case



          find . -print | cpio -oB >/dev/rmt0




Printed 10/17/86                                                4





CPIO(1)                 COMMAND REFERENCE                 CPIO(1)



     can be handled more efficiently by:



          find . -cpio /dev/rmt0


RETURN VALUE
     [NO_ERRS]      Command completed without error.

     [1]            The user quit while changing volume.

     [USAGE]        Incorrect command line syntax. Execution
                    terminated.

     [NP_WARN]      An error warranting a warning message
                    occurred. Execution continues.

     [NP_ERR]       An error occurred that was not a system
                    error.  Execution terminated.

     [P_WARN]       A system error occurred. Execution continues.
                    See intro(2) for more information on system
                    errors.

     [P_ERR]        A system error occurred. Execution
                    terminated.  See intro(2) for more
                    information on system errors.

CAVEATS
     The output from the -v option is placed on the standard
     error.  See the manual page for the shell being used for
     information on redirecting the standard error.

     On some versions of UNIX, pathnames in cpio archives are
     restricted to 128 characters.  This version restricts
     pathnames to the system maximum (currently 1024); thus, the
     resulting archives may be unportable.

     If there are too many unique linked files, the program runs
     out of memory to keep track of them and, thereafter, linking
     information is lost.

     Cpio does not know about symbolic links, but since it is
     usually used with find, there is little danger of getting
     into loops. Also, instead of archiving or copying symbolic
     links, cpio copies the files pointed to by the links, if
     they exist.

     Only the superuser can copy special files.





Printed 10/17/86                                                5





CPIO(1)                 COMMAND REFERENCE                 CPIO(1)



     The editors ex, vi, e, edit, and view, and the programs more
     and page will not allow the editing or displaying of non-
     ASCII cpio archives. ASCII cpio archives are not restricted.

     When using cpio with a streaming tape drive, the option -N
     256 should be used in order to keep the tape streaming.

SEE ALSO
     ar(1), cp(1), file(1), find(1), tar(1), cpio(5).














































Printed 10/17/86                                                6





































































%%index%%
na:72,72;
sy:144,1115;
de:1259,2465;3868,2783;
op:6651,632;7427,2426;9997,1111;
ex:11108,602;11854,79;
rv:11933,850;
ca:12783,1047;13974,580;
se:14554,198;
%%index%%000000000189

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026