rm long/path/to/some/dir -r
rm -r long/path/to/some/dir
Is it possible to make it work like that, as in GNU command line utils?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Unfortunately the answer is negative unless you are willing to switch to GNU command line utilities. OS/X command line tools derive from BSD sources which process command line arguments differently. This all boils down to usage of the library calls like
getopt() in the standard C-library. OS/X command line tools use the standard library functions whereas GNU command line tools use their own, similar, but slightly more "advanced" version of
getopt() and companions.
That said, you could work around that by installing GNU coreutils. One way of doing that would be to use Homebrew. That, of course, is not the same thing as making OS/X provided BSD command line utilities to the parse command line like the GNU command line utilities do.