Editor In Red Hat
Editors in Red Hat :
The term editor is commonly used to refer to a text editor, which is a software program that allows users to create or manipulate plain text computer files.
Nano : Is basic guide editor.
Vi : Visual editor
Vim : It is update version of vi (it is color-full editor.)
Command
#nano anaconda-ks.cfg
The three modes of vi & vim :
Now you open new file by vi & vim, you are in command mode.
There are 10 keys which takes you to the ‘insert mode.
Normal we are used “i” for go to insert mode form command mode.
You show that ---Insert modes--- at last line.
If you want go back to command mode press “esc” key.
To go to ex mode press “:” key and than enter the command. (shift+: key is used)
You show that “:” at last line
You can go to ex mode from command mode.
Commands for command mode editor :
- L : move right one character.
- H : move left one character.
above task is also doing by “arrow key”.
- $ : move to end of the current line.
- 0 : move to beginning of the current line.
- W : move to the next word.
- {{ : move to the first line of the file.
- }} : move to the last line of the file.
- DD : delete current line.
- D$ : delete from cursor to end of the line.
- U : undo the last change.
- Y) : copy to end sentence.
- Y} : copy to end of paragraph.
- Y5 : copy six line form after cursor.
Ex mode commands :
- :w : save file and remains in the editor.
- :q : quit when no change made to file.
- :wq! : Save & exit forcefully.
- /text : searches downward for next
- :20 : to go the 20 number line.
- :%s/windows/linux : replace the word.
Command
Cp anaconda-ks.cfg /root/Desktop/
Vim /root/Desktop/anaconda-ks.cfg (do above command)