Save Terminal changes Mac Lion

rizoul -  
_Ritchi_ Posted messages 21130 Registration date   Status Contributor Last intervention   -
Hello,

I have a bit of a silly question as a beginner, but I need to make a change in the Mac Lion terminal and save it, but I don't know which key to press.

I read :wq, but do I need to type the colon key first, then the letter w, and then the letter q?

Thank you for your help.

Configuration: Windows XP / Internet Explorer 7.0

3 answers

  1. rizoul
     
    I had this link to modify the hosts file
    http://support.sherweb.ca/Faqs/Show/how-to-edit-the-hosts-file-mac

    I had to type this
    Enter: sudo nano /private/etc/hosts
    1
    1. aiglenoirdu29 Posted messages 11426 Status Contributor 2 363
       
      So it's definitely nano and not vi, at no point do they mention “:wq” in your link, you must have mixed several tutorials using different software,

      so:

      To exit, you simply press CTRL+X and respond Y (for yes) to save the changes and then Enter.
      0
    2. _Ritchi_ Posted messages 21130 Registration date   Status Contributor Last intervention   6 135
       
      aiglenoirdu29,
      +1

      (thank you for resuming the support)
      0
  2. _Ritchi_ Posted messages 21130 Registration date   Status Contributor Last intervention   6 135
     
    Hello,

    You apparently used the vi text editor, the standard editor found on all Unix systems.
    Indeed, to save your work, you must first press esc, then :, then w (like write = to write) and finally q (like quit = to quit).
    I added the esc key to ensure you exited the editing mode.
    Learn more about Vi

    Ritchi
    0
  3. rizoul
     
    Hello and thank you for your response.
    Actually, I searched for the application called terminal and then I wanted to make a modification in the host file but it says to exit do :wq.

    So you have to press the escape key then the shift + period key to get the : then w then q, is that correct?
    0
    1. aiglenoirdu29 Posted messages 11426 Status Contributor 2 363
       
      The Terminal is used to execute commands, not to edit files.

      So you typed a command that launches a file editor, independent of the Terminal itself.

      What is this editor?

      Example:

      vi toto.txt
      This command opens the file toto.txt with the software vi

       nano toto.txt
      This command opens the file toto.txt with the software nano

      Use nano, it's less powerful than vi but easier to use for tasks like this. Because vi has several modes which complicates the task when you don't know how to use it at all.

      To exit, just press CTRL+X and respond O (for yes) to save the changes, then hit Enter.
      0