[Top] [Prev] [Next]

cp

cp - copy files

Synopsis

cp  	fromfile tofile
cp  	fromfile... todir
cp -r 	fromdir... todir

Description

In the first form fromfile is any name and tofile is any name except an existing directory.

In the second form the commands copy one or more fromfiles into a todir under their original file names, as if by a sequence of commands in the first form. Thus

  cp f1 f2 dir

is equivalent to

  cp f1 dir/f1; cp f2 dir/f2

When the cp command copies the contents of plain (non-directory) files fromfile to tofile, the mode and owner of tofile are preserved if it already exists; the mode of fromfile is used otherwise.

Options
-r

The -r option directs cp to recursively copy the named directories (fromdir's) to the target direction (todir), the last entry on the command line.

See Also

cat and stat

Diagnostics

The cp command refuses to copy files onto themselves.



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.