Suppose you have added a new path to the PATH variable using the shell but you might observe that every time you switch terminal the PATH variable does not works.
To make this issue to be resolved permanently you need to add the variable inside .bashrc or .bash_profile file inside the home folder of the user.
For example, you want to add a PATH variable for root user so you need to add the path inside ~/.bashrc or ~/.bash_profile
Now the confusion comes which file should we place the variable or inside both the files?
Difference between .bashrc and .bash_profile
In case you are already logged in and you open a new terminal then .bashrc file is executed
So, basically you can put the environment variable inside any of the two files. As per me I would advice you to put the same inside .bash_profile.
Have a look at .bash_profile file
# less ~/.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
# User specific environment and startup programs
How to mount windows share on linux
Follow the below links for more tutorials
Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
How to configure Samba 4 Secondary Domain Controller
How to secure Apache web server in Linux using password (.htaccess)
How to register Red Hat Linux with RHN (Red Hat Network )
Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
What is the difference between "su" and "su -" in Linux?
What is kernel-PAE in Linux?
What is swappiness and how do we change its value?
How to log iptables messages in different log file
What are the s and k scripts in the etc rcx.d directories
How to check all the currently running services in Linux
How to auto start service after reboot in Linux
What is virtual memory, paging and swap space?