What you are looking for is the
PATH
environmental
variable. It tells the shell, where it needs to look for programs. You
can see the current value of that variable using echo
:echo "$PATH"
Now... The best practice if you want use some new program is to
install it using the package management program for your distribution.
But in this case, I assume you are dealing with a program that is not
delivered by any available software package. For such programs, you have
two options:- Install the program system-wide, in a place where your system does not put any files installed from packages. On most systems, such "safe" folders include
/usr/local/bin/
and/opt/bin/
- those should already be in yourPATH
. (Look inside these folders and if there are many files in them, then it is the wrong place to put your own program and you have to look at other folders listed in yourPATH
.) - Modify your
PATH
variable. This is less secure, because it defines additional folders where programs can be kept and someone might play a trick on you, putting his own program there for you to run.
You can modify thePATH
variable either temporarily, using
(mind theexport PATH="$PATH:/path/to/your/executable"
$PATH
after=
), or permanently by adding the above line to your.bashrc
file (assuming you usebash
).
No comments:
Post a Comment