Examples of using the cp command

1. To copy a single file in the current directory:

   cp notes sect3.txt

This makes a copy of the file notes in the file sect3.txt.

2. To copy a file using the -i option:

   cp -i notes part2.txt

This makes a copy of the file notes in the file part2.txt. If this file exists the prompt

   part2.txt: File exists

is displayed. The file is not copied.


Top document