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 (colon mode)

q quit Vi, provided you have not changed your file at all since you last saved it (if you have altered the file, Vi will warn you and will not terminate)
q! quit Vi, and any changes you have made to the file will be discarded and the file left in its original state
w writes all the changes to the file, but remain in Vi
wq equivalent to performing command w followed by command q; same as command-mode ZZ
0 moves the cursor to the beginning of the file
$ moves the cursor to the end of the file
number moves the cursor to the start of line number

Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck