Skip to content
Tech News
← Back to articles

Blog post traces history of cp -r vs -R flag divergence

read original more articles
GoKawiil Brief

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.

Why It Matters

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.

Key Takeaways

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.