./ vs normal execution
Solution 1:
This is due to the behaviour of your shell that is running in there Terminal.app. It is probably the bash shell
When you ask the shell to run a command if you provide an absolute path (that is beginning with /
as your second one does) it will try to execute that program at that path. If you provide a relative path (i.e. one not starting with /
) it will try to create an absolute path by prepending the directories that are in your PATH environment variable to what you typed. As your current directory or .
is not on your PATH it cannot find a file to execute. If the path begins with a .
the it will repave that by the absolute path of your current directory and thus get a path that can be executed.
Solution 2:
~
= home folder nothing else../something
will execute that something (be it script or binary)
Writing the full path is the same as executing with./
cd
is change directory, so it will not execute
These are all standard unix/linux command line commands
References:
http://linuxcommand.org/learning_the_shell.php
http://www.arachnoid.com/linux/shell_programming.html