Thursday, October 22, 2026|20°C Partly Cloudy
Next edition scheduled
Your Personal Daily Intelligence
Edition 2026-10-05

TECHNOLOGY

POSIX standard favors -R over -r for recursive copying in Unix tools

The distinction between the -r and -R flags in Unix copy commands has faded over time, though historical differences once existed.

By Hacker News · 18d ago · Source: Hacker News

Full article

The distinction between the -r and -R flags in Unix copy commands has faded over time, though historical differences once existed. In early GNU coreutils from 1992, the two options carried separate meanings: -r enabled recursive copying while preserving file attributes, whereas -R performed recursive copying without that preservation. By 2002, these differences were merged into a single recursive behavior, rendering the distinction obsolete in modern implementations.

OpenBSD 7.9 now documents only -R in its manual, explicitly discouraging -r usage despite acknowledging subtle behavioral differences in code. NetBSD 11 mirrors this approach, prioritizing consistency across utilities like chown, which recognizes -R but not -r. POSIX 2024 formalizes this hierarchy, designating -R as the standard for recursive operations across compliant tools, while noting -r's historical roots in BSD systems and its deprecated status in current specifications.

This evolution reflects a broader trend toward standardization in Unix-like environments, where consistency across utilities often supersedes legacy conventions. While -r persists in some contexts, its use increasingly risks incompatibility with modern tooling and documentation expectations.

Source transparency

Publisher
Hacker News
Reliability
high
Published
10/5/2026, 10:00:03 AM
Retrieved
10/5/2026, 10:00:03 AM
Relevance
80%
Confidence
85%
Read original at Hacker News

Botwin's Morning Wire publishes the full source article for reading convenience. Please visit the publisher for the original presentation and any updates.