Title is Description.
I just wonder there is any difference between rm -r
and rm -R
.
Linux man description is seemed like they are totally same(and one more, --recursive), but many people use -r and -R like they aren't same.
So I want to know about not only its functional difference but its practical(or conventional) difference.
Could anyone let me know about this?
According to the OpenGroup / POSIX specification for rm
, the -r
and -R
options are equivalent.
Source: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html
This probably applies to all modern UNIX / Linux variants.
But it wasn't always that way:
-R
option did not exist in v5 UNIX; see here, page 97. -r
. The reason for adding -R
was for compatibility with other commands that use -R
to mean recursive. (For example chmod
... where -r
means "remove read permission".)
Its the same.
# rm --help | grep directories.
-r, -R, --recursive remove directories and their contents recursively
By default, rm does not remove directories. Use the --recursive (-r or -R)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With