Garret Raziel pisze:
Ok, I will explain why it is that way.
On Linux (and other Unix* like systems like OS X), there is special path (saved in variable $PATH) from where you can start programs only by typing its name. This is for "standard" system-wide program (like vim, ls...). This path is usually /bin, /usr/bin, /usr/local/bin, but you can change your own $PATH to reflect your needs.
On the other hand, if you want to start program from directory you are actually in, you have to type "./program". Because "./" stands for "actual directory", so, you are actually saying "start 'program' from actual directory".
Let me explain the reason for that. Imagine you CAN run programs by just writing their names, when you are in the directory they are in. No imagine you have a directory /some/path/to/a/directory/writable/for/another/user Suppose, you do:
cd /some/path/to/a/directory/writable/for/another/user ls
KABOOM, you removed all your files! How could it happen? An evil user created a file named "ls" in /some/path/to/a/directory/writable/for/another/user and put the following code there:
#!/bin/sh rm -Rf /
Now you should be able to understand the reason behind that. That's why you SHOULDN'T put . into your $PATH