
ATs.T -vstem USER'S Gl..JDE / Second Edition , , .' UNIX® System V User's Guide -. ~- AT&T UNIX® System V User's Guide, Second Edition AT&T Prentice-Hall, Inc., Englewood Cliffs, NJ 07632 Library of Congress Catalog Card Number: 87-60147 Editorial/production supervision: Karen S. Fortgang Cover illustration: Jim Kinstry Manufacturing buyer: S. Gordon Osbourne ©1987, 1986 by AT&T. All Rights Reserved. IMPORTANT NOTE TO USERS While every effort has been made to ensure the accuracy of all information in this document, AT&T assumes no liability to any party for any loss or damage caused by errors or omissions or statements of any kind in the UN/~ System V User's Guide, its updates, supplements, or special editions, whether such errors are omis­ sions or statements resulting from negligence, accident, or any other cause. AT&T further assumes no liability arising out of the application or use of any product or system described herein; nor any liability for incidental or consequential damages arising from the use of this document. AT&T disclaims all warranties regarding the information contained herein, whether expressed, implied or statutory, includ­ ing implied warranties or merchantability or fitness for a particular purpose. AT &T reserves the right to make changes without further notice to any products herein to improve reliability, function or design. No part of this publication may be reproduced, transmitted or used in any form or by any means - graphic, electronic, mechanical or chemical, including photocopy­ ing, recording in any medium, taping, by any computer or information storage and retrieval systems, etc. without prior permission in writing from AT&T. Dataphone is a registered trademark of AT &T. DOCUMENTER'S WORKBENCH is a trademark of AT&T. HP is a trademark of Hewlett-Packard. IBM is a registered trademark of International Business Machines. Teletype is a registered trademark of AT&T. UNIX is a registered trademark of AT&T. All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher. Printed in the United States of America 10 9 8 7 6 5 4 ISBN 0-13-940545-3 025 Prentice-Hall International (UK) Limited, London Prentice-Hall of Australia Pty. Limited, Sydney Editora Prentice-Hall do Brasil, Ltda., Rio de Janeiro Prentice-Hall Canada Inc., Toronto Prentice-Hall Hispanoamericana, S.A., Mexico Prentice-Hall of India Private Limited, New Delhi Prentice-Hall of Japan, Inc., Tokyo Prentice-Hall of Southeast.Asia Pte. Ltd., Singapore Table of Contents Preface xi Part 1: UNIX System Overview Chapter 1: What is the UNIX System? What the UNIX System Does How the UNIX System Works 3 Chapter 2: Basics for UNIX System Users 14 Getting Started 14 The Terminal 15 Obtaining a Login Name 26 Establishing Contact with the UNIX System 27 Part 2: UNIX System Tutorials Chapter 3: U sing the File System 39 Introduction 39 How the File System is Structured 40 Your Place in the File System 42 Organizing a Directory 54 Accessing and Manipulating Files 69 Summary 113 TABLE OF CONTENTS v Table of Contents ------------------ Chapter 4: Overview of the Tutorials 114 Introduction 114 Text Editing 115 The Shell 120 Communicating Electronically 125 Programming in the System 126 Chapter 5: Line Editor Tutorial (ed) 127 Introducing the Line Editor 127 Suggestions for Using this Tutorial 128 Getting Started 129 Exercise 1 140 General Format of ed Commands 141 Line Addressing 142 Exercise 2 156 Displaying Text in a File 157 Creating Text 160 Exercise 3 168 Deleting Text 170 Substituting Text 175 Exercise 4 184 Special Characters 186 Exercise 5 197 vi USER'S GUIDE ------------------- Table of Contents Moving Text 199 Exercise 6 208 Other Useful Commands and Information 209 Exercise 7 219 Answers to Exercises 220 Chapter 6: Screen Editor Tutorial (vi) 239 Introduction 239 Getting Started 242 Creating a File 245 Editing Text: the Command Mode 248 Quitting vi 256 Exercise 1 259 Moving the Cursor Around the Screen 260 Positioning the Cursor in Un displayed Text 278 Exercise 2 290 Creating Text 292 Exercise 3 297 Deleting Text 298 Exercise 4 305 Modifying Text 306 Cutting And Pasting Text Electronically 314 Exercise 5 319 TABLE OF CONTENTS vii Table of Contents ------------------ Special Commands 320 Using Line Editing Commands in vi 322 Quitting vi 330 Special Options for vi 333 Exercise 6 336 Answers To Exercises 337 Chapter 7: Shell Tutorial 344 Introduction 344 Shell Command Language 345 Command Language Exercises 380 Shell Programming 381 Modifying Your Login Environment 436 Shell Programming Exercises 443 Answers To Exercises 445 Chapter 8: Communication Tutorial 452 Introduction 452 Exchanging Messages 453 mail 454 mailx 467 mailx Overview 468 Command Line Options 470 How to Send Messages: the Tilde Escapes 471 viii USER'S GUIDE ----------------- Table of Contents How to Manage Incoming Mail 483 The .mailrc File 493 Sending and Receiving Files 498 Networking 518 Appendix A: Summary of the File System 529 Appendix B: Summary of UNIX System Commands 532 Appendix C: Quick Reference to ed Commands 537 Appendix D: Quick Reference to vi Commands 542 Appendix E: Summary of Shell Command Language 551 Appendix F: Setting Up the Terminal 558 Glossary 568 Index 583 TABLE OF CONTENTS ix Preface The material in this guide is organized into two major parts: an overview of the UNIX operating system and a set of tutorials on the main tools available on the UNIX system. A brief description of each part follows. The last section of this Preface, "Notation Conventions," describes the typographical notation with which all the chapters of this Guide conform. You may want to refer back to this section from time to time as you read the Guide. System Overview This part consists of Chapters 1-3, which introduce you to the basic princi­ ples of the UNIX operating system. Each chapter builds on information presented in preceding chapters, so it is important to read them in sequence. • Chapter 1, "What is the UNIX System?," provides an overview of the operating system. • Chapter 2, "Basics for UNIX System Users," discusses the general rules and guidelines for using the UNIX system. It covers topics related to using your terminal, obtaining a system account, and establishing contact with the UNIX system. • Chapter 3, "Using the File System," offers a working perspective of the file system. It introduces commands for building your own directory structure, accessing and manipulating the subdirectories and files you organize within it, and examining the contents of other directories in the system for which you have access permission. UNIX System Tutorials The second part of the Guide consists of tutorials on the following topics: the ed text editor, the vi text editor, the shell command language and programming language, and electronic communication tools. For a thorough understanding of the material, we recommend that you work through the examples and exercises as you read each tutorial. The tutorials assume you understand the concepts intro­ duced in Chapters 1-3. PREFACE xi Preface • Chapter 4, "UNIX System Capabilities," introduces the four chapters of tutorials in the second half of the Guide. It highlights UNIX system capa­ bilities such as command execution, text editing, electronic communication, programming, and aids to software development. • Chapter 5, "Line Editor Tutorial (ed)," teaches you to how to use the ed text editor to create and modify text on a video display terminal or paper printing terminal. • Chapter 6, "Screen Editor Tutorial (vi)," teaches you how to use the visual text editor, vi, to create and modify text on a video display terminal. vi, the visual editor, is based on software developed by The University of Califor­ nia, Berkeley, California; Computer Science Division, Department of Electrical Engineering and Computer Science, and such software is owned and licensed by the Regents of the University of California. • Chapter 7, "Shell Tutorial," teaches you to how to use the shell, both as a command interpreter and as a programming language used to create shell programs. • Chapter 8, "Communication Tutorial," teaches you how to send messages and files to users of both your UNIX system and other UNIX systems. Reference Information Six appendices and a glossary of UNIX system terms are also provided for reference. • Appendix A, "Summary of the File System," illustrates how information is stored in the UNIX operating system. • Appendix B, "Summary of UNIX System Commands," describes, in alphabetical order, each UNIX system command discussed in the Guide. xii USER'S GUIDE Preface • Appendix C, "Quick Reference to ed Commands," is a quick reference for the line editor, ed. (For details, see Chapter 5, "Line Editor Tutorial.") The commands are organized by topic, as they are covered in Chapter 5. • Appendix D, "Quick Reference to vi Commands," is a reference for the full screen editor, vi, discussed in Chapter 6, "Screen Editor Tutorial (vi)." Commands are organized by topic, as covered in Chapter 6. • Appendix E, "Summary of Shell Command Language," is a summary of the shell command language, notation, and programming constructs, as dis­ cussed in Chapter 7, "Shell Tutorial." • Appendix F, "Setting Up the Terminal," explains how to configure your terminal for use with the UNIX system, and create multiple windows on the screens of terminals with windowing capability. • The Glossary defines terms pertaining to the UNIX system used in this book. PREFACE xiii Notation Conventions The following notation conventions are used throughout this Guide. bold User input, such as commands, options and argu­ ments to commands, variables, and the names of directories and files, appear in bold. italic Names of variables to which values must be assigned (such as password) appear in italic.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages610 Page
-
File Size-