Using Vi editor - Linux Views : 528
Tagged in : Linux
0 0
Send mail
To open vi editor

$ vi filename
filename is the name of the file

There are two modes in vi. They are Insert mode and Command mode
--> press i to switch to insert mode (can insert text)
--> press ESC to switch to command mode (can give commands)
--> press :w to Save the file
--> press :q to quit the file
--> press :wq to save and quit the file

Arrow
Replacing text in vi

c can be used to change text from the cursor

--> press cw - it changes to the end of a word
--> press c2b - back two words
--> press c$ - to the end of line
--> press c0 - to the beginning of line

Arrow
Deleting text in vi

--> press dw - it deletes a word beginning where the cursor is positioned
--> press dd - it deletes entire line
--> press 2dd - it deletes two continuous lines
By Nithya, On - 2010-01-29



    Login to add Comments .