- Red Hat Enterprise Linux (RHEL)
We are coming from Solaris environment to RHEL. Normally we only work with
~/.profileto have the profile set up for each user. We recently experienced problem setting them up and RHEL documents request me to change
It seems like it changes for
bashshell. If we are using a different shell (example
ksh), then would
~/.kshrcbe the file to control the profile?
I also see
~/.profilecreated as we run oracle. Where does
~/.profilecome to play?
Is there a document that specifically explains the profile set up? I would like to fully understand all of these files:
/etc/profile /etc/bashrc ~/.profile ~/.bash_profile ~/.bashrc ~/.kshrc
First of all, the files in the
/etc directory are global for all users, but should really avoid changing them if at all possible. If need to modify the global settings, you can use
/etc/profile.d (this is to prevent your changes from getting wiped out when packages are upgraded). For more information on
profile.d, please refer to How do I use custom.sh for a global user profile in RHEL 6?
Now, from an individual user basis, the next question is why are there all these different files (
The primary thing to understand is that the
rc files are for all shell invocations while the profiles are strictly for interactive shells. On top of that, if you are going to be using both
bash, you should use
bash. Since most configuration directives recognized by
ksh are also recognized by bash, some people who use both shells find it easier to just create a symlink between the two.
There is also the matter of
.kshrc, which is actually not a file that the Korn shell specifically looks for. It's just a practical convention, and many people use it, and then source the file from inside their .profile. Otherwise,
ksh will not automatically read it.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.