Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basic command lines on Mac terminal not working

Tags:

shell

macos

I changed the bash profile while trying to install mongodb and none of my command lines are working on terminal. I read online that I need to fix the $PATH but I can't even access it when none of my commands are working.

Help?

like image 840
user1424508 Avatar asked Nov 20 '13 20:11

user1424508


3 Answers

Mistakenly I also ran into same problem where to resolve this I had to reset my PATH variable to basic settings as below :

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin"

Once you set PATH variable now you can open the .bash_profile file in same terminal session only and make changes accordingly. This will resolve your problem.

like image 63
Abhishek Avatar answered Oct 20 '22 23:10

Abhishek


Ok I found the answer from here:

"Open Terminal, and go to File (or Shell) -> New Command. Type in open -e .profile (or substitute some other file instead of .profile), and hit Run. That should open TextEdit with the file you want to fix; you can remove the offending lines there."

in my case i typed in nano .bash_profile and that allowed me to edit my bash profile and fix the issue.

can't use terminal from error in .bash_profile

like image 31
user1424508 Avatar answered Oct 20 '22 23:10

user1424508


Run this in terminal:

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
like image 22
Alok Mishra Avatar answered Oct 20 '22 22:10

Alok Mishra