Setting the user environment variables in bash_profile

I am trying to set the user environment variables in home directory in bash_profile. But in home directory, 1)on running ls -l|grep bash_profile,no file is shown 2)For every session, I have to run source ~/.bash_profile to get the environment variables.What is the other way round to get the variables without running the source command every time. Please suggest the solutions.

3

1 Answer

Include that source command into .bashrc to run it automatically when opening a terminal. You only see a hidden file, i.e. a file of which the name starts with a dot, in the output of ls if you use the -a option.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like