Forrest logo
back to the cp tool

cp:tldr:6769a

cp: Copy a directory recursively, in verbose mode (shows files as they are copied).
$ cp -vr ${path-to-source_directory} ${path-to-target_directory}
try on your machine

This command is a Linux command used to copy files and directories from one location to another with some specific options.

Here is the breakdown of the command:

  • cp is the command in Linux used to copy files and directories.
  • -v is an option that stands for "verbose", which displays the details of the files being copied. It shows the progress and names of files being copied.
  • -r is an option that stands for "recursive", which allows the command to copy directories and their contents, including subdirectories and files.
  • ${path-to-source_directory} is the placeholder for the path to the directory or file you want to copy from. You should replace it with the actual path to the source directory or file.
  • ${path-to-target_directory} is the placeholder for the path to the directory where you want to copy the files to. You should replace it with the actual path to the target directory.

So when you execute this command, it will copy all files and directories from the source directory to the target directory, including subdirectories and their contents, while displaying the progress and names of the copied files.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cp tool