Why OSX cp -avr get this error: the -R and -r options may not be specified together


I just want to copy a folder tree to another place like this:

cp -avr /blah/blah/htdocs ./

but I got error:

cp: the -R and -r options may not be specified together.

I followed this tutorial: http://www.cyberciti.biz/faq/copy-folder-linux-command-line/
It's about Linux, while I am using Mac. I found I can work around by using -avR instead.
However, I am wondering why -avr could result in the odd error on Mac.

Best Answer

OS X is not Linux, but closer to BSD. According to the man page, there's no -r switch on cp for OS X. There used to be one, yet:

Historic versions of the cp utility had a -r option. This implementation supports that option; however, its use is strongly discouraged, as it does not correctly copy special files, symbolic links, or fifo's.