altering PATH variable
Hey all, I am trying to add a path to my PATH variable on redhat linux and seem to be having problems. I can set the path variable like this:
and that works fine but its not a permanent fix. Also, that only works for the current terminal session. If I try and open another terminal session I would have to retype in the commands. I have read I need to change my ~/.bash_profile file but that file does not exist. I created the file in the ~ directory and added the two lines above but when I log out and log back in, the PATH variable is not changed. Any help would be great!
Try putting it into .bashrc. You might find this article useful.
What hazel suggests will work, but isn't optimal. It is best to put the in your ~/.bash_profile instead:
File names that start with a dot are "invisible", which is probably why you don't see it normally. ~ is your home directory (accessible also with the $HOME environment variable). In any case, if bash is your default shell, then you MUST have the following files in your home directory:
Just for my information, what distribution+version of Fedora/RedHat are you running?