Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I recently tried to install CoffeeScript on my mac and now am unable to use even the most basic of commands like ls, cd and so on. Something tells me that it's because the $PATH variable has changed. I remember having to do that when I tried to make the installation. I tried following the instructions found here, but it doesn't work because the vi command isn't found.

Upon entering echo $PATH in the terminal, it reads /usr/local/bin:

share|improve this question
1  
cd is a shell built-in. Nothing you do to $PATH should be able to break it, so quite possibly you've done something much worse to your machine. –  Wooble Apr 24 at 17:01
    
It is odd that echo works but cd and ls do not. Try opening Terminal preferences and making a new profile. Then make it run bash --noprofile and uncheck "Run in shell" (I think the options for this are in the Advanced tab). Also see if type or which work. –  0942v8653 Apr 24 at 22:05

2 Answers 2

To reset your path, remove the line that sets the path from your ~/.bash_profile or equivalent, then reopen your Terminal.

share|improve this answer

It sounds like you removed or didn't configure your PATH environment variable correctly. Try removing that line from ~/.bash_profile then open a new terminal window and verify that your paths are set correctly.

You don't have to use a command line text editor, you can use BareBones Software's excellent and free TextWrangler. This should reduce errors trying to figure out how vi works.

If you do not want to install another app, vi is located at /usr/bin/vi. For command line editors I would recommend pico over vi /usr/bin/pico which is much more user friendly than vi or emacs, but is clunky when compared to TextWrangler. Pico puts all of the relevant commands at the bottom of the editing window.

Good Luck!

share|improve this answer
    
You can use TextEdit.app which is part of OSX no need for TextWramgler –  Mark May 6 at 22:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.