This question already has an answer here:
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
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?