1

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

but

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

1 Answers1

4

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 03 '15 at 14:18
  • Agreed, I was going to say so. Did I not say so? I’ll add it. – Arthur Reutenauer Jun 03 '15 at 14:21
  • I very much like your answers. I in fact have found http://ss64.com/osx/ much better than http://cli.learncodethehardway.org/book/. Is this reasonable to say relating to the proper use of the CLI? –  Jun 03 '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 03 '15 at 14:43
  • Ok. Many thanks for the info and also book info. –  Jun 03 '15 at 16:02