The difference is that Windows implicitly has
. in the path, which is something it inherited from DOS, which always was a single user system.
Mac OS X is build on Unix, which is a multi user system. And for security reasons it does not have
. implicitly in the path.
. is not in the path, then to run a command in the current directory, one has to prefix the command with
./ in order to explicitly tell the shell, that you want to run a command in the current directory. The
./ notation will work with or without
. in the path. If you remove
./ it will only work if
. is in the path. For that reason documentation will usually include the
What is the security implication of including
. in the path?
Let's say that you have typed
cd ~joker to enter
joker's home directory. Next you type
ls to see what files are there. If
. was at the beginning of the path, then
joker could have a script in his home directory called
ls, which could do anything to your user account.
. was the last entry in the path, it wouldn't go so bad. In the previous scenario, you would run the real
ls command instead of the one
joker had in his home directory. But you might mistype the
ls command. Your fingers might slip, and you typed
ks might not be found any of the preceding directories, but finally as the shell got to
. it might find a
ks command in
joker's home directory.