Hi quest ,  welcome  |  sign in  |  registered now  |  need help ?

[Unix] VI editor commands

Written By RAM on Thursday, June 2, 2011 | 2:33 AM


Some useful vi commands

1.) vi filename gets you into the editor

2.) h - move left one space

3.) j - move down one line

4.) k - move up one line

5.) l - move right one space

6.) i - go into insert mode

7.) 'esc' key - get out of insert mode

8.) x - delete a character

9.) dd - delete the current line, 2dd delete the current and next line, 3dd etc.

10.) / - to into search mode to search for a pattern

11.) a - go into append mode to append characters, use 'esc' key to get out of this mode

12.) ctrl f - page forward one screen

13.) ctrl b - page back one screen

14.) G - the go command, type 44G to move the cursor to line 44. G w/o a line number move
you to the end of the file.

15.) ctrl g - tells you what line you are on in the file and how many lines the file contains.

16.) shift ZZ gets your file written to disk and exits the editor

17.) :quit! quits the file w/o saving your changes (in case you mess up).

0 comments:

Post a Comment