Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac terminal -bash command not found? [closed]

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?

like image 475
ayy Avatar asked Apr 17 '15 01:04

ayy


People also ask

How do I close a Terminal job on Mac?

In the Terminal app on your Mac, choose Terminal > Quit Terminal.

How do you unlock a Mac Terminal?

Press Command + Space Bar on your Mac keyboard (alternatively, press F4) Type in “Terminal” When you see Terminal in the Spotlight search list, click it to open the app.

How do I manually close a Terminal?

Type exit at the command line and press Return.


2 Answers

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" 
like image 83
James Grundner Avatar answered Oct 02 '22 13:10

James Grundner


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.

like image 27
mma7 Avatar answered Oct 02 '22 14:10

mma7