Confusion between cp -r and -R options and missing documentation
Problem
Users are uncertain about the meaning of cp's -r and -R options, and the lack of clear documentation leads to potential misuse, especially when copying special files, which can cause errors or hangs. Commenters point out historical differences and missing official manuals, urging clearer guidance.
Pain points
- Unclear meaning of -r and -R options
- Missing clear official documentation
- Potential errors or hangs when copying special files
Questions to verify
- Is there a tool or documentation that can clearly explain the difference between -r and -R and provide safe copy examples?
- Would users be willing to pay for or switch to a solution that addresses this issue?
- Is there a need for an interactive checking script to prevent misuse of cp options?
Evidence
quote · @Anonymous
This blog post is odd because it keeps on hinting about a difference between `-r' and `-R' and links to the source code but never actually says what it is.
quote · @Anonymous
Historic versions of the cp utility had an -r option. This implementation supports that option; however, its use is strongly discouraged, as it does not correctly copy special files, symbolic links or FIFOs.
quote · @Anonymous
For those that don't know what 'copy as regular file' means, it means the copy command opens any file as though it was a regular file. If you have a FIFO queue sitting around it will read the content of the FIFO queue - if nothing writes to it, the command will hang. If you do cp -r /dev/zero foo, it will write zeroes into foo until the disk is full. -R otoh will copy a fifo queue as a fifo queue.
Disclaimer: this card is distilled by AI from community discussions as “pain point evidence”. It is a starting point for need analysis and validation, not a “validated market need”. AI has analytical limits; please open the original discussion above to manually verify before key decisions.