Unix vi Editor

Unix Vi editor find and replace

:%s/FindMe/ReplaceME/g

Cut, Copy and Paste

Command Description
x delete (cut) character under the cursor
24x delete (cut) 24 characters
dd delete (cut) current line
4dd delete (cut) four lines
D delete to the end of the line from the cursor
dw delete to the end of the current word
yy copy (without cutting) current line
5yy copy (without cutting) 5 lines
p paste after current cursor position/line
P paste before current cursor position/line
Advertisements