Friday, October 06, 2006

Useful VI Commands

This is an ongoing post of little things that can help so much when using the Linux editor VI:

When vi'ing a file try the following:

Shift+G - go to end of file
: - go to line number n
:i - insert
:A - insert at end of line
cw - while in insert mode - change word (deletes word)
y - cut the n number of lines blow the cursor
p - paste below line
P - past above line

If you ever get lost in VI or want to get out of Insert mode, hit Esc.

As you may realise i'm no linux engineer, but these small commands have helped me save a lot of time when editing linux configs etc.

More to come soon...

No comments: