background
|
|
Games
Ruffnecks Gaming
Gaming for everyone
More icon

Random
|
|
Up Image
Navigation
Search this Site
Enter your search terms

Site Breadcrumb - You are here
|
Reference   Unix Guide

cp

The cp command copies files or directories from one place to another. You can copy a set of files to another file, or copy one or more files under the same name in a directory. If the destination of the file you want to copy is an existing file, then the existing file is overwritten. If the destination is an existing directory, then the file is copied into that directory.

Structure: cp [options] file1 file2
cp [options] files directory

If you wanted to copy the file gorilla.html into the directory called apes, here's what you would do:

 cp gorilla.html /apes/

A handy option to use with cp is -r. This recursively copies a particular directory and all of its contents to the specified directory, so you won't have to copy one file at a time.

Back to the index.