Linux command cp -r dir1 dir2 - what it represents? What it means?

bash
linux
unix

#1

The title says, it all, I have a command like:

cp -r /home/usr/dir1 /home/usr/dir2

#2

One can pass the -r optop to the cp command to copy directories recursively. It means copy all files and sub directories from /home/usr/dir1/ to /home/usr/dir2/

cp -r /home/vivek/data /home/vivek/backups

OR pass the -a which copies recursively and preservers file permissions, links and more:

cp -a /home/vivek/data /home/vivek/backups

See