Blog post traces history of cp -r vs -R flag divergence
A developer blog post examines whether the cp command's -r and -R recursive-copy flags have ever behaved differently. It traces GNU coreutils source code back to 1992, finding the two flags originally set different internal variables, before being merged into identical behavior in 2002. The post also checks OpenBSD 7.9 and NetBSD 11, finding both still treat -r and -R as distinct, with manuals recommending -R.
GoKawiil's interpretation of the reporting above, not reported fact.
The findings suggest that assumptions carried over from GNU/Linux tooling about flag equivalence don't necessarily hold on BSD-derived systems, which could trip up scripts meant to be portable across Unix variants. The post notes POSIX itself recommends -R, partly because other utilities like chown support -R but not -r, implying cross-utility consistency was a factor in that guidance.
- GNU coreutils merged cp's -r and -R behavior in 2002; no difference exists in modern GNU systems
- OpenBSD and NetBSD still implement -r and -R as functionally distinct flags
- POSIX recommends -R for consistency with other recursive utilities like chown
Source: movq.de, 2026-09-30
Published there as: “cp: -r or -R?”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.