|
|
Using Vi editor - Linux
|
Views : 528
|
|
Tagged in : Linux
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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
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
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 |
|
|
|