Developer's Daily Unix by Example
  main | java | perl | unix | DevDirectory
   
Main
Unix
Education
Unix by Example
   

 

Command cp
Description The "cp" command is used to copy files and directories.

Note that when using the cp command, you must always specify both the source and destination of the file(s) to be copied.

Examples cp .profile .profile.bak

This command copies your ".profile" to a file named ".profile.bak".

cp /usr/fred/Chapter1 .

This command copies the file named "Chapter1" in the "/usr/fred" directory to the current directory. This example assumes that you have write permission in the current directory.

cp /usr/fred/Chapter1 /usr/mary

This command copies the "Chapter1" file in "/usr/fred" to the directory named "/usr/mary". This example assumes that you have write permission in the "/usr/mary" directory.

 


What's related

copyright 1998-2007, devdaily.com, all rights reserved.
devdaily.com, an alvin j. alexander production.