开发者

Where is .bashrc or .bash_profile on OpenSuse linux?

I'm trying to install rvm, and it wants me to edit my .bashrc or .bash_profile files to include rvm... But I can't FIND these files anywhere. A quick google search shows that they might not exist until I make them (weird), but I can't see any reference to WHERE I should make them.

EDIT: Okay, it from one of the responses, 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 make the files, and put:

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

in them, as instructed by rvm, even when I make a new shell, I still can't type "rvm" and get anywhere.

Does that mean the files are in the wrong place, or that I made them wrong, or that the thing I put in them is wrong....I don't even know where to begin...

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 named just "bashrc" and "bash_profile". SO, I did "mv bashrc .bashrc" and that seemed to do the trick AND hid them...but...I still can't type "rvm" in a new shell...

Edit: When I type

$HOME/.rvm/scripts/rvm

I got a "permission denied" error, even while root. So I went there, and the "rvm" file doesn't have executable permissions, for whatever reason... SO I set it to be executable. So now I don't get that error anymore...but I ALSO still can't run RVM, even in a new shell.

SOLUTION:

I was completely mis-understanding what "root of your home directory" meant, and was trying to put them in the directory named "home". INSTEAD, I was supposed to put them in the place where $HOME was pointing to. Now that the files are in the right place (and .bashrc at least alread开发者_高级运维y existed, so i just edited it), everything is working perfectly


You should make them in the root of your home directory, if they don't exist already.


The . in front of the filename indicates that they are hidden files, so execute ls -la to see if they exist.

A Sample .bashrc File
Sample .bash_profile

bashrc vs. bash_profile


You say you created the files as root, but are you running the command as root? While logged in as the user which will attempt 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 echo's "not there" then the location specified does not exist and that's your problem.

If it says "exists" then the contents of the directory may not be what is expected.

But, is it necessary to install RVM manually this way? Isn't there something available from your distribution's package manager that will take care of this for you?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜