Permission to my ~/.bashrc denied

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 denied

Can anyone help?

NB: I am using Ubuntu 14.04 LTS. Thanks.

0

3 Answers

.bashrc is not meant to be executed but sourced. Try this instead:

. ~/.bashrc

To edit the file run nano .bashrc

Hope it helps

3

If 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like