Setting the User Environment Variables in Bash_Profile

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

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

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.