Where is the .bashrc or .bash_profile file in OpenSuse linux located?

I am trying to install rvm and it wants me to edit .bashrc or .bash_profile files to enable rvm ... But I cannot FIND these files anywhere. A quick google search shows that they can exist until I make them (weird), but I don’t see any WHERE link I have to do.

EDIT: Well, this is from one of the answers, it looks like I need to put them in my / home directory ... and I can use ls -la to see if they are really there or not (they are not), but when I I make files and put:

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

in them, as rvm indicated, even when I create a new shell, I still cannot type "rvm" and get it anywhere.

Does this mean that the files are in the wrong place or that I made them wrong or that what I put in them is wrong .... I don’t even know where to start ...

I made the files (as root) by typing "vi.bashrc" and vi ".bash_profile" ... but when I look at them, the files seem to be called simply "bashrc" and "bash_profile". So I did "mv bashrc.bashrc" and it seemed to do the trick And hid them ... but ... I still can't type "rvm" in the new shell ...

Edit: when i print

$ HOME / .rvm / scripts / RVM

I got a "give up rights" error even when root. So I went there, and the "rvm" file does not have executable permissions, for some reason ... I installed it as executable. So now I no longer get this error ... but I ALSO still cannot start RVM, even in the new shell.

DECISION:

I completely misunderstood what “root of your home directory” meant, and tried to put them in a directory called “home”. INSTEAD, I had to put them where $ HOME was pointing. Now that the files are in the right place (and .bashrc at least already exists, so I just edited it), everything works fine

+4
source share
3 answers

You must make them in the root directory of your home directory if they do not already exist.

+10
source

. in front of the file name indicates that they are hidden files, so run ls -la to find out if they exist.

Sample .bashrc file
Example .bash_profile

bashrc vs. bash_profile

+10
source

You say you created files as root, but do you use the root command? When logging in as a user who tries to use this rvm command, try running the line:

 [[ -s "$HOME/.rvm/scripts/rvm" ]] && echo exists || echo not there 

directly from your shell. If it echoes "does not exist", then the specified location does not exist and that is your problem.

If it says “exists,” the contents of the directory may not be as expected.

But do I need to manually install RVM manually? Isn't there something from your distribution package manager that takes care of this for you?

+2
source

All Articles