Skip to content
zero2vibecodelearn vibe coding

What cp -r does

cp -r myfolder backup: Copy a whole folder, contents and all.

The cp command page covers what it does in general, with an example.

cp-rmyfolderbackup
  • cp— command — copy files and folders
  • -r— flag — copy a folder recursively
  • myfolder— argument: a file, a folder, or text
  • backup— argument: a file, a folder, or text

What it does when you run it

$ cp -r myfolder backup
$ ls backup
keep.txt

Run it yourself

The same files. Nothing here can break, and nothing leaves your browser.

Explain other commands

Written by Mikhail Kuzmitskii