Thông tin tài liệu
www.it-ebooks.info
www.it-ebooks.info
LPI LINUX
CERTIFICATION
IN A NUTSHELL
www.it-ebooks.info
www.it-ebooks.info
LPI LINUX
CERTIFICATION
IN A NUTSHELL
Third Edition
Adam Haeder, Stephen Addison Schneiter,
Bruno Gomes Pessanha, and James Stanger
Beijing
•
Cambridge
•
Farnham
•
Köln
•
Sebastopol
•
Taipei
•
Tokyo
www.it-ebooks.info
LPI Linux Certification in a Nutshell, Third Edition
by
Adam Haeder, Stephen Addison Schneiter, Bruno Gomes Pessanha, and James
Stanger
Copyright © 2010 Adam Haeder, Stephen Addison Schneiter, Bruno Gomes Pessanha, and
James Stanger. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online
editions are also available for most titles (http://my.safaribooksonline.com). For more infor-
mation, contact our corporate/institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Editor: Andy Oram
Production Editor: Adam Zaremba
Copyeditor: Genevieve d’Entremont
Proofreader: Jennifer Knight
Indexer: Jay Marchand
Cover Designer: Karen Montgomery
Interior Designer: David Futato
Illustrator: Robert Romano
Printing History:
May 2001: First Edition.
July 2006: Second Edition.
June 2010: Third Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trade-
marks
of O’Reilly Media, Inc. LPI Linux Certification in a Nutshell, the image of a bull, and
related trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and O’Reilly Media,
Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and
authors assume no responsibility for errors or omissions, or for damages resulting from the
use of the information contained herein.
TM
This book uses RepKover™, a durable and flexible lay-flat binding.
ISBN: 978-0-596-80487-9
[M]
1276182761
www.it-ebooks.info
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
1. LPI Exams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2. Exam 101 Study Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Exam Preparation 5
3. System Architecture (Topic 101.1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Objective 1: Determine and Configure Hardware Settings 7
BIOS 7
USB Topology 10
USB Controllers 10
USB Devices 11
USB Drivers 11
USB Hotplug 12
Reporting Your Hardware 12
Manipulating Modules 14
Device Management Definitions 20
4. Change Runlevels and Shut Down or Reboot System (Topics 101.2 and
101.3) .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Objective 2: Boot the System 21
Boot-time Kernel Parameters 21
Introduction to Kernel Module Configuration 22
Objective 3: Change Runlevels and Shut Down or Reboot System 24
Single-User Mode 25
Overview of the /etc Directory Tree and the init Process 26
v
www.it-ebooks.info
Setting the Default Runlevel 28
Determining Your System’s Runlevel 28
5. Linux Installation and Package Management (Topic 102) . . . . . . . . . . . . . 33
Objective 1: Design a Hard Disk Layout 34
System Considerations 34
Swap Space 37
General Guidelines 38
Objective 2: Install a Boot Manager 38
LILO 39
GRUB 41
Objective 3: Manage Shared Libraries 44
Shared Library Dependencies 44
Linking Shared Libraries 45
Objective 4: Use Debian Package Management 46
Debian Package Management Overview 46
Managing Debian Packages 47
Objective 5: Use Red Hat Package Manager (RPM) 52
RPM Overview 52
Running rpm 53
YUM Overview 58
6. GNU and Unix Commands (Topic 103) .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Objective 1: Work on the Command Line 64
The Interactive Shell 65
Command History and Editing 71
Manpages 75
Objective 2: Process Text Streams Using Filters 77
Objective 3: Perform Basic File Management 91
Filesystem Objects 91
File-Naming Wildcards (File Globbing) 100
Objective 4: Use Streams, Pipes, and Redirects 102
Standard I/O and Default File Descriptors 102
Pipes 103
Redirection 104
Using the tee Command 106
The xargs Command 106
Objective 5: Create, Monitor, and Kill Processes 107
Processes 107
Process Monitoring 108
Signaling Active Processes 115
Terminating Processes 117
Shell Job Control 118
Objective 6: Modify Process Execution Priorities 120
nice 120
Objective 7: Search Text Files Using Regular Expressions 123
vi | Table of Contents
www.it-ebooks.info
Regular Expression Syntax 123
Using grep 125
Using sed 127
Examples 130
Objective 8: Perform Basic File Editing Operations Using vi 135
Invoking vi 135
vi Basics 135
7. Devices, Linux Filesystems, and the Filesystem Hierarchy
Standard (Topic 104) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Objective 1: Create Partitions and Filesystems 140
Disk Drives Under Linux 140
Objective 2: Maintain the Integrity of Filesystems 151
Monitoring Free Disk Space and Inodes 151
Monitoring Disk Usage 153
Modifying a Filesystem 154
Checking and Repairing Filesystems 157
Objective 3: Control Filesystem Mounting and Unmounting 161
Managing the Filesystem Table 161
Mounting Filesystems 163
Unmounting Filesystems 166
Objective 4: Set and View Disk Quotas 167
Quota Limits 168
Quota Commands 169
Enabling Quotas 175
Objective 5: Manage File Permissions and Ownership 176
Linux Access Control 176
Setting Access Modes 181
Setting Up a Workgroup Directory 186
Objective 6: Create and Change Hard and Symbolic Links 187
Why Links? 188
Objective 7: Find System Files and Place Files in the Correct Location 192
Datatypes 193
The root Filesystem 194
Locating Files 200
8. Exam 101 Review Questions and Exercises .
. . . . . . . . . . . . . . . . . . . . . . . 205
System Architecture (Topic 101) 205
Review Questions 205
Exercises 206
Linux Installation and Package Management (Topic 102) 206
Review Questions 206
Exercises 207
GNU and Unix Commands (Topic 103) 208
Review Questions 208
Exercises 208
Table of Contents | vii
www.it-ebooks.info
Devices, Linux Filesystems, and the Filesystem Hierarchy Standard
(Topic 104) 211
Review Questions 211
Exercises 212
9. Exam 101 Practice Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Questions 215
Answers 226
10. Exam 101 Highlighter’s Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
System Architecture 229
Objective 101.1: Determine and Configure Hardware Settings 229
Objective 101.2: Boot the System 230
Objective 101.3: Change Runlevels and Shut Down or
Reboot System 230
Linux Installation and Package Management 230
Objective 102.1: Design Hard Disk Layout 230
Objective 102.2: Install a Boot Manager 231
Objective 102.3: Manage Shared Libraries 231
Objective 102.4: Use Debian Package Management 232
Objective 102.5: Use Red Hat Package Manager (RPM) 232
GNU and Unix Commands 232
Objective 103.1: Work on the Command Line 232
Objective 103.2: Process Text Streams Using Filters 233
Objective 103.3: Perform Basic File Management 235
Objective 103.4: Use Streams, Pipes, and Redirects 237
Objective 103.5: Create, Monitor, and Kill Processes 238
Objective 103.6: Modify Process Execution Priorities 239
Objective 103.7: Search Text Files Using Regular Expressions 239
Objective 103.8: Perform Basic File Editing Operations Using vi 241
Devices, Linux Filesystems, and the Filesystem Hierarchy Standard 243
Objective 104.1: Create Partitions and Filesystems 243
Objective 104.2: Maintain the Integrity of Filesystems 244
Objective 104.3: Control Filesystem Mounting and Unmounting 244
Objective 104.4: Set and View Disk Quotas 246
Objective 104.5: Manage File Permissions and Ownership 246
Objective 104.6: Create and Change Hard and Symbolic Links 248
Objective 104.7: Find System Files and Place Files in the Correct
Location 248
11. Exam 102 Overview .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
12. Exam 102 Study Guide .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Exam Preparation 253
viii | Table of Contents
www.it-ebooks.info
[...]... from the command line Linux Installation and Package Management 5 Objectives for this Topic include the basics of getting any LSB-compliant Linux distribution installed and installing applications Some of the basics include partitioning hard drives, installing your choice of boot managers, managing shared libraries, and using Debian’s dpkg and apt family of commands and RPM and Yellowdog Updater Modified... the day-to-day use of Linux If you have a basic working understanding of Linux administration, the material in this book will help fill gaps in your knowledge while at the same time preparing you for the LPI Exams, should you choose to take them This book should also prove to be a valuable introduction for new Linux users and administrators looking for a broad, detailed introduction to Linux Part of... operating system and network technologies These two programs are often cited as having popularized a certification market for products that had previously been highly specialized and relatively rare These programs have become so popular that a huge training and preparation industry has formed to service a constant stream of new certification candidates Certification programs, offered by vendors such as... two years of practical system administration experience The Level 1 candidate should be comfortable with Linux at the command line as well as capable of performing simple tasks, including system installation and troubleshooting Level 1 certification is required prior to obtaining Level 2 certification status All of LPI s exams are based on a published set of technical Objectives These technical Objectives... lsdev Syntax lsdev Description The lsdev command displays information about your system’s hardware, such as interrupt addresses and I/O ports The command is useful for obtaining information prior to installing devices that may have hardware addressing conflicts, such as ISA devices This command uses DMA files in /proc to also report I/O addresses and IRQ and DMA channel information There are no options... www.it-ebooks.info forms are equally difficult The scores are between 200 and 800, and passing score is 500 Audience for This Book The primary audience for this book is, of course, candidates seeking the LPIC certification These may range from administrators of other operating systems looking for a Linux certification to complement an MSCE certification to Unix administrators wary of a growing pool of Linux- certified... (#) and as the user prompt ($) under the Bourne or Bash shell On the Exam Provides information about areas you should focus on when studying for the exam xvi | Preface www.it-ebooks.info Indicates a tip, suggestion, or general note Indicates a warning or caution A final word about syntax: in many cases, the space between an option and its argument can be omitted In other cases, the spacing (or lack... Topic In addition, each part contains a practice exam (with answers), review questions and exercises, and a handy highlighter’s index that can help you review important details Book Chapters Each part of this book contains some combination of the following materials: Exam overview Here you find an introduction to the exam along with details about the format of the questions Preface | xv www.it-ebooks.info... 107.1: Manage User and Group Accounts and Related System Files Objective 107.2: Automate System Administration Tasks by Scheduling Jobs Objective 107.3: Localization and Internationalization Essential System Services Objective 108.1: Maintain System Time Objective 108.2: System Logging Objective 108.3: Mail Transfer Agent (MTA) Basics Objective 108.4: Manage Printers and Printing Networking Fundamentals... find, as well as your suggestions for future editions, by writing to: O’Reilly Media, Inc 1005 Gravenstein Highway North Sebastopol, CA 95472 800-998-9938 (in the United States or Canada) Preface | xvii www.it-ebooks.info 707-829-0515 (international or local) 707-829-0104 (fax) We have a web page for this book, where we list errata, examples, and any additional information You can access this page at: . Media, Inc. LPI Linux Certification in a Nutshell, the image of a bull, and
related trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations. Media,
Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation
Ngày đăng: 21/02/2014, 19:20
Xem thêm: Tài liệu LPI Linux Certification in a Nutshell, 3rd Edition pot