Hai Linux,
I wrote a small c program using gcc compiler and i named the executable has hello i want this hello to be executed from any place . How to set the environment variable in bash shell?.
while installing some software it has it's own envirnoment variable how to set that?.
Thank you in advance.
You add the path to the executable to the PATH environment variable. For example, assuming a bash shell, and the path to the program /home/username/program/hello, you do the following:
export PATH=$PATH:/home/username/program
If you want this to be set automatically, add that line to ~/.bash_profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With