0

This question already has an answer here:

A tutorial shows cp -r http://cli.learncodethehardway.org/book/ex10.html

but

http://ss64.com/osx/ only shows -R.

marked as duplicate by Stephen Kitt, Celada, Archemar, Anthon, chaos Jun 3 '15 at 14:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

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.

  • In fact it's arguably better to get into the habit of using -R since that will work on any POSIX system. – Stephen Kitt Jun 3 '15 at 14:18
  • Agreed, I was going to say so. Did I not say so? I’ll add it. – Arthur Reutenauer Jun 3 '15 at 14:21
  • I very much like your answers. I in fact have found ss64.com/osx much better than cli.learncodethehardway.org/book. Is this reasonable to say relating to the proper use of the CLI? – user117185 Jun 3 '15 at 14:37
  • @MariaS. It’s been a long time since I’ve been helping anyone use the command line, so I can’t recommend any reference. If you’re on Mac OS X, it makes sense to use a document that’s targeting Mac OS rather than GNU/Linux, at least as a first step. Ideally, you should also be learning about the POSIX standard. If you’re ready to spend a few dollars / euros / etc., there are some very good publishers that make small reference books: Addison-Wesley, O’Reilly, The Pragmatic Programmers. – Arthur Reutenauer Jun 3 '15 at 14:43
  • Ok. Many thanks for the info and also book info. – user117185 Jun 3 '15 at 16:02