CLI options do not work if passed at the end of command In brief: ls -a /tmp works but ls /tmp -a does not.

I recently started using Macbook Pro.
Coming from a Linux background, command like ls /tmp -a seems perfectly fine to me. 

But for some reason these do not work in the same fashion in Mac. Argument flags are not recognised if they are specified at the end after the path. 

Here is a demo:

/tmp/demo  ➜ ls -a ./
.           ..          .hidden-bar foo
/tmp/demo  ➜ ls ./ -a
ls: -a: No such file or directory
./:
foo
/tmp/demo  ➜     


I am using latest zsh 5.0.5 (x86_64-apple-darwin14.0)

I can see similar behaviour of several other commands like du, rm etc. Almost all such are in /bin folder. I wonder if it has something to do with UNIX and Linux differences.

Does anybody know the reason behind the difference and if possible a fix for it?
This is because apple zsh shell version. To install zsh version with that behaviour, you have to install homebrew. You can easily to it by typing the following:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


Once installed, install the zsh formulae:

brew install zsh


Then you have to replace your shell with zsh provided by homebrew:

chsh -s /usr/local/bin/zsh


After that you should be able to test your zsh version and use command arguments like you want.