I have an issue with accessing my ~/.bashrc file. I did and obtained the following:
yuve@YuveSys:~$ ~/.bashrc
-bash: /home/yuve/.bashrc: Permission denied
yuve@YuveSys:~$ sudo su
root@YuveSys:/home/yuve# ~/.bashrc
bash: /root/.bashrc: Permission deniedCan anyone help?
NB: I am using Ubuntu 14.04 LTS. Thanks.
03 Answers
.bashrc is not meant to be executed but sourced. Try this instead:
. ~/.bashrcTo edit the file run nano .bashrc
Hope it helps
3If what you are trying to do is open the .bashrc file for editing, you need to open it with any text editor, such as nano, vi, or gedit. If you are trying to update after altering it in any way, you could use source .bashrc command.
For instance,
# Open the file with nano text editor and make changes you want
$ nano ~/.bashrc
# Run source command to apply changes
$ source ~/.bashrc
foobar@ubuntu:$ See also:
0~/.bashrc isn't supposed to be executed. You're supposed to run something like gedit ~/.bashrc
You're getting that error because the execute bit isn't set, but it shouldn't be.
You can also source it to edit by running nano .bashrc when you're in the root.