## cp

#### OS/161 Reference Manual

### Name

cp - copy files

### Synopsis

`/bin/cp` oldfile newfile

### Description

`cp` copies the file oldfile to the file newfile, overwriting newfile if it already exists.

`cp` supports no options.

Note that `cp` does not support the Unix idiom `cp file1 file2 ... destination-dir` to copy a number of files at once. In particular, `cp foo bar/` will fail, probably with "Is a directory".

### Requirements

`cp` uses the following syscalls:

- open
- read
- write
- close
- _exit

`cp` should function properly once the basic system calls assignment is completed.

### See Also

ln, mv