Vi Editor Basics

Although there are many posts and articles on this Vi editor, I felt its Absolutely necessary for beginners to learn this so posting this in my blog
■Search Start with a backslash, followed by the search term. Remember,
Linux is case sensitive, so if you’re searching for “Naresh” in /etc/passwd,
use the /Naresh (not /naresh) command.
■ Write To save your changes, use the w command. You can combine
commands; for example, wq writes the file and exits vi.
■ Quit To leave vi, use the q command. If you want to abandon any changes
that you’ve made, use the q! command.
■Edit You can use a number of commands to edit files through vi, such as x,
which deletes the currently highlighted character, dw, which deletes the currently
highlighted word, and dd, which deletes the current line. Remember, p places
text from a buffer, and u restores text from a previous change.
■ Insert A number of commands allow you to start insert mode, including
i to start inserting text at the current position of the editor, and o to open up
a new line immediately below the current position of the cursor.

No comments: