7

I'm new to Linux so sorry if this is a very basic question.

I know you type the following to install something, you type these three commands:

./configure
make
sudo make install

I know . means the current directory. So does ./configure mean run the program configure in the current directory? If so, why can't you just type configure?

User314159
  • 205
  • 2
  • 6
  • I think the title of this question could be made clearer, but I'm not sure what to change it to. Something like *"Why do I need to explicitly specify the current directory with "./" when running "./configure"?"* – crdx Jul 05 '13 at 19:32
  • Related: [Why is . not in the path by default?](http://superuser.com/questions/156582/why-is-not-in-the-path-by-default) – gronostaj Jul 19 '13 at 07:59

1 Answers1

8

Only directories listed in $PATH are searched for commands to execute. The current directory is never included in $PATH as a security precaution, hence you have to specify it explicitly.

Ignacio Vazquez-Abrams
  • 111,361
  • 10
  • 201
  • 247
  • 3
    Sadly never is not true. But it should never be the first in the path. OP: consider this. I create an evil program that deletes all files I have access to. I call that script `ls` or something else which is sounds innocent and what you are likely to type. If your path first searches the current directory and you type that command then you have an unexpected problem. – Hennes Jul 05 '13 at 03:37