Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cpio(1) — SunOS 3.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)

find(1)

cpio(5)

tar(1)

CPIO(1)  —  USER COMMANDS

NAME

cpio − copy file archives in and out

SYNOPSIS

cpio −o [ aBcv ]

cpio −i [ bcdfmrsStuv6 ] [ patterns ]

cpio −p [ adlmruv ] directory

DESCRIPTION

cpio copies files into and out from a cpio copy archive.  The archive (built by cpio −o) contains pathname and status information, along with the contents of one or more archived files. 

OPTIONS

cpio −o
Copy out as an archive.  Reads the standard input for a list of pathnames, then copies the named files to the standard output in archive form — including pathname and status information.

a Reset the access times of input files after they have been copied. 

B Input/output is to be blocked at 5120 bytes to the record.  This does not apply to the pass option.  This option is only meaningful with data directed to or from raw magnetic devices, such as /dev/rmt? 

c Write header information in ASCII character form for portability. 

v Verbose option.  A list of filenames is displayed.  When used with the t option, the table of contents looks like the output of an ls −l command (see ls(1V)).

cpio −i
Copy in an archive.  Reads in an archive from the standard input and extracts files with names matching filename substitution patterns, supplied as arguments. 

patterns are similar to those in sh or csh, save that within cpio, the metacharacters ?, ∗ and [...] also match the slash (/) character.  If no patterns are specified, the default is ∗ (select all files). 

b Swap both bytes and halfwords after reading in data. 

d directories should be created as needed. 

f Copy in all files except those matching patterns.

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

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

s Swap bytes after reading in data. 

S Swap halfwords after reading in data. 

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

u Copy unconditionally. Normally, an older file will not replace a newer file with the same name.

6 Process a UNIX Version 6 file or files. 

cpio −p
One pass.  Copies out and in in a single operation.  Destination pathnames are interpreted relative to the named directory.

l Whenever possible, link files rather than copying them. 

EXAMPLES

To copy the contents of a directory into an archive:

tutorial% ls | cpio −o > /dev/mt0

To duplicate the olddir directory hierarchy in the newdir directory:

tutorial% cd  olddir
tutorial% find . −depth −print | cpio −pdl newdir

The trivial case

find . −depth −print │ cpio −oB >/dev/rmt0

can be handled more efficiently by:

find . −cpio /dev/rmt/0m

cpio archive tapes from other sites may have bytes swapped within the archive.  Although the s option only swaps the data bytes and not those in the header cpio recognizes tapes like this and swaps the bytes in the header automatically. 

SEE ALSO

ar(1), find(1), cpio(5), tar(1)

BUGS

Pathnames are restricted to 128 characters.  If there are too many unique linked files, cpio runs out of memory and linking information is lost thereafter.  Only the superuser can copy special files. 

Sun Release 3.5  —  Last change: 17 February 1986

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