Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-bash: sudo: command not found Mac OS X (EC2 CLI prob?)

Tags:

bash

macos

sudo

Getting the error:
-bash: sudo: command not found
echo $PATH outputs PATH:EC2_HOME/bin
I'm running Mac OSX 10.8.3

That seems wrong even for a n00b like me. How do I fix my $PATH and return my computer to it's former self?

like image 245
Robert C Edwards Avatar asked Jul 24 '13 15:07

Robert C Edwards


1 Answers

As stated in the comments the right files to set up your $PATH variable are: ~/.profile or ~/.bash_profile

export PATH=/usr/bin:/usr/sbin:/bin:/usr/local/bin:/sbin:/opt/x11/bin:$PATH

In this way when you re-enter in the console your PATH will work fine. You can add other directories to your $PATH as you like.

If you just copy and past that line in an active console you just set the PATH variable temporary, when you logout and login again you will loose your path, so add it in your ~/.bashrc file.

like image 151
Atropo Avatar answered Oct 20 '22 16:10

Atropo