~/.bash_profile Permissions denied [closed] - bash

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 7 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I am trying add these lines export PATH=~/.rbenv/bin:$PATH eval "$(rbenv init -)" to my ~/.bash_profile however when ever I type ~/.bash_profile it gives me this error
-bash: /Users/ryandavila/.bash_profile: Permission denied.
I tried following the instructions on Basic Github checkout (https://github.com/sstephenson/rbenv/blob/master/README.md#basic-github-checkout) but I get the same error.
Just an FYI I'm very new to ruby on rails yet alone programming.

.bash_profile is not executable, which is why you get the error. To reload it after making changes, use bash's source command:
source ~/.bash_profile
Or the equivalent alias:
. ~/.bash_profile

When you type ~/.bash_profile, you are execute it. You need open this file with text editor and paste export PATH.....

Related

bash: /home/user/.bash_completion/alacritty: No such file or directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
whenever I open the terminal this line
bash: /home/user/.bash_completion/alacritty: No such file or directory
is displayed. I tried to install alacritty terminal but it failed and there after I am seeing this line in the terminal. How to solve this problem?
Looking at the install instructions here, you would have done:
echo "source ~/.bash_completion/alacritty" >> ~/.bashrc
So, just edit ~/.bashrc and delete the line source ~/.bash_completion/alacritty.

How to fix my PS1 and after I messed it up [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I wanted to customize my terminal and one of the things I did was install zsh and made zsh my default shell (on iterm2).
Now I wanted to customize my ps1. Following online tutorials, I edited my ~/.bash_profile and added the line PS1 = "\h:\W"
Then I ran the command source ~/.bash_profile and now my terminal prompt starts with just "\h:\W". When in reality, I expected it to return "MyName: Current Directory"
I have no idea how to fix this. Editing my PS1 does not help the situation. Not sure why the backslashes haven't been working like in the PS1 guidelines I've found online.
From Customizing your shell prompt - For your user id and the current folder (and zsh)
PS1="%n:%/ "
on my mac that yields the prompt
efrisch:/Users/efrisch
I have no idea how to fix this You can also remove the line you added to your ~/.bash_profile and logout and back-in.

Mac terminal -bash command not found? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm completely new to using terminal, and while trying to use brew to install some stuff, I did something to PATH. Now if I tell it to do something it always returns
-bash: blah: command not found.
Is there any way to reset something to fix this? What should I do?
Your path is usually set in either your .profile or .bashrc file. These are found in the root of your user's home directory.
You should be able to fix them by running these two commands in the terminal. They contain the default executable paths
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
You can set your path this way:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
and you can always add other directories if you want. Hope this helps.

aliases in bash shell not working [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
I'm running Mavericks on a fresh MBA.
.bash_aliases
alias la='ls -a'
alias dev='cd ~/Development/Rails'
.bash_profile
source ~/.bashrc
.bashrc
export PATH=/usr/local/bin:$PATH
source ~/.bash_aliases
I am getting the following message in my fresh shell:
-bash: alias: -a: not found
-bash: alias: /Users/david/Development/Rails': not found
My quoting isn't working, what is up with this? Thank you.
Smart quotes were indeed turned on.

Bash commands not found — $PATH damaged [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I accidentally made a mistake when I changed my ~/.bash_profile file and now I'm unable to run any command, such as ls, touch, sudo, etc.
When I write echo $PATH I have this result:
$ echo $PATH
/usr/local/bin:
$
And when I type /bin/cat ~/.bash_profile, I have this result:
export PATH=$HOME/local/node/bin:/usr/local/bin:$PATH
export PATH=/usr/local/bin:$PATHh
But I am unable to change it. Can someone help me, please?
If you can do /bin/cat, you should be able to /usr/bin/vi, too. Alternately, just fix it in your local shell:
PATH=/bin:/usr/bin:/sbin:/usr/sbin
And then running your favourite editor should work again.

Resources