Operating System User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
· . SCO®UNIX ® Operating System User's Guide sea sco® UNIX® Operating System User's Guide © 1983-1992 The Santa Cruz Operation, Inc. © 1980-1992 Microsoft Corporation. © 1989-1992 UNIX System Laboratories, Inc. All Rights Reserved. No part of this publication may be reproduced, transmitted, stored in a retrieval system, nor translated into any human or computer language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual, or otherwise, without the prior written permission of the copyright owner, The Santa Cruz Operation, Inc., 400 Encinal, Santa Cruz, California, 95061, U.S.A. Copyright infringement is a serious matter under the United States and foreign Copyright Laws. The copyrighted software that accompanies this manual is licensed to the End User only for use in strict accor dance with the End User License Agreement, which should be read carefully before commencing use of the soft ware. Information in this document is subject to change without notice and does not represent a commitment on the part of The Santa Cruz Operation, Inc. The following legend applies to all contracts and subcontracts governed by the Rights in Technical Data and Com puter Software Clause of the United States Department of Defense Federal Acquisition Regulations Supplement: RESTRICTED RIGHTS LEGEND: USE, DUPLICATION, OR DISCLOSURE BY THE UNITED STATES GOVERNMENT IS SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH (c) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. "CONTRACTOR/SUPPLIER" IS THE SANTA CRUZ OPERATION, INC. 400 ENCINAL STREET, SANTA CRUZ, CALIFORNIA 95061, U.S.A. Microsoft, MS-DOS, and XENIX are trademarks of Microsoft Corporation. UNIX is a registered trademark of UNIX System Laboratories, Inc. in the U.S.A. and other countries. Date: 31 January 1992 Document Version: 3.2.4C Chapter 1 Introduction 1 About'this guide .................................................................................................................. 1 Documentation conventions ............................................................................................. 2 Locating manual pages ....................................................................................................... 4 Using online manual pages ...................................................................................... 4 The keyboard ........................................................................................................................ 6 Chapter 2 Creating, editing, and printing files 7 A vi tutorial ........................................................................................................................... 8 Entering the editor ...................................................................................................... 8 Inserting text ................................................................................................................ 9 Repeating a command ............................................................................................. 10 Undoing a command ............................................................................................... 10 Moving the cursor .................................................................................................... 11 Deleting text .............................................................................................................. 12 Searching for a pattern ............................................................................................ 14 Searching and replacing .......................................................................................... 16 Leaving vi ....................................................... ~ ........................................................... 17 Adding text from another file ................................................................................ 17 Leaving vi temporarily ............................................................................................ 18 Changing your display ............................................................................................ 18 Canceling an editing session .................................................................................. 19 Editing tasks ....................................................................................................................... 20 How to enter the editor ........................................................................................... 20 Moving the cursor .................................................................................... ;............... 20 Moving around in a file ........................................................................................... 23 Inserting text before the cursor .............................................................................. 23 Correcting typing mistakes .................................................................................... 24 Opening a new line .................................................................................................. 24 Repeating the last insertion .................................................................................... 24 Inserting text from other files ................................................................................ 24 Inserting control characters into text ................................................................... 28 Joining and breaking lines ...................................................................................... 28 Deleting a character ................................................................................................. 28 Deleting a word ........................................................................................................ 28 Table of contents v Deleting a line ............................................................................................................ 29 Deleting an entire insertion .................................................................................... 29 Deleting and replacing text .................................................................................... 30 Moving text ................................................................................................................ 32 Searching for patterns .............................................................................................. 35 Searching and replacing .......................................................................................... 36 Pattern matching ...................................................................................................... 38 Undoing a command ............................................................................................... 40 Repeating a command ............................................................................................. 41 Leaving the editor .................................................................................................... 41 Editing a series of files ............................................................................................. 42 Editing a new file without leaving the editor ..................................................... 44 Leaving the editor temporarily .............................................................................. 44 Performing a series of line-oriented commands ................................................ 45 Finding out what file you are editing ................................................................... 45 Finding out what line you are on .......................................................................... 46 Solving common problems ............................................................................................. 46 Setting up your vi environment ..................................................................................... 47 Setting the terminal type ......................................................................................... 48 Setting options with the set command ................................................................ 48 Displaying tabs and end-of-line ............................................................................ 49 Ignoring case in search commands ....................................................................... 50 Displaying line numbers ......................................................................................... 50 Printing the number of lines changed .................................................................. 50 Changing the terminal type ................................................................................... 50 Shortening error messages ..................................................................................... 50 Turning offwamings ................................................................................................ 51 Permitting special characters in searches ............................................................ 51 Limiting searches ...................................................................................................... 51 Turning on messages ............................................................................................... 51 Mapping keys ............................................................................................................ 52 Abbreviating strings ................................................................................................ 52