08 Viewing and Editing Files







Head and Tail  display only 10 lines by default

tail -15 file.tyxt





Vi Editor

vi file

vim file same as vi but more features

view file start vim in read-only mode


k  up one line

j down one line

h left one character

l right one character

w right one wiorf

b left one word

^ go to geginning of the line

$ go to the end of the line

vi navigation keys

i insert at the cursor position

I insert at the beginning of the line

a Append after the cursor position

A append at the end of the line.

vi modes


Vi Repeating Commands

Vi Repeating Commands


Vi Deleting Text


delete a character

dw delete a word

dd delete a line

D delete from the current position


Vi Changing Text

r replace the current character

cw change the current word

cc change the current line

c$ change the text from the current position

C same as c$

~ Reverse the case of a character


Graphical Editors



gedit  default for Gnome


kedit default for KDE