Main index

Introducing UNIX and Linux


Getting started

Overview
Using UNIX
      Usernames
      Logging in
Logging out
Commands
      Typing in commands
      Commands and options
Communication with other users
      Email
      Other communication facilities
Files
      The editor Vi
            Vi commands (command mode)
            Vi commands (colon mode)
      Other editors
Input and output
      Scripts
      Here-documents
      Pipes
      Making copies of input and output
      Pagers
Emergencies
Getting help
Summary
Exercises

Vi commands (command mode)

a enter insert mode after cursor position
b moves the cursor back to the previous start of a word
cw change the word the cursor is on by deleting it and entering insert mode
D delete rest of line after cursor position
dd delete the line the cursor is on
dw delete the word the cursor is on
e moves the cursor to the next end of a word
i enter insert mode before cursor position
J join the line the cursor is on and the following line together
o open a new line, position the cursor at the start of it and enter insert mode
w moves the cursor to the start of the next word
x delete the character at the cursor
ZZ write all changes to the file, and quit Vi
^ moves the cursor to the beginning of the current line
C moves the cursor to the end of the current line
/word search forward for the string word
?word search backwards for the string word
ctrl-D move down the file half a screen
ctrl-U move back up the file half a screen

Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck