Once started the shell and you see this error, "reset" the permission(s) of that file(s).
Try this
1) Go there cd /home/{USER}/
and
2) Change permission chmod 644 .bashrc
Notes:
1) For me it was working without sudo
2) 644
means writable, readable and executable for the user and readable for groups and others
I had this issue because I edited some .bash***
files with Notepad++ on Windows. After saving the files there were not executable anymore with Ubuntu.
Instead of copying, saving, re-creating the changes, like @DeusExMachina mentioned, I wanted to see what just happened with the file permissions there.
I went into my home directory and checked the Permissions of each file and I saw that my edited files .bashrc
and .bash_aliases
now had permissions of 000
- so they got locked by Windows!
I changed the permissions for my edited files from 000
to 644
and it was working again.
Sounds like a permission problem. Can you try to do
sudo chmod 644 /home/user/.bashrc
and see if that helps. – Mikael Kjær – 2018-05-02T04:51:44.963@Biswapriyo Why didn't you make that edit yourself? – DavidPostill – 2018-05-02T07:55:18.857
@MikaelKjær Would be helpful if this was posted as an answer; your comment worked for me. – Stardust – 2018-11-27T02:28:08.187