LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Why must some executables be prefaced by ./ but others do not (https://www.linuxquestions.org/questions/linux-newbie-8/why-must-some-executables-be-prefaced-by-but-others-do-not-282136/)

ColKurtz 01-25-2005 02:25 PM

Why must some executables be prefaced by ./ but others do not
 
Some linux binaries force me to put ./ or the full path in order to launch them, else I get a "command not found". Others (startx, for example) launch just fine without a path. What makes this distinction?

Matir 01-25-2005 02:27 PM

Executable files located in your PATH can be launched without a path. PATH is the environment variable telling your shell where to look for executables. Try "echo $PATH" to see where they can be found.

ColKurtz 01-25-2005 02:37 PM

Thank you. I assumed that my home directory would be in the path but I see not. But I notice /home/[my home directory]/bin)/ *IS* in the path. That makes sense, and is obviously where I should be throwing my scripts.

Thanks again.

Matir 01-25-2005 03:23 PM

$HOME/bin is not usually in the PATH, though I added it to mine. It's good for user's own programs. On some systems, I like $HOME/.bin, so the visible directories in $HOME can be data-only.


All times are GMT -5. The time now is 07:01 PM.