cp

cp(1) copies files. DOS users will notice its similarity to the copy command. There are many options for cp, so you should have a look at the man page before using it.

A common use is to use cp to copy a file from one location to another. For example:

   $ cp hejaz /tmp
   

This copies the hejaz file from the current directory to the /tmp directory.

Many users prefer to keep the timestamps preserved, as in this example:

   $ cp -a hejaz /tmp
   

This ensures that the timestamps are not modified in the copy.

To recursively copy the contents of a directory to another directory, you would issue this command:

   $ cp -R adirectory /tmp
   

That will copy the adirectory directory to the /tmp directory.

cp has many more options that are discussed in detail in the online manual page.