abc.py
has to be in the command search path (i.e. in one of the directories specified in the PATH
environment variable). ./abc.py
is an exact path: it executes abc.py
from the current directory (.
).
In the Unix world it is considered a bad practice to have the current directory in the path, since it allows for extremely simple malicious attacks, where a well placed executable named after a common Unix command (or common mispellings thereof) would be inadvertently executed by an unsuspecting user.
E.g. a rather improbable, but most illustrating example is that where an attacker could leave an executable named rm
in /tmp
and wait for a system administrator to attempt to empty the /tmp
directory.