-   Linux - Newbie (
-   -   vi command not found - mac terminal (

sc38905 11-20-2009 06:22 AM

vi command not found - mac terminal
Hi guys,

I'm completely new to linux and was trying to setup my vi .profile ... and I think I might have linked it wrong.

The thing is, now I'm trying to get in to change it, and I can't get back into it. I used the command vi. profile again, but this time around, I get the error

-bash: vi: command not found

After I typed echo $PATH, the following showed up


Is there something wrong with the path? How can I fix my problem?


Komakino 11-20-2009 06:35 AM

looks to me like /usr/bin is missing from your path
Set your path with:

export PATH=$PATH:/usr/bin
then load vi, edit your profile and remember to put /usr/bin into your path permanently.

sc38905 11-20-2009 06:50 AM

Tried it and ...
Tried what you said but I'm getting the following msg. I'm afraid I'll mess up my computer so I apologize in advance for the silly questions

what exactly does it mean?

i typed ...

export PATH=$PATH:/usr/bin
vi .profile

it returned ...

Found a swap file by the name ".profile.swp"
While opening file ".profile"
dated: Fri Nov 20 00:27:46 2009
NEWER than swap file!

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r .profile"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".profile.swp"
to avoid this message.

Swap file ".profile.swp" already exists!

Komakino 11-20-2009 06:59 AM

Just means you either crashed out of vi (or another editor) last time while editing the file and a swap (temporary) file has been left behind.

Do this:


mv .profile.swp .profile.bak
which will rename the swap file just in case we need it (which I severely doubt, but just to be sure) then redo my previous instructions.

sc38905 11-20-2009 07:18 AM

You're awesome! It's showing up now, but I can't edit it. What command should I use?

Komakino 11-20-2009 07:21 AM

Can't edit it why? It's saying it's read only or something? Or do you mean you're not familiar with vi?

If it's the latter, you need to press 'i' to put it into insert mode. Then to save and quit, press escape and type

sc38905 11-20-2009 07:31 AM

Yes I"m a complete noob. That solves it, thanks!

I'm trying to link bake actually, part of the features of cakePHP. mySQL is linked properly.
Something is wrong with my cake link ... if you can advise, please feel free :)

cd /Applications/MAMP/htdocs/
htdocs Sam$ cake bake testsite

-bash: cake: command not found

Komakino 11-20-2009 07:34 AM

"cake: command not found" means the system cannot find the file 'cake' in the path. Do you know where this 'cake' file is located?

sc38905 11-20-2009 07:38 AM

cake is located in the folder


sc38905 11-20-2009 07:39 AM

by the way, i renamed the path to PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5/bin:/Applications/MAMP/htdocs/cake/cake/console$PATH

Komakino 11-20-2009 07:43 AM

You need a : before that last $PATH

That might actually be the problem. Should read:


sc38905 11-20-2009 07:55 AM

thanks! genius! cheers ...

Komakino 11-20-2009 08:03 AM

No problem :)

All times are GMT -5. The time now is 12:09 PM.