VI Editor - Commands

Preview VI Editor - Commands

Most Linux distributions use VI as their default editor. Although VI is very convenient to use after learning certain shortcuts, it is not exactly self-explanatory, especially for beginners.

edit/paste

i

save and close

:wq 

close without save

:q!

search forward

/Searchtext

back

?Searchtext

continue search "n" next

Search / Replace

:1,$s/Unix/Linux/g 

replace "Unix" with "Linux" (range: 1,$ -> from beginning to end, g: replace all)

:%s/Unix/Linux/g 

delete the whole document

:1,$d
rate:
rate this post positively
(0)
rate this article negatively
(0)

Questions / Comments


Thank you! We well check your comment as soon as possible


 
By continuing to browse the site, you agree to our use of cookies. More Details