How can i make app to run without path like Firefox and others?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
$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
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
so that we can take a look at your current PATH settings.
why are there more than 1 directory?? It's a bit confusing. Which 1 is the best?
Because binaries can live in many directories. You can put your programs in either of these dirs or add a directory to the $PATH, read the info given above in that links to know how.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.