Short note about VI Editor in linux





VI Editor

# vi <file_name> --- It will create new file and open in command mode.

#After opening the vi in the command mode

   #i--- insert a cursor
   #a--- write after cursor
   #A--- write at the end of the line
   #ESC --- Terminate the insert mode
   #u--- Undo last change
   #U--- Undo all change to the entire line
   #O – Open a new file
   #dd--- delete a line
   #3dd--- Delete 3 line
   #D--- Delete contents of line after the courser
   #c--- Delete contents of line after the courser and inset new text
   #dw--- Delete word
   #4dw--- Delete 4 words
   #Cw--- change word
   #x--- Delete character at cursor
   #r--- replace cursor
   #R--- Overwrite charecter from the cursor on ward.
   #s--- Substitute one character under cursor continue to insert
   #S--- Substitute entire line and begin to insert at beginning at the line.
   #~ --- Change case of individual character.



Save and closing the file from vi editor

Shift +zz --- Save the file and quit
:w --- Save the file but keep it open
:q --- Quit without saving
:wq --- Save the file and quit
:x --- Save the file and quite
 

0 comments :

Post a Comment