LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-20-2009, 06:22 AM   #1
sc38905
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Rep: Reputation: 0
Exclamation 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

/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5/bin:/Applications/MAMP/htdocs/cake_1_2/cake/console/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

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

Thanks!!
 
Old 11-20-2009, 06:35 AM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
looks to me like /usr/bin is missing from your path
Set your path with:
Code:
export PATH=$PATH:/usr/bin
then load vi, edit your profile and remember to put /usr/bin into your path permanently.
 
Old 11-20-2009, 06:50 AM   #3
sc38905
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Question 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 ...

E325: ATTENTION
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!
 
Old 11-20-2009, 06:59 AM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
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:

Code:
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.
 
Old 11-20-2009, 07:18 AM   #5
sc38905
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0
You're awesome! It's showing up now, but I can't edit it. What command should I use?
 
Old 11-20-2009, 07:21 AM   #6
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
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
:wq
 
Old 11-20-2009, 07:31 AM   #7
sc38905
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0
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

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

returns:
-bash: cake: command not found
 
Old 11-20-2009, 07:34 AM   #8
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
"cake: command not found" means the system cannot find the file 'cake' in the path. Do you know where this 'cake' file is located?
 
Old 11-20-2009, 07:38 AM   #9
sc38905
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0
cake is located in the folder

/Applications/MAMP/htdocs/cake/cake/console
 
Old 11-20-2009, 07:39 AM   #10
sc38905
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 11-20-2009, 07:43 AM   #11
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
You need a : before that last $PATH

That might actually be the problem. Should read:
Code:
PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5/bin:/Applications/MAMP/htdocs/cake/cake/console:$PATH
 
Old 11-20-2009, 07:55 AM   #12
sc38905
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0
thanks! genius! cheers ...
 
Old 11-20-2009, 08:03 AM   #13
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
No problem
 
  


Reply

Tags
linux, mac, terminal, vi



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I resize the terminal window from the command line in the gnome terminal QuIcKSpArK Linux - Newbie 5 04-21-2012 02:04 PM
[SOLVED] append command output to file by giving command in terminal sumeet inani Linux - Newbie 4 07-03-2009 10:36 AM
How to create new users on my mac from the terminal bigmac18 Linux - Newbie 2 02-25-2009 11:46 AM
Mac Terminal Help @jay General 0 08-15-2008 01:14 AM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration