Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Newbie question, how to "save and exit" in Terminal

  1. #1
    Join Date
    Apr 2009
    Beans
    238
    Distro
    Ubuntu

    [SOLVED] Newbie question, how to "save and exit" in Terminal

    Original issue resolved, see here for current issue.











    I was following a guide and it said to save and exit... but it doesn't say how?

    http://www.unixmen.com/install-lamp-...erick-meerkat/
    Now check if php is working :

    Code:
    $sudo vi /var/www/info.php
    and add

    Code:
    <?php
    phpinfo();
    ?>
    save and exit
    Last edited by felinoel; September 10th, 2012 at 01:54 AM.

  2. #2
    Join Date
    Sep 2009
    Beans
    18
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Newbie question, how to "save and exit" in Terminal

    Looks like you used the vi editor to create your file.

    You should be able to press [Esc], then ZZ, to "save and close".

  3. #3
    Join Date
    Apr 2009
    Beans
    238
    Distro
    Ubuntu

    Re: Newbie question, how to "save and exit" in Terminal

    Quote Originally Posted by randrews View Post
    Looks like you used the vi editor to create your file.

    You should be able to press [Esc], then ZZ, to "save and close".
    When I pres escape nothing happens, when I type zz it just remains like it was, no z's added.

  4. #4
    Join Date
    Sep 2009
    Beans
    18
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Newbie question, how to "save and exit" in Terminal

    Did you use capital Z's?

    vi is... special.

  5. #5
    Join Date
    Apr 2009
    Beans
    238
    Distro
    Ubuntu

    Re: Newbie question, how to "save and exit" in Terminal

    Quote Originally Posted by randrews View Post
    Did you use capital Z's?

    vi is... special.
    I used capital Z's I used r's and f's and capitals of those too, it wouldn't let me type anything.

  6. #6
    Join Date
    Sep 2009
    Beans
    18
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Newbie question, how to "save and exit" in Terminal

    You might want to consider a less mysterious text editor for now, to be honest.

    You could use the same command as before to create your file, only instead of "vi" use "nano".

    nano /var/www/info.php

  7. #7
    Join Date
    Apr 2012
    Beans
    5,339

    Re: Newbie question, how to "save and exit" in Terminal

    agreed - use a simpler editor

    however if you are already in vi, you can use

    Code:
    ESC
    :wq
    (ESCape gets you out of insert mode; then "colon w q" for write quit)

  8. #8
    Join Date
    Apr 2009
    Beans
    238
    Distro
    Ubuntu

    Re: Newbie question, how to "save and exit" in Terminal

    Quote Originally Posted by randrews View Post
    You might want to consider a less mysterious text editor for now, to be honest.

    You could use the same command as before to create your file, only instead of "vi" use "nano".

    nano /var/www/info.php
    I don't know what vi is, I only followed the instructions and did it in the Terminal, if vi runs through the Terminal then idk

    Quote Originally Posted by steeldriver View Post
    agreed - use a simpler editor

    however if you are already in vi, you can use

    Code:
    ESC
    :wq
    (ESCape gets you out of insert mode; then "colon w q" for write quit)
    Nothing types, not even a colon, because of this I pressed a bunch of buttons and now it says at the bottom, "search hit TOP, continuing at BOTTOM"

  9. #9
    Join Date
    Nov 2008
    Location
    Kingdom of cookies
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Newbie question, how to "save and exit" in Terminal

    Press Control+C to get out of any modes.
    Type
    :w to save
    :q to quit
    Ubuntu Forums Moderation Staff || SandyDNET
    Twitter: @CatchesAStar | Last.fm
    Ubuntu Membership via Forum Contributions

  10. #10
    Join Date
    Apr 2009
    Beans
    238
    Distro
    Ubuntu

    Re: Newbie question, how to "save and exit" in Terminal

    Quote Originally Posted by sandyd View Post
    Press Control+C to get out of any modes.
    Type
    :w to save
    :q to quit
    "/var/www/info.php"
    "/var/www/info.php" E212: Can't open file for writing
    Press ENTER or type command to continue

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •