Lost posix utilities on Mac OSX, any ideas on debugging?
Suddenly I lost almos开发者_运维技巧t everything on the command line. I can do cd
, exit
and pwd
...nothing else that I tried...no ls
, no vi
...nothing....
I do have an open terminal that's still working, but no new ones...as soon as I exit out of the current session, I'm screwed...
I was about to say I'm baffled...but I just noticed that now /etc is symlinked to /etc/private. Don't remember that being the case before...
I recently upgraded to Snow Leopard...but I've rebooted since with no problems... No clue when this came about...
Any ideas on debugging it?
It sounds like your PATH
environment variable may be messed up. You may have messed it up in a .profile
, .bashrc
, .tcshrc
, .login
or similar shell startup file. Check using:
echo $PATH
Then (assuming you are using a bash shell) try setting it with:
export PATH=/usr/bin:/bin
You could also try typing commands using the full path, e.g. /bin/ls
. If you want to make sure that your commands are still there you should be able to use echo /bin/* /usr/bin/*
.
/etc
has always been a symbolic link to private/etc
on Mac OS X.
Start with echo $PATH
to see what's there. Mine contains:
/Users/jleffler/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:.
On my machine, /etc is a symlink to /private/etc, and /tmp is a symlink to /private/tmp (and isn't accessible to other user IDs).
If that isn't the problem, check whether /usr/bin and /bin are available (they are not symlinked on my machine).
精彩评论