Guy on a mailing list explains that he downloaded & compiled a program & then tries to run the program when he runs into a problem. Like this:

$ ls
flickrdown
$ flickrdown
-bash: flickrdown: command not found

Guy wants to know why this is happening & why he can’t run the program directly, & proposes putting a . (indicating the current directory) in his PATH. David Dooling1, a member of the list, gave a great explanation as to what was going on & why:

It is a security issue. If you have . (the current directory) in your path and you cd into my home directory where I have a script named ls with the contents rm -rf $HOME, I could trick you into inadvertently deleting your home directory. To mitigate this, some people put . last in the PATH. But then I could just create a script names sl and hope you mistype. It is safest to not have it in the PATH and explicitly run ./command when you want to run things in the current directory.

David’s explanation is right on. Just put a ./ in front of any command that you want to run in your current directory, & things will work well.

  1. David gave me permission to post his comment here.