<tt>cp</tt>: Copy



next up previous contents
Next: mv: Move Up: File system Commands: Previous: ls: Listing

cp: Copy

Files can be copied onto other files using the cp command:

where filename1 and filename2 are files, not directories.
-i
(interactive) will prompt the user if filename1 will overwrite filename2.
-p
(preserve) will keep the time-stamps and permissions of the original file.

filename1 will be copied onto filename2. If filename2 does not exist, it will be created. If it exists, its contents will be overwritten!

A second method, involving directories, has been discussed in the previous section.

Files can also be copied using the following syntax:

cp [-ip] filename... directory
where filename may be one or more files. These files will be copied into directory.



Super-User
Fri Feb 17 15:55:40 EST 1995