Most POSIX commands that have recursive directory traversal option (
-R for that.
rm also has
-r because that's what it was initially, long before POSIX.
Now, the behaviour varies when symlinks are found in walking down the tree. POSIX tried to make things consistent by adding the
P options to give the user a chance to decide what to do with symlinks leaving the default when none is provided unspecified.
grep has no
grep initially had neither.
-r was added in 1998. That was following symlinks.
-R was added as a synonym in 2001 for consistency with the other utilities. That was still following symlinks.
In 2012 (grep 2.12),
-r was changed so it no longer followed symlinks, possibly because
-H were already used for something else.
grep were based on GNU grep for a long time. Some of them have rewritten their own and kept more or less compatibility with GNU
grep. Apple OS/X addressed the symlink issue differently.
-R are the same and don't follow symlinks. There's a
-S option however that acts like
-L option to follow symlinks.