ebook img

Linux+ 2005 In Depth PDF

705 Pages·2005·11.903 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Linux+ 2005 In Depth

Linux+ 2005 In Depth Jason W. Eckert M. John Schitka © 2005 by Thomson Course Technology PTR.All rights reserved.No part Publisher and GM of Course of this book may be reproduced or transmitted in any form or by any means, Technology PTR: electronic or mechanical, including photocopying, recording, or by any Stacy L.Hiquet information storage or retrieval system without written permission from Managing Editor: Thomson Course Technology PTR,except for the inclusion of brief quota- William Pitkin III tions in a review. Product Manager: The Thomson Course Technology PTR logo and related trade dress are Manya Chylinski trademarks of Thomson Course Technology PTR and may not be used Developmental Editor: without written permission. Dave George All other trademarks are the property of their respective owners. Production Editors: Important:Thomson Course Technology PTR cannot provide software sup- Elena Montillo, port.Please contact the appropriate software manufacturer’s technical sup- Megan Belanger, port line or Web site for assistance. Elizabeth Furbish Thomson Course Technology PTR and the author have attempted through- Senior Manufacturing out this book to distinguish proprietary trademarks from descriptive terms Coordinator: by following the capitalization style used by the manufacturer. Laura Burns Information contained in this book has been obtained by Thomson Course Technical Editor: Technology PTR from sources believed to be reliable.However,because of Burt LaFountain the possibility of human or mechanical error by our sources, Thomson Senior Marketing Manager: Course Technology PTR, or others, the Publisher does not guarantee the Sarah O’Donnell accuracy,adequacy,or completeness of any information and is not responsi- ble for any errors or omissions or the results obtained from use of such infor- Marketing Managers: mation.Readers should be particularly aware of the fact that the Internet is Heather Hurley and an ever-changing entity.Some facts may have changed since this book went Kristin Eisenzopf to press. Marketing Coordinator: Educational facilities, companies, and organizations interested in multiple Jordan Casey copies or licensing of this book should contact the publisher for quantity dis- Manager of Editorial Services: count information.Training manuals,CD-ROMs,and portions of this book Heather Talbot are also available individually or can be tailored for specific needs. Cover Design: ISBN:1-59200-728-7 Mike Tanamachi Library of Congress Catalog Card Number:2004116287 Compositor: William Hartman Printed in the United States of America Indexer: 05 06 07 08 09 BH 10 9 8 7 6 5 4 3 2 1 Sharon Shock Thomson Course Technology PTR, a division of Thomson Course Technology 25 Thomson Place ■ Boston, MA 02210 ■ http://www.courseptr.com Acknowledgments First, we wish to thank the staff at Course Technology for an overall enjoyable experience writing a book on Linux that takes a fundamentally different approach than traditional books. More specifically, we wish to thank our Project Manager, Manya Chylinski, for her coordination and insight, as well as our Developmental Editor, Dave George, and Production Editor, Elena Montillo, for the long hours they spent pulling everything together to transform the text into its current state. As well, we wish to thank Moirag Haddad at Digital Content Factory for her advice and guidance, and Frank Gerencser, of triOS College for freeing us up to write this book and his continuous encouragement for writing books to augment teaching. Jason W.Eckert:I must take this time to thank my co-author,M.John Schitka for the hard work,long hours,and dedication he spent on this book.As well,I thank Starbucks Coffee for keeping me on schedule,and most importantly,my daughter Mackenzie for providing me with many of the examples used in this book as well as teaching me that having fun playing basketball is more important than writing a book. M.John Schitka: First I want to thank my mentor and co-author Jason W. Eckert for his insight, patience, and wisdom during the long hours and late nights that went into the creation of this book.More importantly I must thank my family,my wife Jill, and children Kyra, Luke, and Noah for their support, tolerance, and patience during the time it took to write this book. Hopefully readers will find it enlightening and of benefit in their educational journey. Finally, we wish to acknowledge the encouragement of our colleagues Mitch Mijailovic and Tonio Mladineo;if it were not for them,I doubt we would love the Linux operating system as much as we do today. Readers are encouraged to e-mail comments,questions,and suggestions regarding Linux+ 2005 In Depth to the authors: Jason W.Eckert:[email protected] M.John Schitka:[email protected] This page intentionally left blank Contents at a Glance Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Chapter 1 Introduction to Linux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Chapter 2 Preparing for Linux Installation. . . . . . . . . . . . . . . . . . . . . 43 Chapter 3 Linux Installation and Usage. . . . . . . . . . . . . . . . . . . . . . . 73 Chapter 4 Exploring Linux Filesystems. . . . . . . . . . . . . . . . . . . . . . 113 Chapter 5 Linux Filesystem Management . . . . . . . . . . . . . . . . . . . . 159 Chapter 6 Linux Filesystem Administration. . . . . . . . . . . . . . . . . . . 199 Chapter 7 Advanced Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 Chapter 8 Working with the BASH Shell . . . . . . . . . . . . . . . . . . . . 281 Chapter 9 System Initialization and X Windows . . . . . . . . . . . . . . . 325 Chapter 10 Managing Linux Processes . . . . . . . . . . . . . . . . . . . . . . . 373 Chapter 11 Common Administrative Tasks. . . . . . . . . . . . . . . . . . . . 407 Chapter 12 Compression,System Backup,and Software Installation . 445 Chapter 13 Troubleshooting and Performance. . . . . . . . . . . . . . . . . . 489 Chapter 14 Network Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . 523 Chapter 15 Configuring Network Services and Security. . . . . . . . . . . 563 Appendix A Certification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597 Appendix B GNU Public License. . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 Appendix C Finding Linux Resources on the Internet. . . . . . . . . . . . . 613 Appendix D Answers to Chapter Review Questions . . . . . . . . . . . . . . 617 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655 This page intentionally left blank Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . xv Chapter 1 Introduction to Linux. . . . . . . . . . . . . . . . . . . . 1 Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 The Linux Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Versions of the Linux Operating System . . . . . . . . . . . . . . . . . 5 Identifying Kernel Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Licensing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Linux Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 The History of Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 UNIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 The Hacker Culture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Linux Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Common Uses of Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Internet Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 File and Print Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Application Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Supercomputers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Scientific/Engineering Workstation . . . . . . . . . . . . . . . . . . . . 34 Office Workstation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Chapter 2 Preparing for Linux Installation . . . . . . . . . . . 43 Understanding Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Central Processing Units (CPUs) . . . . . . . . . . . . . . . . . . . . . 44 Physical Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Disk Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Mainboards and Peripheral Components . . . . . . . . . . . . . . . . 52 viii Contents Video Adapter Cards and Monitors . . . . . . . . . . . . . . . . . . . . 55 Keyboards and Mice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Gathering Preinstallation Information . . . . . . . . . . . . . . . . . . . . 56 Gathering Hardware Information . . . . . . . . . . . . . . . . . . . . . 59 Gathering Software Information . . . . . . . . . . . . . . . . . . . . . . 62 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Chapter 3 Linux Installation and Usage . . . . . . . . . . . . . 73 Installing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Installation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Performing the Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Basic Linux Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Shells,Terminals,and the Kernel . . . . . . . . . . . . . . . . . . . . . . 95 Basic Shell Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Shell Metacharacters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Getting Command Help . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Shutting Down the Linux System . . . . . . . . . . . . . . . . . . . . 107 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Chapter 4 Exploring Linux Filesystems. . . . . . . . . . . . . 113 The Linux Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . 114 Changing Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Viewing Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . 118 File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Filenames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Listing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Wildcard Metacharacters . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Displaying the Contents of Text Files . . . . . . . . . . . . . . . . . . . . 127 Displaying the Contents of Binary Files . . . . . . . . . . . . . . . . . . 134 Searching for Text Within Files . . . . . . . . . . . . . . . . . . . . . . . . 135 Contents ix Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 The grep Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Editing Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 The vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Other Common Text Editors . . . . . . . . . . . . . . . . . . . . . . . 150 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Chapter 5 Linux Filesystem Management. . . . . . . . . . . 159 The Filesystem Hierarchy Standard . . . . . . . . . . . . . . . . . . . . . 160 Managing Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . 162 Finding Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Linking Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 File and Directory Permissions . . . . . . . . . . . . . . . . . . . . . . . . . 175 File and Directory Ownership . . . . . . . . . . . . . . . . . . . . . . . 176 Managing File and Directory Permissions . . . . . . . . . . . . . . 179 Default Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Special Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Chapter 6 Linux Filesystem Administration . . . . . . . . . 199 The /dev Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Filesystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 Filesystem Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 Mounting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 Working with Floppy Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Working with CD-ROMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Working with Hard Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Hard Disk Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 Working with Hard Disk Partitions . . . . . . . . . . . . . . . . . . . 221

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.