Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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 5 '13 at 19:32
    
Related: Why is . not in the path by default? –  gronostaj Jul 19 '13 at 7:59

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
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 5 '13 at 3:37
    
thanks everyone, that makes sense! –  User314159 Jul 5 '13 at 6:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.