Can command-line commands be made insensitive to order of filenames and options?
It looks like the OS X built-in command line tools, such as ls, du etc are rather strict with regards to the order of parameters.
To illustrate, a command for showing disk usage, 'du', accepts -h as a 'human readable' formatting directive for sizes. If you run the following under OS X Lion, this parameter is ignored:
du . -h
To get it to work, you need to specify the parameter fist, then the location, like that:
du -h .
Coming from Linux (ubuntu) background this seems strange to me - under Ubuntu you can do it either way. This is also becomes quite annoying at times, especially when you realise that you've forgotten to specify a parameter for long command and have to move the cursor to the beginning of it.
Hence is the question: can I change the 'default' behavior of command line tools to be more forgiving? Also, what's the reason for that restriction? A BSD legacy?