Wednesday, August 19, 2015

macos - OSX terminal stopped working?


For some reason, many command I try to execute I get command not found
I've tried touch, mkdir, sudo, ln -s all the same result


ilyas-mac-pro:~ ilya$ mkdir bla
-bash: mkdir: command not found

Answer



You changed your $PATH (more about it). Try to enter the full path of commands, e.g. /bin/mkdir (or /usr/bin/mkdir, not sure right now).


echo $PATH to see the current path variable value.


export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin for a sane value.


Check your shell init files, e.g. .profile or .bash_profile for lines like the export PATH=... above and remove them.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...