A tutorial shows cp -r http://cli.learncodethehardway.org/book/ex10.html
but
http://ss64.com/osx/ only shows -R.
A tutorial shows cp -r http://cli.learncodethehardway.org/book/ex10.html
but
http://ss64.com/osx/ only shows -R.
The only option POSIX defines is -R
. Some implementations of cp
, most notably the one by GNU, provides -r
(as well as --recursive
) as an alias. The author of the tutorial you’re reading is probably using some GNU system, and used -r
, but you should be absolutely fine using -R
yourself; and since it is more portable, I would actually recommend getting used to -R
rather than its synonyms.
-R
since that will work on any POSIX system. – Stephen Kitt Jun 03 '15 at 14:18