cp flags & options

-r, --recursive

Copy directories recursively.

cp -r src/ backup/
cp -r dir1 dir2 target/

-p, --preserve

Preserve mode, ownership, and timestamps.

cp -p file.txt backup/

-a, --archive

Same as -dR --preserve=all; preserve everything and copy recursively.

cp -a /var/www/ /backup/www/

-v, --verbose

Explain what is being done.

cp -rv project/ backup/

-n, --no-clobber

Do not overwrite an existing file.

cp -n newfile.txt dest/

-u, --update

Copy only when the source file is newer than the destination.

cp -u *.txt backup/
cp -ru src/ dest/

Hard link files instead of copying.

cp -l largefile.dat link.dat

Make symbolic links instead of copying.

cp -s /opt/data/config.yml ./config.yml