bash: /path/.bash_aliases: Permission denied
8,366
Solution 1
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
Solution 2
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.
Related videos on Youtube
Author by
Vipul Bhatt
Working on Python, JavaScript as Jr. Application Developer @Odoo
Updated on September 18, 2022Comments
-
Vipul Bhatt over 1 year
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 ?-
Jos over 8 yearsI 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? -
snoop over 8 yearsDefault permission should be
-rw-r--r--
same as.bash_profile
or.bashrc
. -
Rinzwind over 8 years@jos doubt it. ... Vipul: please provide the actual commands and errors. If these are it ... "path/" ... ?
-
Vipul Bhatt over 8 years@Jos, Yes, you are right, I just made it for the question. that's not the real problem.
-
kos over 8 years@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.
-
-
A.B. over 8 years@ByteCommander Yes, you're right.
-
Vipul Bhatt over 8 yearsHello @A.B., My terminal is not opening after performing these commands !!!
-
A.B. over 8 yearsSwitch to TTY1 via Ctrl-Alt-F1 and login. What is the output of
echo $USER
(Back to your GUI via Ctrl-Alt-F7) -
Vipul Bhatt over 8 yearsMy username, @A.B.
-
chicks over 8 yearswhy aren't the perms 755?
-
A.B. over 8 years@chicks executable rights are not necessary.
-
polendina about 2 yearsAs in my case i was using the wrong "command", as i was having
$Editor
instead of$EDITOR