In Mac's terminal, can we have the command line arguments that are 'options' to the end of command?

Sorry if the title is bewildering. Let me illustrate by an example.

In Linux, the following two command works equally:

ls -lh /tmp

ls /tmp -lh

But in my Mac, the second one doesn't work.

I was wondering whether it's because they use different ls(GNU V.S. BSD), or there's some difference in the shell.

More importantly, how can I tweak Mac's terminal so the second one works, not only for ls, but other command as well.


You cannot tweak the shell, the difference is in GNU vs BSD tools as you suspected. You might try to compile the GNU toolchain on your Mac, but I'm not really sure it would be a good idea, as the OS might rely on these tools and incompatible changes might have unpredictable consequences. You could try compiling them to a /usr/local/ prefix and only use them in your own shell, but still — proceed with extreme caution.

Need Your Help

Plotting data in real time

data matplotlib wxpython

I have a program which outputs to the terminal a number, one line at a time.

Using R to filter special rows

r data-cleaning

I have a question which has bothered me for a long time.I have a data frame as below...