What is the Linux `cp` command?

The Linux cp command copies files and directories from one location to another. Its behavior depends heavily on flags such as recursive copy, archive mode, update handling, and how it treats symbolic links.

Because path quoting and option combinations matter, it is easy to mistype a copy command when you are moving several files at once.

Tool description

This tool generates a Linux cp command from one or more source paths, a destination, optional raw options, and common copy flags. It also supports sudo output when elevated privileges are needed.

It is useful for building copy commands quickly without worrying about shell syntax details.

Examples

  • Copying multiple files into a backup folder
  • Recursively copying a directory with archive-style flags
  • Copying a file with sudo into a protected location

Features

  • Supports multiple source paths
  • Common cp flags such as archive, recursive, preserve, force, update, and symlink handling
  • Downloadable shell output

Limitations

The tool only builds the command string. It does not run the command or verify that the paths exist.

Raw options are inserted as-is, so custom flags are not validated beyond basic string handling.