top of page
natemk

LINUX: vi editor commands

Updated: Apr 23, 2022

File Open

vi filename - Open or create a file

vi - Open a new file to be named later

vi -r filename - Recover crashed file

view filename - Open file read-only


Insert Characters and Lines

a - Insert characters right of the cursor

A - Insert characters end of the line

i - Insert characters left of the cursor

I - Insert characters beginning of the line

o - Insert line below the cursor

O - Insert line above the cursor


Delete Text in file

x - Delete the character at the cursor

X - Delete the character to the left of the cursor

dw -Delete word (or part of a word to the right of the cursor)

dd - Delete the current line

D - Delete part of the line to the right of cursor

dG - Delete to end of file

d1G - Delete - beginning of the file to cursor

:1,4 d - Delete lines 1 to 4

17 views0 comments

Recent Posts

See All

Comments


bottom of page