Wednesday, 5 September 2012


    Basic vi editor commands for RHEL OS

   Redhat
    Basic vi commands while in command mode
  • To invoke  vi editor type ‘vi’ <filename> on the command line.
  • vi filename

 Input CommandDescription
ddDelete line
3dd Delete 3 lines
dwDelete word
4dwDelete 4 words
ESCTerminate insert mode
Undo last change
Undo all changes to entire line
h/j/k/lMove cursor left/down/up/right
spacebarMove cursor right one space
ctrl-dScroll down one half of a page
ctrl-dScroll down one half of a page
ctrl-uScroll up one half of a page
ctrl-fScroll forward one page
ctrl-bScroll back one page
ggFor going to top of file
shift+gFor bottom of file
/wordFor searching the word in Entire File
yyFor copying
3yywill copy 3 lines
pFor pasting
x10delete (cut) 10 characters
: uundo last command
:%s/apple/ball/gIt searches and replaces all the occurrence of word apple with ball  in the entire file


No comments:

Post a Comment