================
Editors in Linux
================
GUI Editors
=========
emacs
nedit
gedit
CUI/TUI Editors
============
Vi (default Unix/Linux editor)
nano
ed/ex ==> line-oriented text editors
There are three modes:
==================
command Mode
Insert Mode
Execution Mode
command mode:
********************
yy ==> to copy the line
p ==> to paste the line
"n"yy ==> to copy "n" number of lines
dd ==> to delete the line
"n" dd ==> to delete "n" number of lines
x ==> to delete the character
dw ==> to delete the word
u ==> undo
ctrl + r ==> redo
shift + r ==> replace
shift + j ==> joining the lines
/<word> ==> search for a word
Insert Mode:
***************
i ==> for insert mode
Execution Mode:
*******************
:e! ==> reedit
:w ==> write the file (save)
:q ==> quit without saving the file
:wq ==> write the file (save) & quit the file
:wq! ==> forcefully write the file (save) & quit the file
:w! ==> forcefully write the file
:q! ==> quit forcefully
:set nu ==> to show line numbers
:set nonu ==> to show all lines without line numbers
:85 ==> go to line number 85 (:n)
for find & replace
******************
:1,$s/redhat(old string)/rhce(new string)/g (global expression)
:1,10s/redhat/rhce
:1,15d ==> deleting from line 1 to 15
:1,%d ==> deleting the entire buffer
:1,$d ==> deleting the entire buffer
:n ==> next file
:rew ==> previous (rewinding) file
:w /appl/mynewfile ==> save the file with different location with different name
you can get more details about vi editor from below utility in Linux:
***************************************************************************
#man vi
or
#vimtutor
Editors in Linux
================
GUI Editors
=========
emacs
nedit
gedit
CUI/TUI Editors
============
Vi (default Unix/Linux editor)
nano
ed/ex ==> line-oriented text editors
There are three modes:
==================
command Mode
Insert Mode
Execution Mode
command mode:
********************
yy ==> to copy the line
p ==> to paste the line
"n"yy ==> to copy "n" number of lines
dd ==> to delete the line
"n" dd ==> to delete "n" number of lines
x ==> to delete the character
dw ==> to delete the word
u ==> undo
ctrl + r ==> redo
shift + r ==> replace
shift + j ==> joining the lines
/<word> ==> search for a word
Insert Mode:
***************
i ==> for insert mode
Execution Mode:
*******************
:e! ==> reedit
:w ==> write the file (save)
:q ==> quit without saving the file
:wq ==> write the file (save) & quit the file
:wq! ==> forcefully write the file (save) & quit the file
:w! ==> forcefully write the file
:q! ==> quit forcefully
:set nu ==> to show line numbers
:set nonu ==> to show all lines without line numbers
:85 ==> go to line number 85 (:n)
for find & replace
******************
:1,$s/redhat(old string)/rhce(new string)/g (global expression)
:1,10s/redhat/rhce
:1,15d ==> deleting from line 1 to 15
:1,%d ==> deleting the entire buffer
:1,$d ==> deleting the entire buffer
:n ==> next file
:rew ==> previous (rewinding) file
:w /appl/mynewfile ==> save the file with different location with different name
you can get more details about vi editor from below utility in Linux:
***************************************************************************
#man vi
or
#vimtutor
No comments:
Post a Comment