Teach Yourself UNIX in 24 Hours

Teach Yourself UNIX in 24 Hours

Teach Yourself UNIX in 24 Hours Dave Taylor James C. Armstrong, Jr. 201 West 103rd Street Indianapolis, Indiana 46290 iv Teach Yourself UNIX in 24 Hours Decimilli accipitrae Raptor Regina.—JA Acquisitions Editor Grace M. Buechlein To the newest light of my life: Ashley Elizabeth.—DT Development Editor Brian-Kent Proffitt Copyright Ó 1997 by Sams Publishing Production Editor FIRST EDITION Kristi Hart All rights reserved. No part of this book shall be reproduced, stored in a Indexer retrieval system, or transmitted by any means, electronic, mechanical, photo- Greg Pearson copying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the informa- Technical Reviewer tion contained herein. Although every precaution has been taken in the Raj Mangal preparation of this book, the publisher and author assume no responsibility for Editorial Coordinators errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. For information, address Sams Mandi Rouell Publishing, 201 W. 103rd St., Indianapolis, IN 46290. Katie Wise Technical Edit Coordinator International Standard Book Number: 0-672-31107-0 Lynette Quinn Library of Congress Catalog Card Number: 97-66198 Resource Coordinator 2000 99 98 97 4 3 2 1 Deborah Frisby Interpretation of the printing code: the rightmost double-digit number is the Editorial Assistants year of the book’s printing; the rightmost single-digit, the number of the book’s Carol Ackerman printing. For example, a printing code of 97-1 shows that the first printing of Andi Richter the book occurred in 1997. Rhonda Tinch-Mize Composed in AGaramond and MCPdigital by Macmillan Computer Publishing Cover Designer Tim Amrhein Printed in the United States of America Book Designer All terms mentioned in this book that are known to be trademarks or service Gary Adair marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded Copy Writer as affecting the validity of any trademark or service mark. David Reichwein Production Team Supervisors Brad Chinn Charlotte Clapp Production Brad Lenser President, Sams Publishng Richard K. Swadley Chris Livengood Publishing Manager Dean Miller Gene Redding Director of Editorial Services Cindy Morrow Janet Seib Director of Marketing Kelli Spencer Product Marketing Manager Wendy Gilbride Assistant Marketing Managers Jen Pock, Rachel Wolfe Overview Introduction xvi Hour 1 What Is this UNIX Stuff? 1 2 Getting onto the System and Using the Command Line 21 3 Moving About the File System 43 4 Listing Files and Managing Disk Usage 63 5 Ownership and Permissions 87 6 Creating, Moving, Renaming, and Deleting Files and Directories 113 7 Looking into Files 127 8 Filters and Piping 145 9 Wildcards and Regular Expressions 161 10 Power Filters and File Redirection 187 11 An Introduction to the vi Editor 199 12 Advanced vi Tricks, Tools, and Techniques 245 13 An Overview of the emacs Editor 281 14 Introduction to Command Shells 305 15 Getting the Most Out of the C Shell 323 16 Basic Shell Programming 347 17 Job Control 361 18 Printing in the UNIX Environment 379 19 Searching for Information and Files 397 20 Communicating with Others 407 21 Using Netscape To See the World Wide Web 425 22 Internet E-Mail, Netnews, and IRC 443 23 Using telnet and ftp 479 24 Programming in C for UNIX 509 Glossary 531 Index 541 vi Teach Yourself UNIX in 24 Hours Contents Hour 1 What Is This UNIX Stuff? 1 Goals for This Hour ................................................................................... 1 What Is UNIX? .......................................................................................... 2 A Brief History of UNIX ............................................................................ 3 The C Programming Language .............................................................. 4 UNIX Becomes Popular ........................................................................ 5 What’s All This About Multiuser Systems? ................................................. 5 Cracking Open the Shell ............................................................................ 6 Getting Help .............................................................................................. 7 Task 1.1: Man Pages, UNIX Online Reference...................................... 7 Task 1.2: Other Ways to Find Help in UNIX ..................................... 14 Summary .................................................................................................. 17 Workshop ................................................................................................ 17 Key Terms ........................................................................................... 17 Questions ............................................................................................ 18 Preview of the Next Hour .................................................................... 19 2 Getting onto the System and Using the Command Line 21 Goals for This Hour ................................................................................. 21 Task 2.1: Logging In and Out of the System ....................................... 22 Task 2.2: Changing Passwords with passwd ........................................ 25 Task 2.3: Picking a Secure Password .................................................... 26 Task 2.4: Who Are You? ...................................................................... 28 Task 2.5: Finding Out What Other Users Are Logged in to the System................................................................................. 30 Task 2.6: What Is Everyone Doing on the Computer? ......................... 31 Task 2.7: Checking the Current Date and Time .................................. 33 Task 2.8: Looking at a Calendar .......................................................... 33 Simple Math with UNIX .......................................................................... 36 Task 2.9: Using the bc Infix Calculator ............................................... 36 Task 2.10: Using the dc Postfix Calculator .......................................... 38 Summary .................................................................................................. 40 Workshop ................................................................................................ 40 Key Terms ........................................................................................... 40 Questions ............................................................................................ 41 Preview of the Next Hour .................................................................... 41 3 Moving About the File System 43 Goals for This Hour ................................................................................. 43 What a Hierarchical File System Is All About ........................................... 44 Task 3.1: The UNIX File System Organization ................................... 45 The bin Directory ............................................................................... 46 The dev Directory ............................................................................... 47 The etc Directory ............................................................................... 47 The lib Directory ............................................................................... 47 The lost+found Directory .................................................................. 48 The mnt and sys Directories ............................................................... 48 The tmp Directory ............................................................................... 48 The usr Directory ............................................................................... 48 Other Miscellaneous Stuff at the Top Level ......................................... 49 How Mac and PC File Systems Differ from the UNIX File System .......... 50 Directory Separator Characters ................................................................. 50 The Difference Between Relative and Absolute Filenames ........................ 51 Task 3.2: Hidden Files in UNIX ......................................................... 52 Task 3.3: The Special Directories “.” and “..” ...................................... 55 Task 3.4: The env Command .............................................................. 56 Task 3.5: PATH and HOME ..................................................................... 57 Task 3.6: Find Where You Are with pwd ............................................. 58 Task 3.7: Move to Another Location with cd ...................................... 58 Summary .................................................................................................. 60 Workshop ................................................................................................ 60 Key Terms ........................................................................................... 60 Questions ............................................................................................ 62 Preview of the Next Hour .................................................................... 62 4 Listing Files and Managing Disk Usage 63 Goals for This Hour ................................................................................. 63 The ls Command ..............................................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    572 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us