Unix vi editor commands - Cheat Sheet

Some useful vi commands - Cheat Sheet

 

1.)  vi filename gets you into the editor

 

2.)  h - move left one space

 

3.)  j - move down one line

 

4.)  k - move up one line

 

5.)  l - move right one space

 

6.)  i - go into insert mode

 

7.)  'esc' key - get out of insert mode

 

8.)  x - delete a character

 

9.)  dd - delete the current line, 2dd delete the current and next line, 3dd etc.

 

10.)  / - to into search mode to search for a pattern

 

11.)  a - go into append mode to append characters, use 'esc' key to get out of this mode

 

12.)  ctrl f - page forward one screen

 

13.)  ctrl b - page back one screen

 

14.)  G - the go command, type 44G to move the cursor to line 44.  G w/o a line number move you to the end of the file. 

 

15.)  ctrl g - tells you what line you are on in the file and how many lines the file contains.

 

16.)  shift ZZ gets your file written to disk and exits the editor

 

17.)  :quit!  quits the file w/o saving your changes (in case you mess up). 

 


Comments (1)

deepak
Said this on 4-19-2010 At 11:31 pm

how should i download this cheat sheet

Post a Comment
* Your Name:
* Your Email:
(not publicly displayed)
Reply Notification:
Approval Notification:
Website:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image:
* Message:

Email to Friend

Fill in the form below to send this article to a friend:

Email to Friend
* Your Name:
* Your Email:
* Friend's Name:
* Friend's Email:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image
* Message: