View Full Version : sudo: command not found - Is this normal?
bluemoon
Sep 9, 2004, 12:30 PM
i was trying to use the sudo command in my terminal when i got this:
tcsh : sudo : command not found
is this normal? i really no idea.... thanks in advance.
yellow
Sep 9, 2004, 12:52 PM
No it is not.
Could be your path is FUBAR. Verify it by seeing if sudo is in /usr/bin, as it should be. If it is, show us what your path is:
echo $PATH
echo $shell
If it's not, then it sounds like you might have installed OS X and not installed BSD Subsystem. Use Pacifist to get that installer of your OS X CDs/DVDs.
bluemoon
Sep 9, 2004, 01:13 PM
echo $path
/bin:/sbin:/usr/bin:/usr/sbin,/urs/local/bin
echo $shell
/bin/tcsh
erhmm... sorry..dun understand bout the FUBAR part and checkn the usr... where is that usr? anyway... was using it fine the other day... just tat i suddenly cant use it... i tried installing tinyfugue but din fully install it yet... and i accidentally moved the utilities folders to trash but took it out.. any idea wat's happening? or wat i can i do to salvage my situation?
yellow
Sep 9, 2004, 01:51 PM
/bin:/sbin:/usr/bin:/usr/sbin,/urs/local/bin
If your path really looks like this, then it's screwed up. There should not be a comma in the path.
bluemoon
Sep 9, 2004, 01:53 PM
there's a comma after sbin isnt there?anyway... wat can i do to retify the problem?
yellow
Sep 9, 2004, 02:03 PM
Sorry, it was supposed to say should NOT be a comma.
Please verify the output of
echo $PATH
And make sure there's not a comma in there.
Do you have a .login or a .cshrc or a .tcshrc in your home directory?
bluemoon
Sep 9, 2004, 02:09 PM
hmmm.. the one above is correct.. it does have a comma there... hmmm...sorry man, i am quite a hopeless person at the whole terminal thing... dont understand wat u meant by home directory.. sigh.... i guess i am in big trouble?
yellow
Sep 9, 2004, 02:18 PM
Before you start fiddling with UNIX and the command line, you should familerize yourself with it's workings. Here is a good starting place for a tutorial:
http://osxfaq.com/Tutorials/LearningCenter/index.ws
The home directory is your home folder, where your Documents, Pictures, Music, Movies, etc are. If you have a comma in your path, then that is why sudo doesn't work. Please post the results of:
ls -laF ~
blodwyn
Sep 9, 2004, 02:21 PM
echo $path
erhmm... sorry..dun understand bout the FUBAR part
FUBAR = Fouled Up Beyond All Recognition
There's also SNAFU = Situation Normal, All Fouled Up
I believe there are alternatives based on another word that also begins with 'F' ;)
bluemoon
Sep 9, 2004, 02:22 PM
somehow i feel as if i am threading into hell... well... i am at the next lower level of the pits now... ls: command not found...
i somehow think i am in serious trouble....
i gotta go sleep now.. sigh.... how can i contact u to ask with regards to this? or u can just post the method.. will be back tomorrow...
yellow
Sep 9, 2004, 02:36 PM
/bin/ls -laF ~
bluemoon
Sep 9, 2004, 08:14 PM
drwxr-xr-x 17 admin staff 578 9 Sep 00:50 ./
drwxrwxr-t 7 root admin 238 6 Sep 13:15 ../
-rw-r--r-- 1 admin staff 3 31 Aug 00:38 .CFUserTextEncoding
-rwxr-xr-x 1 admin staff 6148 9 Sep 00:53 .DS_Store*
-rw-r--r-- 1 admin staff 0 19 Sep 2003 .MCXLC
drwx------ 11 admin staff 374 10 Sep 00:59 .Trash/
-rw-r--r-- 1 admin staff 33 3 Sep 13:07 .cshrc
drwx------ 3 admin staff 102 9 Sep 01:50 .irssi/
drwx------ 15 admin staff 510 10 Sep 00:58 Desktop/
drwx------ 7 admin staff 238 6 Sep 13:15 Documents/
drwx------ 35 admin staff 1190 10 Sep 01:08 Library/
drwx------ 3 admin staff 102 19 Sep 2003 Movies/
drwx------ 6 admin staff 204 3 Sep 23:13 Music/
drwx------ 4 admin staff 136 31 Aug 00:40 Pictures/
drwxr-xr-x 3 admin staff 102 3 Sep 23:40 PoisonDownloads/
drwxr-xr-x 4 admin staff 136 19 Sep 2003 Public/
drwxr-xr-x 5 admin staff 170 19 Sep 2003 Sites/
this?
tomf87
Sep 9, 2004, 08:58 PM
It is most likely in /etc/profile.. Open Terminal and run:
/usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile
Check the PATH variable in it.. For yours, it should read:
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
NOT
/bin:/sbin:/usr/bin:/usr/sbin,/urs/local/bin
Then save the file if you had to change it.
stcanard
Sep 9, 2004, 09:06 PM
somehow i feel as if i am threading into hell... well... i am at the next lower level of the pits now... ls: command not found...
i somehow think i am in serious trouble....
Nahh, it's all because your $PATH has been messed up. Fast fix from the terminal would be:
set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
(My tcsh is rusty, you might need to use setenv)
that will fix that specific terminal session so the commands can be found.
Then you need to open the files listed above and fix the path.
bluemoon
Sep 9, 2004, 10:07 PM
i did the /usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile
and got this for my path:"/bin:/sbin:/usr/bin:/usr/sbin"
so do i still edit till it becomes : /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin ?
tried the fast fix : set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin but nothing happened... thanks for all the help... i am like a noob to all this programming thing... really appreciate all you ppl...:)
The usual disclaimer:
Don't use sudo unless you know what you're doing.
I would go educate myself with at least the basics of the command line before using sudo as you can seriously screw up your system that way.
stcanard
Sep 9, 2004, 10:14 PM
i did the /usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile
and got this for my path:"/bin:/sbin:/usr/bin:/usr/sbin"
so do i still edit till it becomes : /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin ?
tried the fast fix : set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin but nothing happened... thanks for all the help... i am like a noob to all this programming thing... really appreciate all you ppl...:)
Hmm, sounds like you might have a personal file messing it up:
try
/usr/bin/open -a TextEdit ~/.profile
(notice the "." in front of the name there)
And see if there is a line in there that modifies the path. you need to do two things:
1) Change that comma into a colon ":"
2) Change the /urs at the end into a /usr
tomf87
Sep 9, 2004, 10:44 PM
Hmm, sounds like you might have a personal file messing it up:
try
/usr/bin/open -a TextEdit ~/.profile
(notice the "." in front of the name there)
And see if there is a line in there that modifies the path. you need to do two things:
1) Change that comma into a colon ":"
2) Change the /urs at the end into a /usr
From the directory listing above, it appears there isn't a .profile. There is a .cshrc however, so I'd check there.
/usr/bin/open -a TextEdit ~/.cshrc
stcanard
Sep 9, 2004, 10:57 PM
From the directory listing above, it appears there isn't a .profile. There is a .cshrc however, so I'd check there.
/usr/bin/open -a TextEdit ~/.cshrc
Told you my tcsh was rusty. I've been a bash person for a long time. (I also apparently don't read very well)
Come to think of it, you should also check /etc/csh.login and /etc/csh.cshrc -- I assume tcsh uses those?
bluemoon
Sep 10, 2004, 08:38 AM
typed /usr/bin/open -a TextEdit ~/.cshrc and got this:
set path=($PATH,/urs/local/bin)
typed /etc/csh.login and got permision denied.
typed /etc/csh.cshrc oso has permission denied.
yet to edt anything cos i dun noe wat to edit..
yellow
Sep 10, 2004, 08:57 AM
set path=($PATH,/urs/local/bin)
There's your problem. It should be:
$PATH:/usr/local/bin
Colon, not comma. Change that and open Terminal and all will be correct. IMO, declaring path is much better to do in a ~/.login. Read that UNIX tutorial.
yet to edt anything cos i dun noe wat to edit..
edIt BEcAUsE I dON'T KnoW wHat
bluemoon
Sep 10, 2004, 09:11 AM
oops... sorry for that lazy english.. now i got this after editing it....
tcsh: Bad : modifier in $ (/)
hmmm.... now what do i do with this message? i get it everytime i log in now...sigh... thanks for helping :)
yellow
Sep 10, 2004, 10:07 AM
Sorry, my fault there..
Edit that file again.
change it to:
set path = ($PATH /usr/local/bin)
Open Terminal. Verify that it's working with:
echo $PATH
It should look like this:
yellow% echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
yellow
Sep 10, 2004, 10:11 AM
Personally, I would prefer that you take the whole path declaration out of your .cshrc and put it in a .login, thusly:
setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
bluemoon
Sep 10, 2004, 10:19 AM
thanks a million Yellow...u saved me.... and my baby mac..:) hee... think everything should be fine now... don't quite understand about the .login though... wat am i supposed to do? create a new file or just type in that command : setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" ?
Converted2Truth
Sep 10, 2004, 10:34 AM
FUBAR. Isn't that term from the old movie staring Stalone and Russel entitled "Tango and Cash"? oh the memories...
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.