Vim Text editor and Nano editor|How to use vim & nano editors in Linux|Linux commands for devops
There are 3 modes of VI Editor 1. Command Mode In command mode we cannot edit/input the text into the file/editor. To enter into command mode we need use [ESC] key. by default 2. Input Mode Input mode any key press will be taken as an input and will writes on to the file To enter into input mode you should press [i] key on the keyboard 3. Exit Mode In this we are going to quit from the editor. First we should be back to command mode by [ESC] and should type :q [quit] I=insert contents from the begining of the line i=insert contents from the current cursor position R=Replace characters from current cusor position S=replace single character O = open a new line above the current line o = open a new line below the current line write and save :wq quit without saving :q! quit :q undo :u move cursor to the begining of previous word :b yy = yank (copy the line) 2yy = copy 2 lines p = paste x=delete a character dw=delete a word dd=delete line 2dd=delete 2 lines
Comments
Post a Comment