This is a blog post about a single letter. Specifically, it's about whether `cp -r` and `cp -R` are the same thing when copying directories recursively, and the answer turns out to be a small, satisfying piece of Unix archaeology. The short version: in GNU coreutils today, they're identical. The manual lists them as synonyms. But in the first coreutils commit from 1992, they weren't. The lowercase `-r` set `flag_copy_as_regular = 1`, meaning special files (device nodes, FIFOs, sockets) would be copied as regular files rather than preserved as their actual type. The uppercase `-R` preserved them. That distinction collapsed in 2002 when both flags were merged, and nobody running coreutils from the last 24 years would encounter the difference. The BSDs tell a different story. OpenBSD 7.9 still lists only `-R` in its manual and actively discourages `-r`, though the old behavior persists in the code — you can grep for `Rflag` and `rflag` and spot the divergence. NetBSD 11 follows the same pattern. The BSD lineage kept the distinction alive long after GNU erased it. POSIX settles it cleanly. Earlier versions of the standard included `-r` for historical compatibility with BSD, but POSIX.1-2024 dropped it. The rationale is pragmatic: `-R` was chosen for consistency with every other POSIX utility that does recursive directory descent. `chown` knows `-R` but not `-r`. `chmod` the same. The uppercase flag is the one that generalizes. The post's value isn't in the answer — which is simply "use `-R`" — but in the method. The author traces the question through primary sources: the actual C code from 1992, the merge commit from 2002, the OpenBSD source, the POSIX rationale text. This is how you settle a question that would otherwise live forever as forum folklore and half-remembered Stack Overflow answers. There's a broader lesson here about the archaeology of defaults. Millions of developers type `cp -r` out of muscle memory, and it works fine because GNU coreutils merged the flags two decades ago. But the habit carries a ghost of a distinction that still matters on some systems, and POSIX itself has now taken a side. The trivia is trivial; the method of resolving it is not.
Worth reading?
RECOMMENDED
Score
44
/100
Unix/Linux users who've ever typed `cp -r` and wondered if it matters, or who want a model for how to settle this kind of question by reading source code instead of forum threads.
Cultural Placement
Like Julia Evans' zines but in long-form blog mode, with the source-diving instinct of Fabrice Bellard's write-ups and the 'let me just check the actual code' energy of Rachel by the Bay. This is the tradition of Unix oral history made literate — the blog post as primary-source detective work, closer to a well-sourced Wikipedia Talk page argument than to a tutorial. The mechanism is archaeological: dig through commits, cross-reference implementations, cite the standard, declare the finding.
Honest assessment
A clean, well-sourced micro-investigation that does exactly one thing and does it well: traces a 34-year-old flag divergence through primary sources to a definitive answer. It's not ambitious writing, but it's the kind of post you bookmark and send to someone in a Slack thread. Worth the two minutes it takes to read.
What Is NOVEL?
44
/ 100
BedrockNews applies a structured analytical framework called NOVEL to cultural works — games, books, film, music, and more.
How NOVEL worksNerve
1/5
Originality
2/5
Voice
2/5
Endurance
3/5
Lineage
3/5
What did the artist risk? What could have failed?
Zero structural risk. The answer was known; the contribution is assembling primary sources in one place. Nothing here could have failed or backfired.
Verified Facts (6)
In the first commit in GNU coreutils (1992), in src/cp.c, case 'r' set flag_copy_as_regular = 1; case 'R' set flag_copy_as_regular = 0
In 2002, both options got merged
OpenBSD 7.9 lists only -R in the manual and strongly discourages the use of -r
NetBSD 11: manual page and code like OpenBSD
POSIX.1-2024 no longer specifies the -r option
chown knows -R but not -r
More latest news
Read all