I try to access .bashrc
by typing ~/.bashrc
on my terminal. I am connecting to a remote server via ssh. I get an access denied message. I have no problems logging in, just the access denied message for that file. I need to edit it to load a compiler. How do I do that? I have very recently started using Xubuntu and ssh, so I would appreciate an easy to follow answer.
2 Answers
If you want to load environmental variables from .bashrc
, you can use
source ~/.bashrc
If for some reason you want to execute it, you have to change permissions first:
chmod u+x ~/.bashrc
After that, you can execute it with
~/.bashrc
However, it doesn't do that much, as it only initializes your shell options.
.bashrc
is a file, not a command. The syntax ~/.bashrc
attempts to run it as a script, which doesn't work. To edit it, you need to first write the name of an appropriate editor - nano
is probably a good choice.
Edit the file with nano ~/.bashrc
(save and exit with ctrl-x), then disconnect and reconnect to activate the changes.
ls -al ~/.bashrc
?