The cp Command

Basic Syntax

cp [OPTIONS] <source> <destination>

Examples

cp file.txt ../backup/ cp -r dir1 dir2

Options / Flags

  • -r : copy directories recursively
  • -i : prompt before overwrite
  • -v : verbose output
terminal 1 : cp [OPTIONS] <source> <destination>
terminal 2 :
Usage: cp [OPTION]... [-T] SOURCE DEST Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
terminal 3 : <source>
bash-sandbox/ next.config.ts node_modules/ package-lock.json public/ src/
terminal 4 : <destination>