4 ms·
Yeah, for habitual reasons I usually use -R. No idea why.
by leif 14y ago
Yeah, for habitual reasons I usually use -R. No idea why.
- lubutu 14y agoIn POSIX -R is the recursion flag for ls, cp, rm, etc. So if you want to recurse, -R is probably a safer bet than -r. (ls -r just lists in reverse.)
- leif 14y agothat's probably it
- buster 14y agoYeah, that may be it.. I'm wondering why they didn't just add a new option (aka --no-symlinks) or something
- wildmXranat 14y agoSame here. I've been conditioned to use -R
- deleted 14y ago[deleted]
- a3_nm 14y agoAnnoying exception: scp only accepts -r as recursion flag, not -R.
- mturmon 14y agoGood point. Also, since you reminded me, chmod, chown, chgrp.
- adavies42 14y agoever work on a non-gnu box? (old solaris, *bsd, stock os x, etc.) there's a decent chance they don't have -r at all.
- cschramm 14y ago*BSDs have (=> OS X probably too). Solaris, HP-UX and OpenServer have not. AIX is weird: > -r Searches directories recursively. By default, links to directories are followed. > -R Searches directories recursively. By default, links to directories are not followed.
- rbanffy 14y agoIsn't the AIX behavior the one POSIX specifies?
- lmm 14y agoThat would be kind of perverse given how cp behaves for -r and -R
- cschramm 14y agoLooking at MattJ100's link (http://pubs.opengroup.org/onlinepubs/009695399/utilities/grep.html http://pubs.opengroup.org/onlinepubs/009695399/utilities/gre...), it seems like POSIX grep actually does not have any recursion. Hence, only lubutu's comment ("-R is the recursion flag for ls, cp, rm, etc") is true, while _delirium ("-R is the POSIX-standard flag for recursive grep") is wrong, which means AIX is free to do whatever it wants with both the -r and the -R flags.