Comptialinuxcompletestudyguideexamslx0 101andlx0 102 110503102025 Phpapp01

6,407 views

Published on

Published in: Business, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,407
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
84
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Comptialinuxcompletestudyguideexamslx0 101andlx0 102 110503102025 Phpapp01

  1. 1. CompTIALinux+ Complete Study Guide
  2. 2. CompTIA Linux+ Complete Study Guide(Exams LX0-101 and LX0-102) Roderick W. Smith
  3. 3. Disclaimer: This eBook does not include ancillary media that was packaged with theprinted version of the book.Acquisitions Editor: Jeff KellumDevelopment Editors: Kim Wimpsett and Pete GaughanTechnical Editors: Emmett Dulaney and Evan BlomquistProduction Editor: Liz BrittenCopy Editor: Tiffany TaylorProduction Manager: Tim TateVice President and Executive Group Publisher: Richard SwadleyVice President and Publisher: Neil EddeAssistant Project Manager: Jenny SwisherAssociate Producer: Kit MaloneQuality Assurance: Angie DennyBook Designer: Judy Fung, Bill GibsonCompositor: Craig Johnson, Happenstance Type-O-RamaProofreader: Publication Services, Inc.Indexer: Ted LauxProject Coordinator, Cover: Lynsey StanfordCover Designer: Ryan SneedCopyright © 2010 by Wiley Publishing, Inc., Indianapolis, IndianaPublished simultaneously in CanadaISBN: 978-0-470-88845-2No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by anymeans, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sec-tions 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Pub-lisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for per-mission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken,NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warrantieswith respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties,including without limitation warranties of fitness for a particular purpose. No warranty may be created or extendedby sales or promotional materials. The advice and strategies contained herein may not be suitable for every situa-tion. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, orother professional services. If professional assistance is required, the services of a competent professional personshould be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact thatan organization or Web site is referred to in this work as a citation and/or a potential source of further informationdoes not mean that the author or the publisher endorses the information the organization or Web site may provideor recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work mayhave changed or disappeared between when this work was written and when it is read.For general information on our other products and services or to obtain technical support, please contact ourCustomer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317)572-4002.Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not beavailable in electronic books.Library of Congress Cataloging-in-Publication DataSmith, Roderick W. CompTIA Linux+ study guide : exams LX0-101 and LX0-102 / Roderick W. Smith.—1st ed. p. cm. ISBN-13: 978-0-470-88845-2 (pbk.) ISBN-10: 0-470-88845-8 (pbk.) ISBN 978-0-470-91307-9 (ebk) ISBN 978-0-470-91305-5 (ebk) ISBN 978-0-470-91306-2 (ebk) 1. Electronic data processing personnel—Certification. 2. Operating systems (Computers)—Examinations—Study guides. 3. Linux. I. Title. QA76.3.S47652 2010 005.4’32—dc22 2010016921TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of JohnWiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used withoutwritten permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is notassociated with any product or vendor mentioned in this book.10 9 8 7 6 5 4 3 2 1
  4. 4. Dear Reader,Thank you for choosing CompTIA Linux+ Complete Study Guide (Exams LX0-101 andLX0-102). This book is part of a family of premium-quality Sybex books, all of which arewritten by outstanding authors who combine practical experience with a gift for teaching.Sybex was founded in 1976. More than thirty years later, we’re still committed to producingconsistently exceptional books. With each of our titles we’re working hard to set a new stan-dard for the industry. From the paper we print on, to the authors we work with, our goal isto bring you the best books available.I hope you see all that reflected in these pages. I’d be very interested to hear your commentsand get your feedback on how we’re doing. Feel free to let me know what you think aboutthis or any other Sybex book by sending me an email at nedde@wiley.com, or if you thinkyou’ve found a technical error in this book, please visit http://sybex.custhelp.com. Cus-tomer feedback is critical to our efforts at Sybex. Best regards, Neil Edde Vice President and Publisher Sybex, an Imprint of Wiley
  5. 5. From one writer to another: Lola, keep writing your stories!
  6. 6. AcknowledgmentsAlthough this book bears my name as author, many other people contributed to its creation.Without their help, this book wouldn’t exist, or at best would exist in a lesser form. JeffKellum was the Acquisitions Editor, and so helped get the book started. Pete Gaughan, theDevelopment Editor, and Liz Britten, the Production Editor, oversaw the book as it progressedthrough all its stages. Emmett Dulaney was the Technical Editor, who checked the text fortechnical errors and omissions—but any mistakes that remain are my own. Tiffany Taylor,the copy editor, helped keep the text grammatical and understandable. The proofreader,Publications Services, Inc., checked the text for typos. I’d also like to thank Neil Salkind andothers at Studio B, who helped connect me with Wiley to write this book.About the AuthorRoderick W. Smith is a Linux consultant and author. He has written over a dozenbooks on Linux, FreeBSD, and computer networking, including the LPIC-1 StudyGuide and Linux Administrator Street Smarts (both from Sybex). He can be reachedat rodsmith@rodsbooks.com.
  7. 7. Contents at a GlanceIntroduction xxiAssessment Test xlviiPart I The CompTIA Linux+ LX0-101 Exam 1Chapter 1 Exploring Linux Command-Line Tools 3Chapter 2 Managing Software 45Chapter 3 Configuring Hardware 105Chapter 4 Managing Files 177Chapter 5 Booting Linux and Editing Files 225Part II The CompTIA Linux+ LX0-102 Exam 265Chapter 6 Configuring the X Window System, Localization, and Printing 267Chapter 7 Administering the System 329Chapter 8 Configuring Basic Networking 383Chapter 9 Writing Scripts, Configuring E-Mail, and Using Databases 427Chapter 10 Securing Your System 475Appendix About the Companion CD 519Glossary 523Index 551
  8. 8. ContentsIntroduction xxiAssessment Test xlviiPart I The CompTIA Linux+ LX0-101 Exam 1Chapter 1 Exploring Linux Command-Line Tools 3 Understanding Command-Line Basics 4 Exploring Your Linux Shell Options 4 Using a Shell 5 Exploring Shell Configuration 11 Using Environment Variables 12 Getting Help 13 Using Streams, Redirection, and Pipes 14 Exploring Types of Streams 14 Redirecting Input and Output 15 Piping Data Between Programs 16 Generating Command Lines 17 Processing Text Using Filters 18 File-Combining Commands 18 File-Transforming Commands 20 File-Formatting Commands 24 File-Viewing Commands 27 File-Summarizing Commands 29 Using Regular Expressions 31 Understanding Regular Expressions 31 Using grep 32 Using sed 34 Summary 36 Exam Essentials 37 Review Questions 38 Answers to Review Questions 42Chapter 2 Managing Software 45 Package Concepts 46 Using RPM 48 RPM Distributions and Conventions 48 The rpm Command Set 50 Extracting Data from RPMs 54 Using Yum 55 RPM and Yum Configuration Files 59 RPM Compared to Other Package Formats 60
  9. 9. xii Contents Using Debian Packages 61 Debian Distributions and Conventions 61 The dpkg Command Set 62 Using apt-cache 65 Using apt-get 65 Using dselect, aptitude, and Synaptic 69 Reconfiguring Packages 71 Debian Packages Compared to Other Package Formats 71 Configuring Debian Package Tools 72 Converting Between Package Formats 73 Package Dependencies and Conflicts 74 Real and Imagined Package Dependency Problems 75 Workarounds to Package Dependency Problems 76 Startup Script Problems 78 Managing Shared Libraries 78 Library Principles 79 Locating Library Files 80 Library Management Commands 83 Managing Processes 85 Understanding the Kernel: The First Process 85 Examining Process Lists 85 Understanding Foreground and Background Processes 91 Managing Process Priorities 92 Killing Processes 93 Summary 94 Exam Essentials 95 Review Questions 97 Answers to Review Questions 101Chapter 3 Configuring Hardware 105 Configuring the BIOS and Core Hardware 106 Understanding the Role of the BIOS 107 IRQs 109 I/O Addresses 112 DMA Addresses 113 Boot Disks and Geometry Settings 113 Coldplug and Hotplug Devices 115 Configuring Expansion Cards 117 Configuring PCI Cards 117 Learning about Kernel Modules 119 Loading Kernel Modules 120 Removing Kernel Modules 122
  10. 10. Contents xiii Configuring USB Devices 123 USB Basics 123 Linux USB Drivers 124 USB Manager Applications 125 Configuring Hard Disks 126 Configuring PATA Disks 126 Configuring SATA Disks 127 Configuring SCSI Disks 128 Configuring External Disks 129 Designing a Hard Disk Layout 130 Why Partition? 130 Understanding Partitioning Systems 131 An Alternative to Partitions: LVM 134 Mount Points 134 Common Partitions and Filesystem Layouts 135 Creating Partitions and Filesystems 136 Partitioning a Disk 137 Preparing a Partition for Use 141 Maintaining Filesystem Health 147 Tuning Filesystems 148 Maintaining a Journal 152 Checking Filesystems 153 Monitoring Disk Use 155 Mounting and Unmounting Filesystems 158 Temporarily Mounting or Unmounting Filesystems 158 Permanently Mounting Filesystems 164 Summary 167 Exam Essentials 167 Review Questions 169 Answers to Review Questions 173Chapter 4 Managing Files 177 Managing Files 178 File Naming and Wildcard Expansion Rules 178 File Commands 180 File Archiving Commands 185 Managing Links 191 Directory Commands 192 Managing File Ownership 193 Assessing File Ownership 194 Changing a File’s Owner 194 Changing a File’s Group 195
  11. 11. xiv Contents Controlling Access to Files 195 Understanding Permissions 195 Changing a File’s Mode 200 Setting the Default Mode and Group 203 Changing File Attributes 205 Managing Disk Quotas 206 Enabling Quota Support 206 Setting Quotas for Users 207 Locating Files 208 The FHS 208 Tools for Locating Files 212 Summary 216 Exam Essentials 216 Review Questions 218 Answers to Review Questions 222Chapter 5 Booting Linux and Editing Files 225 Installing Boot Loaders 226 Boot Loader Principles 227 Using LILO as the Boot Loader 228 Using GRUB as the Boot Loader 233 Understanding the Boot Process 238 Extracting Information about the Boot Process 238 Locating and Interpreting Boot Messages 239 The Boot Process 240 Dealing with Runlevels and the Initialization Process 241 Runlevel Functions 241 Identifying the Services in a Runlevel 243 Managing Runlevel Services 245 Checking Your Runlevel 247 Changing Runlevels on a Running System 247 Editing Files with Vi 250 Understanding Vi Modes 251 Exploring Basic Text-Editing Procedures 251 Saving Changes 254 Summary 255 Exam Essentials 255 Review Questions 257 Answers to Review Questions 261
  12. 12. Contents xvPART II The CompTIA Linux+ LX0-102 Exam 265Chapter 6 Configuring the X Window System, Localization, and Printing 267 Configuring Basic X Features 268 X Server Options for Linux 268 Methods of Configuring X 269 X Configuration Options 273 Obtaining X Display Information 281 Configuring X Fonts 282 Font Technologies and Formats 282 Configuring X Core Fonts 283 Configuring a Font Server 285 Configuring Xft Fonts 286 Managing GUI Logins 287 The X GUI Login System 288 Running an XDMCP Server 289 Configuring an XDMCP Server 290 Using X for Remote Access 291 X Client/Server Principles 292 Using Remote X Clients 292 X Accessibility 295 Keyboard and Mouse Accessibility Issues 295 Screen Display Settings 297 Using Additional Assistive Technologies 299 Configuring Localization and Internationalization 299 Setting Your Time Zone 300 Querying and Setting Your Locale 301 Configuring Printing 305 Conceptualizing the Linux Printing Architecture 305 Understanding PostScript and Ghostscript 306 Running a Printing System 308 Configuring CUPS 309 Monitoring and Controlling the Print Queue 315 Summary 318 Exam Essentials 318 Review Questions 320 Answers to Review Questions 325
  13. 13. xvi ContentsChapter 7 Administering the System 329 Managing Users and Groups 330 Understanding Users and Groups 330 Configuring User Accounts 333 Configuring Groups 344 Tuning User and System Environments 348 Using System Log Files 349 Understanding syslogd 349 Setting Logging Options 350 Manually Logging Data 352 Rotating Log Files 353 Review