JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 1: User Commands     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

User Commands

acctcom(1)

adb(1)

addbib(1)

admin(1)

aedplot(1B)

alias(1)

allocate(1)

amt(1)

appcert(1)

apptrace(1)

apropos(1)

ar(1)

arch(1)

as(1)

asa(1)

at(1)

atoplot(1B)

atq(1)

atrm(1)

audioconvert(1)

audioplay(1)

audiorecord(1)

auths(1)

auto_ef(1)

awk(1)

banner(1)

basename(1)

basename(1B)

batch(1)

bc(1)

bdiff(1)

bfs(1)

bg(1)

bgplot(1B)

biff(1B)

break(1)

cal(1)

calendar(1)

cancel(1)

case(1)

cat(1)

cc(1B)

cd(1)

cdc(1)

cdrw(1)

chdir(1)

checkeq(1)

checknr(1)

chgrp(1)

chkey(1)

chmod(1)

chown(1)

chown(1B)

ckdate(1)

ckgid(1)

ckint(1)

ckitem(1)

ckkeywd(1)

ckpath(1)

ckrange(1)

ckstr(1)

cksum(1)

cktime(1)

ckuid(1)

ckyorn(1)

clear(1)

cmp(1)

cocheck(1F)

cocreate(1F)

codestroy(1F)

col(1)

comb(1)

comm(1)

command(1)

compress(1)

continue(1)

coproc(1F)

coreceive(1F)

cosend(1F)

cp(1)

cpio(1)

cpp(1)

cputrack(1)

crle(1)

crontab(1)

crtplot(1B)

crypt(1)

csh(1)

csplit(1)

ct(1C)

ctags(1)

ctrun(1)

ctstat(1)

ctwatch(1)

cu(1C)

cut(1)

date(1)

dc(1)

deallocate(1)

decrypt(1)

delta(1)

deroff(1)

df(1B)

dhcpinfo(1)

diff(1)

diff3(1)

diffmk(1)

digest(1)

digestp(1)

dircmp(1)

dirname(1)

dirs(1)

dis(1)

disable(1)

dispgid(1)

dispuid(1)

dos2unix(1)

download(1)

dpost(1)

dtappsession(1)

du(1)

du(1B)

dumbplot(1B)

dump(1)

dumpcs(1)

dumpkeys(1)

echo(1)

echo(1B)

echo(1F)

ed(1)

edit(1)

egrep(1)

eject(1)

elfdump(1)

elfedit(1)

elfsign(1)

elfwrap(1)

enable(1)

encrypt(1)

enhance(1)

env(1)

eqn(1)

errange(1)

errdate(1)

errgid(1)

errint(1)

erritem(1)

error(1)

errpath(1)

errstr(1)

errtime(1)

erruid(1)

erryorn(1)

eval(1)

ex(1)

exec(1)

exit(1)

expand(1)

export(1)

exportfs(1B)

expr(1)

expr(1B)

exstr(1)

face(1)

factor(1)

false(1)

fastboot(1B)

fasthalt(1B)

fc(1)

fdformat(1)

fg(1)

fgrep(1)

file(1)

file(1B)

filep(1)

filesync(1)

filofaxp(1)

find(1)

finger(1)

fmlcut(1F)

fmlexpr(1F)

fmlgrep(1F)

fmli(1)

fmt(1)

fmtmsg(1)

fold(1)

for(1)

foreach(1)

franklinp(1)

from(1B)

ftp(1)

ftpcount(1)

ftpwho(1)

function(1)

gcore(1)

gencat(1)

geniconvtbl(1)

genlayouttbl(1)

genmsg(1)

get(1)

getconf(1)

getfacl(1)

getfrm(1F)

getitems(1F)

getlabel(1)

getopt(1)

getoptcvt(1)

getopts(1)

gettext(1)

gettxt(1)

getzonepath(1)

gigiplot(1B)

glob(1)

goto(1)

gprof(1)

graph(1)

grep(1)

groups(1)

groups(1B)

grpck(1B)

hash(1)

hashcheck(1)

hashmake(1)

hashstat(1)

head(1)

help(1)

helpdate(1)

helpgid(1)

helpint(1)

helpitem(1)

helppath(1)

helprange(1)

helpstr(1)

helptime(1)

helpuid(1)

helpyorn(1)

history(1)

hostid(1)

hostname(1)

hp7221plot(1B)

hpplot(1B)

i286(1)

i386(1)

i486(1)

i860(1)

iAPX286(1)

iconv(1)

idnconv(1)

if(1)

implot(1B)

indicator(1F)

indxbib(1)

install(1B)

ipcrm(1)

ipcs(1)

isainfo(1)

isalist(1)

jobs(1)

join(1)

jsh(1)

kbd(1)

kdestroy(1)

keylogin(1)

keylogout(1)

kill(1)

kinit(1)

klist(1)

kmdb(1)

kmfcfg(1)

kpasswd(1)

krb5-config(1)

ksh(1)

ktutil(1)

lari(1)

last(1)

lastcomm(1)

ld(1)

ld(1B)

ldap(1)

ldapadd(1)

ldapdelete(1)

ldaplist(1)

ldapmodify(1)

ldapmodrdn(1)

ldapsearch(1)

ldd(1)

ld.so.1(1)

let(1)

lex(1)

limit(1)

line(1)

lint(1B)

list_devices(1)

listusers(1)

llc2_autoconfig(1)

llc2_config(1)

llc2_stats(1)

ln(1)

ln(1B)

loadkeys(1)

locale(1)

localedef(1)

logger(1)

logger(1B)

login(1)

logname(1)

logout(1)

longline(1F)

look(1)

lookbib(1)

lorder(1)

lp(1)

lpc(1B)

lpq(1B)

lpr(1B)

lprm(1B)

lpstat(1)

lptest(1B)

ls(1)

ls(1B)

m4(1)

mac(1)

mach(1)

machid(1)

madv.so.1(1)

mail(1)

Mail(1B)

mail(1B)

mailcompat(1)

mailp(1)

mailq(1)

mailstats(1)

mailx(1)

make(1S)

man(1)

mconnect(1)

mcs(1)

mdb(1)

mesg(1)

message(1F)

mixerctl(1)

mkdir(1)

mkmsgs(1)

mkstr(1B)

mktemp(1)

moe(1)

more(1)

mp(1)

mpss.so.1(1)

msgfmt(1)

mt(1)

mv(1)

nawk(1)

nca(1)

ncab2clf(1)

ncakmod(1)

neqn(1)

newform(1)

newgrp(1)

news(1)

newsp(1)

newtask(1)

nice(1)

NIS+(1)

nis+(1)

nis(1)

niscat(1)

nischgrp(1)

nischmod(1)

nischown(1)

nischttl(1)

nisdefaults(1)

niserror(1)

nisgrep(1)

nisgrpadm(1)

nisln(1)

nisls(1)

nismatch(1)

nismkdir(1)

nisopaccess(1)

nispasswd(1)

nisrm(1)

nisrmdir(1)

nistbladm(1)

nistest(1)

nl(1)

nm(1)

nohup(1)

notify(1)

nroff(1)

od(1)

on(1)

onintr(1)

optisa(1)

pack(1)

page(1)

pagesize(1)

pargs(1)

passwd(1)

paste(1)

patch(1)

pathchk(1)

pathconv(1F)

pax(1)

pcat(1)

pcred(1)

pdp11(1)

perl(1)

pfcsh(1)

pfexec(1)

pfiles(1)

pfksh(1)

pflags(1)

pfsh(1)

pg(1)

pgrep(1)

pkginfo(1)

pkgmk(1)

pkgparam(1)

pkgproto(1)

pkgtrans(1)

pkill(1)

pktool(1)

plabel(1)

pldd(1)

plimit(1)

plot(1B)

plottoa(1B)

pmap(1)

popd(1)

postdaisy(1)

postdmd(1)

postio(1)

postmd(1)

postplot(1)

postprint(1)

postreverse(1)

posttek(1)

ppgsz(1)

ppriv(1)

pr(1)

praliases(1)

prctl(1)

preap(1)

prex(1)

print(1)

printenv(1B)

printf(1)

priocntl(1)

proc(1)

prof(1)

profiles(1)

projects(1)

prs(1)

prt(1)

prun(1)

ps(1)

ps(1B)

psig(1)

pstack(1)

pstop(1)

ptime(1)

ptree(1)

pushd(1)

pvs(1)

pwait(1)

pwd(1)

pwdx(1)

ranlib(1)

rcapstat(1)

rcp(1)

rdist(1)

read(1)

readfile(1F)

readonly(1)

red(1)

refer(1)

regcmp(1)

regex(1F)

rehash(1)

reinit(1F)

remote_shell(1)

remsh(1)

renice(1)

repeat(1)

reset(1B)

reset(1F)

return(1)

rksh(1)

rlogin(1)

rm(1)

rmail(1)

rmdel(1)

rmdir(1)

rmformat(1)

roffbib(1)

roles(1)

rpcgen(1)

rpm2cpio(1)

rsh(1)

run(1F)

runat(1)

rup(1)

rup(1C)

ruptime(1)

rusage(1B)

rusers(1)

rwho(1)

sact(1)

sag(1)

sar(1)

sccs(1)

sccs-admin(1)

sccs-cdc(1)

sccs-comb(1)

sccs-delta(1)

sccsdiff(1)

sccs-get(1)

sccs-help(1)

sccs-prs(1)

sccs-prt(1)

sccs-rmdel(1)

sccs-sact(1)

sccs-sccsdiff(1)

sccs-unget(1)

sccs-val(1)

scp(1)

script(1)

sdiff(1)

sed(1)

sed(1B)

select(1)

set(1)

set(1F)

setcolor(1F)

setenv(1)

setfacl(1)

setlabel(1)

setpgrp(1)

settime(1)

sftp(1)

sh(1)

shell(1F)

shell_builtins(1)

shift(1)

shutdown(1B)

size(1)

sleep(1)

snca(1)

snmpstatus(1)

soelim(1)

sort(1)

sortbib(1)

sotruss(1)

source(1)

sparc(1)

spell(1)

spellin(1)

spline(1)

split(1)

srchtxt(1)

ssh(1)

ssh-add(1)

ssh-agent(1)

ssh-http-proxy-connect(1)

ssh-keygen(1)

ssh-keyscan(1)

ssh-socks5-proxy-connect(1)

stop(1)

strchg(1)

strconf(1)

strings(1)

strip(1)

stty(1)

stty(1B)

sum(1)

sum(1B)

sun(1)

suspend(1)

svcprop(1)

svcs(1)

switch(1)

symorder(1)

sysV-make(1)

t300(1)

t300(1B)

t300s(1)

t300s(1B)

t4013(1B)

t4014(1)

t450(1)

t450(1B)

tabs(1)

tail(1)

talk(1)

tar(1)

tbl(1)

tcopy(1)

tee(1)

tek(1)

tek(1B)

telnet(1)

test(1)

test(1B)

test(1F)

tftp(1)

time(1)

timemanp(1)

times(1)

timesysp(1)

timex(1)

tip(1)

tnfdump(1)

tnfxtract(1)

touch(1)

touch(1B)

tplot(1)

tput(1)

tr(1)

tr(1B)

trap(1)

troff(1)

true(1)

truss(1)

tset(1B)

tsort(1)

tty(1)

type(1)

typeset(1)

u370(1)

u3b(1)

u3b15(1)

u3b2(1)

u3b5(1)

ucblinks(1B)

ul(1)

ulimit(1)

umask(1)

unalias(1)

uname(1)

uncompress(1)

unexpand(1)

unget(1)

unhash(1)

unifdef(1)

uniq(1)

units(1)

unix2dos(1)

unlimit(1)

unpack(1)

unset(1)

unset(1F)

unsetenv(1)

until(1)

uptime(1)

users(1B)

uucp(1C)

uudecode(1C)

uuencode(1C)

uuglist(1C)

uulog(1C)

uuname(1C)

uupick(1C)

uustat(1C)

uuto(1C)

uux(1C)

vacation(1)

val(1)

valdate(1)

valgid(1)

valint(1)

valpath(1)

valrange(1)

valstr(1)

valtime(1)

valuid(1)

valyorn(1)

vax(1)

vc(1)

vedit(1)

ver(1)

vgrind(1)

vi(1)

view(1)

vipw(1B)

volcancel(1)

volcheck(1)

volmissing(1)

volrmmount(1)

vplot(1B)

vsig(1F)

w(1)

wait(1)

wc(1)

what(1)

whatis(1)

whence(1)

whereis(1B)

which(1)

while(1)

who(1)

whoami(1B)

whocalls(1)

whois(1)

write(1)

xargs(1)

xgettext(1)

xstr(1)

yacc(1)

yes(1)

ypcat(1)

ypmatch(1)

yppasswd(1)

ypwhich(1)

zcat(1)

zlogin(1)

zonename(1)

cpio

- copy file archives in and out

Synopsis

cpio -i [-bBcdfkmPrsStuvV6,t;] [-C bufsize] [-E file] 
     [-H header] [-I  [-M message]] [-R id] [pattern]...
cpio -o [-aABcLPvV,t;] [-C bufsize] [-H header] 
     [-O file [-M message]]
cpio -p [-adlLmPuvV,t;] [-R id] directory

Description

The cpio command copies files into and out of a cpio archive. The cpio archive may span multiple volumes. The -i, -o, and -p options select the action to be performed. The following list describes each of the actions. These actions are mutually exclusive.

Copy In Mode

cpio -i (copy in) extracts files from the standard input, which is assumed to be the product of a previous cpio -o command. Only files with names that match one of the patterns are selected. See sh(1) and OPERANDS for more information about pattern. Extracted files are conditionally copied into the current directory tree, based on the options described below. The permissions of the files will be those of the previous cpio -o command. The owner and group will be the same as the current user, unless the current user is the super-user. If this is the case, owner and group will be the same as those resulting from the previous cpio -o command. Notice that if cpio -i tries to create a file that already exists and the existing file is the same age or younger (newer), cpio will output a warning message and not replace the file. The -u option can be used to unconditionally overwrite the existing file.

Copy Out Mode

cpio -o (copy out) reads a list of file path names from the standard input and copies those files to the standard output, together with path name and status information in the form of a cpio archive. Output is padded to an 8192-byte boundary by default or to the user-specified block size (with the -B or -C options) or to some device-dependent block size where necessary (as with the CTC tape).

Pass Mode

cpio -p (pass) reads a list of file path names from the standard input and conditionally copies those files into the destination directory tree, based on the options described below.

If the underlying file system of the source file supports detection of holes as reported by pathconf(2), the file is a sparse file, and the destination file is seekable, then holes in sparse files are preserved in pass mode, otherwise holes are filled with zeros.

cpio assumes four-byte words.

If, when writing to a character device (-o) or reading from a character device (-i), cpio reaches the end of a medium (such as the end of a diskette), and the -O and -I options are not used, cpio prints the following message:

To continue, type device/file name when ready.

To continue, you must replace the medium and type the character special device name (/dev/rdiskette for example) and press RETURN. You may want to continue by directing cpio to use a different device. For example, if you have two floppy drives you may want to switch between them so cpio can proceed while you are changing the floppies. Press RETURN to cause the cpio process to exit.

Options

The following options are supported:

-i

(copy in) Reads an archive from the standard input and conditionally extracts the files contained in it and places them into the current directory tree.

-o

(copy out) Reads a list of file path names from the standard input and copies those files to the standard output in the form of a cpio archive.

-p

(pass) Reads a list of file path names from the standard input and conditionally copies those files into the destination directory tree.

The following options can be appended in any sequence to the -i, -o, or -p options:

-a

Resets access times of input files after they have been copied, making cpio's access invisible. Access times are not reset for linked files when cpio -pla is specified.

-A

Appends files to an archive. The -A option requires the -O option. Valid only with archives that are files, or that are on floppy diskettes or hard disk partitions. The effect on files that are linked in the existing portion of the archive is unpredictable.

-b

Reverses the order of the bytes within each word. Use only with the -i option.

-B

Blocks input/output 5120 bytes to the record. The default buffer size is 8192 bytes when this and the -C options are not used. -B does not apply to the -p (pass) option.

-c

Reads or writes header information in ASCII character form for portability. There are no UID or GID restrictions associated with this header format. Use this option between SVR4-based machines, or the -H odc option between unknown machines. The -c option implies the use of expanded device numbers, which are only supported on SVR4-based systems. When transferring files between SunOS 4 or Interactive UNIX and the Solaris 2.6 Operating environment or compatible versions, use -H odc.

-C bufsize

Blocks input/output bufsize bytes to the record, where bufsize is replaced by a positive integer. The default buffer size is 8192 bytes when this and -B options are not used. -C does not apply to the -p (pass) option.

-d

Creates directories as needed.

-E file

Specifies an input file (file) that contains a list of filenames to be extracted from the archive (one filename per line).

-f

Copies in all files except those in patterns. See OPERANDS for a description of pattern.

-H header

Reads or writes header information in header format. Always use this option or the -c option when the origin and the destination machines are different types. This option is mutually exclusive with options -c and -6.

Valid values for header are:

bar

bar head and format. Used only with the -i option ( read only).

crc | CRC

ASCII header with expanded device numbers and an additional per-file checksum. There are no UID or GID restrictions associated with this header format.

odc

ASCII header with small device numbers. This is the IEEE/P1003 Data Interchange Standard cpio header and format. It has the widest range of portability of any of the header formats. It is the official format for transferring files between POSIX-conforming systems (see standards(5)). Use this format to communicate with SunOS 4 and Interactive UNIX. This header format allows UIDs and GIDs up to 262143 to be stored in the header.

tar | TAR

tar header and format. This is an older tar header format that allows UIDs and GIDs up to 2097151 to be stored in the header. It is provided for the reading of legacy archives only, that is, in conjunction with option -i.

Specifying this archive format with option -o has the same effect as specifying the “ustar” format: the output archive is in ustar format, and must be read using -H ustar.

ustar | USTAR

IEEE/P1003 Data Interchange Standard tar header and format. This header format allows UIDs and GIDs up to 2097151 to be stored in the header.

Files with UIDs and GIDs greater than the limit stated above will be archived with the UID and GID of 60001. To transfer a large file (8 Gb — 1 byte), the header format can be tar|TAR, ustar|USTAR, or odc only.

-I file

Reads the contents of file as an input archive, instead of the standard input. If file is a character special device, and the current medium has been completely read, replace the medium and press RETURN to continue to the next medium. This option is used only with the -i option.

-k

Attempts to skip corrupted file headers and I/O errors that may be encountered. If you want to copy files from a medium that is corrupted or out of sequence, this option lets you read only those files with good headers. For cpio archives that contain other cpio archives, if an error is encountered, cpio may terminate prematurely. cpio will find the next good header, which may be one for a smaller archive, and terminate when the smaller archive's trailer is encountered. Use only with the -i option.

-l

In pass mode, makes hard links between the source and destination whenever possible. If the -L option is also specified, the hard link will be to the file referred to by the symbolic link. Otherwise, the hard link will be to the symbolic link itself. Use only with the -p option.

-L

Follows symbolic links. If a symbolic link to a directory is encountered, archives the directory referred to by the link, using the name of the link. Otherwise, archives the file referred to by the link, using the name of the link.

-m

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

-M message

Defines a message to use when switching media. When you use the -O or -I options and specify a character special device, you can use this option to define the message that is printed when you reach the end of the medium. One %d can be placed in message to print the sequence number of the next medium needed to continue.

-O file

Directs the output of cpio to file, instead of the standard output. If file is a character special device and the current medium is full, replace the medium and type a carriage return to continue to the next medium. Use only with the -o option.

-P

Preserves ACLs. If the option is used for output, existing ACLs are written along with other attributes, except for extended attributes, to the standard output. ACLs are created as special files with a special file type. If the option is used for input, existing ACLs are extracted along with other attributes from standard input. The option recognizes the special file type. Notice that errors will occur if a cpio archive with ACLs is extracted by previous versions of cpio. This option should not be used with the -c option, as ACL support may not be present on all systems, and hence is not portable. Use ASCII headers for portability.

-r

Interactively renames files. If the user types a carriage return alone, the file is skipped. If the user types a ``.'', the original pathname will be retained. Not available with cpio -p.

-R id

Reassigns ownership and group information for each file to user ID. (ID must be a valid login ID from /etc/passwd.) This option is valid only for the super-user.

-s

Swaps bytes within each half word.

-S

Swaps halfwords within each word.

-t

Prints a table of contents of the input. If any file in the table of contents has extended attributes, these are also listed. No files are created. -t and -V are mutually exclusive.

-u

Copies unconditionally. Normally, an older file will not replace a newer file with the same name, although an older directory will update a newer directory.

-v

Verbose. Prints a list of file and extended attribute names. When used with the -t option, the table of contents looks like the output of an ls -l command (see ls(1)).

-V

Special verbose. Prints a dot for each file read or written. Useful to assure the user that cpio is working without printing out all file names.

-6

Processes a UNIX System Sixth Edition archive format file. Use only with the -i option. This option is mutually exclusive with -c and -H.

-@

Includes extended attributes in archive. By default, cpio does not place extended attributes in the archive. With this flag, cpio will look for extended attributes on the files to be placed in the archive and add them, as regular files, to the archive. The extended attribute files go in the archive as special files with special file types. When the -@ flag is used with -i or -p, it instructs cpio to restore extended attribute data along with the normal file data. Extended attribute files can only be extracted from an archive as part of a normal file extract. Attempts to explicitly extract attribute records are ignored.

Operands

The following operands are supported:

directory

A path name of an existing directory to be used as the target of cpio -p.

pattern

Expressions making use of a pattern-matching notation similar to that used by the shell (see sh(1)) for filename pattern matching, and similar to regular expressions. The following metacharacters are defined:

*

Matches any string, including the empty string.

?

Matches any single character.

[...]

Matches any one of the enclosed characters. A pair of characters separated by `-' matches any symbol between the pair (inclusive), as defined by the system default collating sequence. If the first character following the opening `[' is a `!', the results are unspecified.

!

The ! (exclamation point) means not. For example, the !abc* pattern would exclude all files that begin with abc.

In pattern, metacharacters ?, *, and [ . . .] match the slash (/) character, and backslash (\) is an escape character. Multiple cases of pattern can be specified and if no pattern is specified, the default for pattern is * (that is, select all files).

Each pattern must be enclosed in double quotes. Otherwise, the name of a file in the current directory might be used.

Usage

See largefile(5) for the description of the behavior of cpio when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

Examples

The following examples show three uses of cpio.

Example 1 Using standard input

example% ls | cpio -oc > ../newfile

When standard input is directed through a pipe to cpio -o, as in the example above, it groups the files so they can be directed (>) to a single file (../newfile). The -c option insures that the file will be portable to other machines (as would the -H option). Instead of ls(1), you could use find(1), echo(1), cat(1), and so on, to pipe a list of names to cpio. You could direct the output to a device instead of a file.

Example 2 Extracting files into directories

example% cat newfile | cpio -icd "memo/a1" "memo/b*"

In this example, cpio -i uses the output file of cpio -o (directed through a pipe with cat), extracts those files that match the patterns (memo/a1, memo/b*), creates directories below the current directory as needed (-d option), and places the files in the appropriate directories. The -c option is used if the input file was created with a portable header. If no patterns were given, all files from newfile would be placed in the directory.

Example 3 Copying or linking files to another directory

example% find . -depth -print | cpio -pdlmv newdir

In this example, cpio -p takes the file names piped to it and copies or links (-l option) those files to another directory, newdir. The -d option says to create directories as needed. The -m option says to retain the modification time. (It is important to use the -depth option of find(1) to generate path names for cpio. This eliminates problems that cpio could have trying to create files under read-only directories.) The destination directory, newdir, must exist.

Notice that when you use cpio in conjunction with find, if you use the -L option with cpio, you must use the -follow option with find and vice versa. Otherwise, there will be undesirable results.

For multi-reel archives, dismount the old volume, mount the new one, and continue to the next tape by typing the name of the next device (probably the same as the first reel). To stop, type a RETURN and cpio will end.

Environment Variables

See environ(5) for descriptions of the following environment variables that affect the execution of cpio: LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_TIME, TZ, and NLSPATH.

TMPDIR

cpio creates its temporary file in /var/tmp by default. Otherwise, it uses the directory specified by TMPDIR.

Exit Status

The following exit values are returned:

0

Successful completion.

>0

An error occurred.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
SUNWcsu
CSI
Enabled
Interface Stability
Stable

See Also

ar(1), cat(1), echo(1), find(1), ls(1), pax(1), setfacl(1), sh(1), tar(1), vold(1M), archives.h(3HEAD), attributes(5), environ(5), fsattr(5), largefile(5), standards(5)

Notes

The maximum path name length allowed in a cpio archive is determined by the header type involved. The following table shows the proper value for each supported archive header type.

Header type
Command line options
Maximum path name length
BINARY
-o
256
POSIX
-oH odc”
256
ASCII
-oc
1023
CRC
-oH crc”
1023
USTAR
-oH ustar”
255

When the command line options “-o -H tar” are specified, the archive created is of type USTAR. This means that it is an error to read this same archive using the command line options “-i -H tar”. The archive should be read using the command line options “-i -H ustar”. The options “-i -H tar” refer to an older tar archive format.

An error message is output for files whose UID or GID are too large to fit in the selected header format. Use -H crc or -c to create archives that allow all UID or GID values.

Only the super-user can copy special files.

Blocks are reported in 512-byte quantities.

If a file has 000 permissions, contains more than 0 characters of data, and the user is not root, the file will not be saved or restored.

The inode number stored in the header (/usr/include/archives.h) is an unsigned short, which is 2 bytes. This limits the range of inode numbers from 0 to 65535. Files which are hard linked must fall in this inode range. This could be a problem when moving cpio archives between different vendors' machines.

When the Volume Management daemon is running, accesses to floppy devices through the conventional device names (for example, /dev/rdiskette) may not succeed. See vold(1M) for further details.

You must use the same blocking factor when you retrieve or copy files from the tape to the hard disk as you did when you copied files from the hard disk to the tape. Therefore, you must specify the -B or -C option.

During -p and -o processing, cpio buffers the file list presented on stdin in a temporary file.

The new pax(1) format, with a command that supports it (for example, pax , tar, or cpio), should be used for large files. The cpio command is no longer part of the current POSIX standard and is deprecated in favor of pax.