Possible Duplicate:
Why do we use “./” to execute a file?
It seems redundant and gets annoying after a while -- is there a way to change this? If not, can somebody explain the reasoning behind this?
Thanks!
It seems redundant and gets annoying after a while -- is there a way to change this? If not, can somebody explain the reasoning behind this? Thanks! |
|||
|
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
|
You don't, if the current directory is in your path and there isn't another executable with the same name in a directory named earlier in the path. If either of these conditions isn't true, ./ effectively says "look here". Although you can add "." to your path, it isn't advisable, since that opens the door for unexpected (or malicious) results if you execute a command from a directory that has executables that match the name of system commands. |
|||||
|
|
You do if your current directory is not in your path. If you ever log in as root or are a sudoer, I do not recommend you add your current directory to your path. Just put up with the ./ If you wish, make a directory in your home directory called |
|||
|
|
|
isnt it much easier than running your program using |
|||
|
|