I dont know why but when I write any commands in my terminal. It always show me -bash:[SomeCommand] command not found. I dont know if it's about my path -bash: /user/local/php5/bin:/user/local/mysql/bin: No such file or directory or anything else. It was my first time that I use the terminal and I don't know what happened.
You are missing the regular bin directories. Here's what my $PATH looks like on a fresh Yosemite:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Related
Every time I open my terminal the first line says: -bash: /nvm.sh: No such file or directory.
I just installed nvm on this laptop and obviously I did something wrong.
Does anyone know what commands I can use to fix this?
I tried the following command to remove nvm from my laptop:
$ rm -rf ~/.nvm
Sadly, this did not fix my problem.
Check your .bashrc file (usually in the home folder). See answers to this question. There's probably a line reading /nvm.sh somewhere in there -- if so, just delete it.
As Gasper Stukelj awnsered:
There was a line reading /nvm.sh.
The correct path to the file was for me using macOS Mojave:
$ open ~/.bash_profile
In my case I fixed this problem, just putting in terminal, after installing nvm: export NVM_DIR="$HOME/.nvm" and [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
and after that I installed node normally
How did I find this solution?
Simple, I read the terminal, and it gave two ways to solve. The first option was for me to restart the computer, to see if the changes (installation) took effect, and the second option was for me to put these two commands in the terminal and only : )
Ready to use in my case :)
I used Google Translate
For me the issue was coming from the .bash_profile file. The line was:
source ~/.nvm/nvm.shexport PATH="/usr/local/opt/php#7.0/bin:$PATH"
I removed everything after nvm.she and the error isn't showing in the terminal anymore. This happened while trying to install xdebug on Mac Big Sur.
I failed to find a solution in Google searches, so I just installed nvm again to resolve the issue. I guess some files were not installed.
brew install nvm
I have installed command line tools on my macOS Sierra, but I am not able to use "svnrdump" command. It gives "svnrdump: command not found" error. Here is how my /usr/bin looks like.
This error generally indicates that the program you're attempting to execute doesn't exist in the $PATH environment variable. In your post, you said you're looking in /usr/bin but your screenshot clearly shows a different directory path - CommandLineTools/usr/bin - likely with CommandLineTools being the child of another directory (or multiple).
Locate the full path to svnrdump and run /path/to/svnrdump and it should work - then consider adding that path to $PATH so you don't have to do it all the time.
I tried to change something in my bash_profile but I think I mistyped something. So I can not run any terminal commands. If I post "ls" command then I get
-bash: ls: command not found
Now I can not open bash_profile also. So what can I do here. I get the below path using echo command but there was some any other path. Please help.
echo $PATH: /usr/local/bin:/usr/local/bin:
But if I write /bin/ls it works.
MacBook Pro El Capitan : 10.11.4
This is the possible answer - And I solved it using nano editor
You messed up your PATH environment variable.
/bin/ls
works because you did not need PATH to find the 'ls' program. You can run ANY command by specifying its full path.
You need to re-edit your .bash_profile to either remove your PATH, or fix it. I do not know what editor you used to modify .bash_profile to begin with, but you can use
/usr/bin/nano
/usr/bin/vi (ONLY if you know vi/Vim)
/usr/bin/vim (ONLY if you know vi/Vim)
/usr/bin/emacs (I shutter to think about this)
TextWrangler (a very good free GUI text editor)
http://www.barebones.com/products/textwrangler/
Or you can just rename the current .bash_profile and start a new terminal session, then fix the renamed .bash_profile before putting it back in service
/bin/mv .bash_profile saved.bash_profile
I cannot use even ls command.
Before this happen I created a .profile file and
save this line
export PATH:....
I believe I gave wrong path.
Is there a way to find .profile file.
Thanks
I found the answer:
Turn on show hidden files. (I used a small app)
Check for .profile file in finder
Open the file using Text editor
Erase the wrong path.
Save the .profile file
Exit the command prompt and enter the command prompt.
Try ls command. It works
***Not magic
I use a bash script to install an app on Mac OS X "Lion". First I copy the app bundle into place, then attempt to install postgres into the app bundle. The data path for the postgres db needs to be in "~/Library/Application Support/myappfolder/data/".
Now the problem (appears to be) that the script stumbles because the OS says the path is not found. Backing up the path names I get to "~/Library/" and it still fails. The script is run with admin privileges.
To put this another way, from the terminal, this works:
me: cd ~/Library
but this does not:
me: mydir="~/Library/"
me: cd $mydir
I know things have changed in 10.7, but I haven't found the answer at the dev center yet.
I don't think this is Lion-specific. When you use quote marks, you are causing the ~ character to be treated literally, instead of as an alias for $HOME. So it's looking for an actual directory with a tilde in the name, which doesn't exist.
Try using mydir="$HOME/Library" instead to see if that fixes the problem.
This actually doesn't work in 10.5, either, so I don't think it's a Lion specific problem. Something like this will always work, though:
eval "cd $mydir"