Can command-line commands be made insensitive to order of filenames and options?

Solution 1:

The reason for this is that Mac OS X uses BSD utils (which have a specific order to their parameters), whereas Linux uses the GNU utils, which can accept arguments in any order.

You can download and compile the GNU coreutils package, which should provide you with the utilities you're used to; I would recommend just getting used to the BSD utils, however, as you'll otherwise have problems moving to other systems. The BSD method works fine on GNU systems, but the GNU method is less portable.

Solution 2:

If you are using MacPorts (and as a Linux connoisseur you probably are), you can install GNU coreutils with:

sudo port install coreutils

and then make sure to add the coreutils path to your path:

export PATH=/opt/local/libexec/gnubin:$PATH

[Sources: TJ Luoma comment to the accepted answer and this blog post.]