How to find .bash_profile and add to my shell initialization file?

I am trying to update ruby ​​using rvm. A pragmatic site says:

The important part is adding the following line to the end of the shell initialization file (.bash_profile):

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

How can I do it? Where is this initialization file? Please, help

+8
rvm
source share
2 answers

This will be /home/$USER/.bash_profile , but will only be present if you use bash as your shell. Other shells will use the "dot file" with their name instead. You can view them with ls -ad $HOME/.*

+6
source share

There are two initialization files .bash_profile and .bashrc that are present in the user's home directory.

.bash_profile is initialized at login with a user ID .. bashrc is initialized when you are already logged in and want to open another terminal.

If you want to add some parameters to both files, you can do the following

 if [ -f ~/.bashrc ]; then source ~/.bashrc fi 
0
source share

All Articles