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
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 this post positively positive Bewertung](/images/pro.gif)
{{percentage}} % positive
![rate this article negatively negative Bewertung](/images/con.gif)