How can i make app to run without path like Firefox and others?
OK, when i open up terminal and i type "Firefox" it opens it but i didn't specify any path. There has to be some dir it's inside like /bin or something.. i don't know how it's possible...
|
This is because the binary file for firefox is in the path.
if you type echo $PATH at the command line it will tell you which directories are part of your path Read the links below, that should get you started [1]http://en.wikipedia.org/wiki/Path_(variable) [2]http://www.troubleshooters.com/linux/prepostpath.htm should help you understand how it works hth Thierry |
in what path?
|
$PATH is an environment variable that your system uses to find the binaries or executables if you do not specify explicitly. It will look into only those locations listed in PATH variable.
Do Code:
echo $PATH Code:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games |
so how do i make my program to start like Firefox?
queenz@queenz-linux~$ MYPROGRAM ? |
Just put your program somwhere in your PATH. Usually many distributions include the directory $HOME/bin in the user's PATH, so you can just create (if missing) the directory $HOME/bin and put your executables there. First verify that $HOME/bin is in your PATH, otherwise you can add it. If in doubt post the output of the command:
Code:
echo $PATH |
Have you actually read the links I send you?
|
Quote:
|
why are there more than 1 directory?? It's a bit confusing. Which 1 is the best?
|
Quote:
There's no "best" directory, though the convention is to either add a new directory or to put your programs in /usr/local/bin, so they won't get overwritten by your package manager in the future or something. Note also that the directories will be looked up in the same order they are set in your $PATH, that means that the first binary found with a given name will be used, so the ordering of the $PATH, and whether you append or pre-pend a new path is very important. This is nothing new by the way, DOS already used a similar mechanism, with the difference that in DOS, the current dir (.) was included in your $PATH by default, but in Linux it isn't (security flaw). |
Have you gone through the links? They give you the information needed? There is no best. You can put the excutable anywhere you want and put that directory in your PATH variable and you will be able to use it like you said you want to. But by default the path variable has the locations that I already mentioned. These are the locations where by default the applications or the excutables are placed or applications are installed here by default.
|
|
All times are GMT -5. The time now is 05:24 PM. |