Mac terminal -bash command not found? [closed] - macos

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.

Related

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.

Why I can`t go to the desktop in terminal (babun) [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 5 years ago.
Improve this question
I cant go to my desktop using cd command.
There is
no such file or directory
error.
What am I doing wrong?
Try using an absolute path like cd /user/home/*YOUR_USERNAME*/Desktop please be advised that Unix bash is case sensitive.
If this don't work you can still run the ls - all command in your home directory to see all folders and files inside.
If you see the "Desktop" folder and just can't change into the directory try using sudo cd ~/Desktop
Hope that helps.

Bash Command Line: networksetup: Command Not Found (OS X) [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
After editing my .bash_profile to export a path, my terminal stopped recognizing even simple commands such as "ls" and "vi".
The error message that I see is:
-bash: networksetup: command not found
I don't know if I caused this error by editing my .bash_profile, and since I haven't been able to open any files via the terminal, I can't delete what I last added.
Does anybody know how to fix this?
Use the command.
/usr/bin/vim .bash_profile
PATH variable defines the list of directories for where the executable for the given command will be searched for. Since the PATH variable is not set the system does not know where executable for the given commands (ls, vi, etc) are located
Update / Solution:
The problem was in the .bash_profile. I downloaded Secrets, which allowed me to see hidden files. With that, I could open my .bash_profile.

Lost terminal PATH, cant use any commands or access directories [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 was trying to setting up Sublime text 2 for the terminal using this. It didn't work, and now the terminal cant access any directories or use simple commands like ls or cd.
Examples
$ ls
-bash: ls: No such file or directory
$ python
-bash: python: No such file or directory
I think my PATH is screwed up but i dont know how to fix it. Thanks in advance
Also if I echo $PATH, it is blank.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
This is a reasonable default. Run that at your terminal to fix that shell's path. Note that it won't affect other (future) shells.
You can run commands by typing their full path, e.g. /bin/ls. Use an editor this way to fix whichever startup file you messed up.

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