Examples of copying directories with the cp command

Examples of copying directories with the cp command

1. To create a new copy of a directory:

   cp -r draft presentation

This copies all the files and subdirectories in the directory draft into a new directory presentation.

2. You try to create a copy of a directory using the name of directory that already exists:

   cp -r planA projects

If the directory projects already exists, then a copy of the directory planA will be created in this directory.


Top document