Copying Files

The cp (copy) command copies a file, files, or directory to another location. The option -R allows you to copy directories recursively (in general, -R or -r in commands often means "recursive"). If the last argument to the cp command is a directory, the files mentioned will be copied into that directory. Note that by default, cp will "clobber" existing files, so in the second example that follows, if there is already a file called afile in the directory /home/bible, it will be overwritten without asking for any confirmation. Consider the following examples:

Was this article helpful?

0 0

Post a comment