Save Terminal changes Mac Lion
rizoul
-
_Ritchi_ Posted messages 21130 Registration date Status Contributor Last intervention -
_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
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
-
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 -
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 -
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?-
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.
-