Basic VI commands

The most commonly used commands in vi Editor are as follows:


             COMMAND
            DESCRIPTION
              a
starts insert mode after current position of cursor.
              A
starts insert mode at end of the current line.
              cw
Deletes the current word and than enters the insert mode to replace that word.
              dw
Deletes the current word without entering the insert mode.
              dd
Deletes the current line.
              G
Moves cursor at the end of the line.
              15G
Moves cursor to fifteenth line.
               h
Moves cursor left one space.
               I
Enters insert mode.
               o
enters insert mode opening line below current cursor.
               O
enters insert mode opening line above current cursor.
               :q
Exits from vi.
               r
Replace; replaces current character with next character.
               :set nu
shows line number for the current line
               u
Undoes the last change
               :w
Writes the current file.
               Esc
Escapes from insert mode
               /system
Searches the word System in current file

Comments

0 Responses to "Basic VI commands"

Post a Comment

 

Managing Shell And its Secrets

Subscribe To Get Update On Mobile

Subscribe
Get updates of latest post on your mobile free