Results 1 to 10 of 13

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

Hybrid View

  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
    7,256

    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)

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
  •