7

I don't know why this line appears first when I open my gnome-terminal.

bash: /home/username/.bash_aliases: Permission denied
laptop-dell:-$

I tried this but still the problem remains there.

chmod +x ~/.base_aliases
chmod: cannot access `/home/username/.base_aliases': No such file or directory

What should be the default permission of 'bash_aliases' ?
How to fix this ?

5
  • 1
    I suppose it doesn't literally say /path/, and that you made it up for the question, i.e. that the path is not the problem?
    – Jos
    Sep 15, 2015 at 8:46
  • 1
    Default permission should be -rw-r--r-- same as .bash_profile or .bashrc.
    – snoop
    Sep 15, 2015 at 8:47
  • 1
    @jos doubt it. ... Vipul: please provide the actual commands and errors. If these are it ... "path/" ... ?
    – Rinzwind
    Sep 15, 2015 at 8:47
  • @Jos, Yes, you are right, I just made it for the question. that's not the real problem. Sep 15, 2015 at 9:00
  • @VipulBhatt Please just change the username if you don't want to show your real username, otherwise it ends up being rather misleading for people reading the question.
    – kos
    Sep 15, 2015 at 9:07

2 Answers 2

6

Using the right command and file names ;), in your second command is a typo: ~/.bash_aliases and not ~/.base_aliases

sudo chown $USER:$USER ~/.bash_aliases

and so I can sleep peacefully (thank you @ByteCommander)

chmod 644 ~/.bash_aliases

And maybe it's time to correct the permissions for the whole folder:

sudo chown -R $USER:$USER $HOME
9
  • Maybe you should not just chown it but also set the correct permissions, depending on what got messed up... chmod 644 ~/.bash_aliases
    – Byte Commander
    Sep 15, 2015 at 8:53
  • @ByteCommander Yes, you're right.
    – A.B.
    Sep 15, 2015 at 8:54
  • Hello @A.B., My terminal is not opening after performing these commands !!! Sep 15, 2015 at 9:23
  • Switch to TTY1 via Ctrl-Alt-F1 and login. What is the output of echo $USER (Back to your GUI via Ctrl-Alt-F7)
    – A.B.
    Sep 15, 2015 at 9:33
  • My username, @A.B. Sep 15, 2015 at 10:02
1

I do a similar thing in my .bashrc file. I use this compound statement and it works:

if [ -f ~/.bash_aliases ]; then
   source ~/.bash_aliases
fi

The key is the source command. I don't know if this is "bad form," but it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .