Basic Unix “vi” Commands

Here is my commonly used commands using unix “vi” in general, it’s very useful especial when you’re creating and maintaining cron script on unix server.

Command Description
a Enters text input mode and appends text after the
ECS Escape; leaves text input mode and returns to  command mode
h Moves the cursor one character to the left.
k Moves the cursor down one line in the same column
l Moves the cursor one character to the right
x Deletes the current character.
CR Carriage return;moves the cursor down to the begining of the next line.
ZZ Writes to the file those changes made to the buffer that not already been written and quits vi
:z Writes to the file those changes made to the buffer
:q Quits vi if changes made to the buffer have been written to a file

Positioning by Character

Command Description
h Moves the cursor one character to the left.
BACKSPACE Backspace;moves the cursor one character to the Left.
l Moves the cursor one character to the right
space bar Moves the cursor one character to the right
fx Moves the cursor right to the specified character x
Fx Moves the cursor left to the specified character x
tx Moves the cursor right to the character just before the specified character x

This post is tagged: , , , ,


5 Responses to “Basic Unix “vi” Commands”
  1. Eventually, a fantastic site that isn’t in my encounter trying to continually sell me something. Thanks, please maintain up the good function.

  2. 01.26.2011

    You completed some nice points there. I did a search on the subject and found a good number of folks will have the same opinion with your blog.

  3. 02.05.2011

    Just wanted to say Love the blog here. Nice colors. I am definitely staying tuned to this one. Hope to see more.

  4. 02.09.2011

    You must be a genious. I love your posts, will come back later.

  5. 02.12.2011

    The article is very excellent.Let me learn a lot of knowledge.


Leave a Reply