Chapter 1 Installing Linux 3 "Do I Know This Already?" Quiz 3Understanding Your Hardware 6 Peripheral Compatibility 7 Enumerating Your Peripherals 7 The Proc Filesystem 8 Friends of procfs 10 Dealing with Integrated Peripherals 10Laying Out the Hard Drive 11 Partitions and Devices 11 The Root Filesystem 12 Logical Volume Manager (LVM) 14 Commonly Used Mounts 16 Swap Files 16Working with Boot Managers 17 GRUB Legacy 17 GRUB2 18 Installing GRUB2 18 Using the GRUB2 Command Line 19 Configuring GRUB2 20Summary 21Exam Preparation Tasks 22 Review All Key Topics 22 Define Key Terms 22 Review Questions 23 Chapter 2 Boot Process and Runlevels 27 "Do I Know This Already?" Quiz 27The Linux Boot Process 30 What Is the Boot Process? 30 Boot Loaders 30 Common Commands at Boot Time 32Boot Sequence from BIOS to Fully Running System 33 SysVinit 33systemd 34 Units in systemd 36 systemd Targets and Runlevels 37 Wants and Requires 38Booting with systemd 38 Upstart 39 Managing System Runlevels 40 Determining the Default Runlevel 40 Setting the Default Runlevels 41 Changing Runlevels 41Shut Down and Reboot from the Command Line 42 Alerting Users 43Properly Terminating Processes 44 kill and killall 44 Reloading or "Hanging Up" Processes 45Logging Boot Events 45Exam Preparation Tasks 46 Review All Key Topics 46 Define Key Terms 47 Review Questions 47 Chapter 3 Package Install and Management 51 "Do I Know This Already?" Quiz 51Software in a Linux System 54 Shared Libraries 54 Working with Shared Libraries 56 Determining Required Libraries 56 Looking for Libraries in Other Places 57Debian Package Management 58 Managing Local Debian Packages 58 Installing Packages with dpkg 59 Removing Packages 60 Dependency Issues 60 Querying Packages 61 Reconfiguring Packages 63 Using Remote Repositories 64 Installing Remote Packages 64 Working with the Cache 65 Upgrading the System 66 Removing Packages 67 Graphical Managers 67RPM and YUM Package Management 68 The RPM Database 68 RPM Package Files 69 Package Name Conventions 69 The rpm Command 70 Validation of Packages 71 Installation of Packages 72 Additional Installation Options 72 Verifying a Package''s Integrity 73 Freshening Versus Upgrading 74 Removing Packages 75 Other Removal Options 76 Querying Packages 77 Package Management with YUM 80 Installing Packages 80 Fetching Updates 83 Finding Packages to Install 83 Configuring Yum 84Summary 86Exam Preparation Tasks 86 Review All Key Topics 86 Define Key Terms 87 Review Questions 88 Chapter 4 Basic Command Line Usage 91 "Do I Know This Already?" Quiz 91What Is a Shell? 93Global and User Settings 94 Sourcing Versus Executing 94 Executing a Script 94 Sourcing a Script 94 A Login Shell Session 95 A Non-Login Shell Session 96Using the Command Line 97 There Are Commands and, Well, Commands 97 Structuring Commands 98 Breaking Long Command Lines 98 Command Completion 99 Special Characters in the Shell 99Controlling Command Execution 100 Possible Exit Statuses 100Environment Variables and Settings 101 The Path 102 Getting $HOME 102 bash''s History Feature 103 Important History Variables 104Setting Options in bash 104 Important bash Options 104Exam Preparation Tasks 105 Review All Key Topics 105 Define Key Terms 106 Review Questions 106 Chapter 5 File Management 109 "Do I Know This Already?" Quiz 109Filesystem Overview 112 What Belongs Where 112 The Root of the System 112 Classifying Data 113 Where Programs Live 114File Management Commands 114 Tips for Working with Linux Files 115 Basic Navigation 115 Advanced Navigation 116 Listing Files and Directories 116 Determining File Types 118 Touching Files 120 Copying Files and Directories 121 Moving Objects 123 Transforming Data Formats 126 Creating and Removing Directories 127 Removing Objects 128Where Are Those Files? 128 Locating Files with Locate 128 Finding Files 130 Which Command Will Run? 132 Researching a Command 132 Linking Files 133 Symbolic Links 134 Hard Links 135Backup Commands 136 Using tar 137 Taking Pity on the Unarchiver 139 Useful Creation Options 140 Listing Archive Files 140 Using cpio 141 Compression Utilities 143Summary 144Exam Preparation Tasks 144 Review All Key Topics 144 Define Key Terms 145 Review Questions 146 Chapter 6 Text Processing/Advanced Command Line 151 "Do I Know This Already?" Quiz 151Working with Input/Output Streams 154 Standard In 154 Standard Out 154 Standard Error 155 Redirection of Streams 1569780789754554_book.indb vii 11/13/15 5:04 PMviii CompTIA Linux+ / LPIC-1 Cert Guide Redirecting Standard Input 157 Redirecting Standard Output 157 Redirecting Standard Error 157 Redirection Redux 158Pipes 159Executing Multiple Commands 161 Multiple Command Operators 161 Command Substitution 162Splitting and Processing Streams 163 Splitting Streams with the tee Command 163 Processing Output with the xargs Command 163Filters 165 Sorting 165 Numbering Lines 166 Tabs 167 Cutting Columns 168 Pasting and Joining 168 Unique Data 169 Heads or Tails? 170 Splitting Files 172 When cat Goes Backward 173 Viewing Binary Files Safely 173Formatting Commands 174 Translating Files 175 He sed, She sed 176 Getting a grep 178 Examples of Using grep 179 Expanding grep with egrep and fgrep 184Using Regular Expressions and grep 185Summary 188Exam Preparation Tasks 188 Review All Key Topics 188 Define Key Terms 189 Review Questions 189 Chapter 7 Process Management 193 "Do I Know This Already?" Quiz 193Managing Processes 196 Viewing Processes 196 What''s the Diff? 197 The free Command 198 Blocks and Buffers 199 Pages, Slabs, and Caches 199 Interpreting Displayed Information from free 200 System Uptime 201Sending Signals to Processes 202 Killing Processes by PID 203 Killing Processes by Other Criteria 204Job Control 205Managing Process Priorities 207Leaving Programs Running after Logout 209 Using screen for Multiple Console Sessions 210 Taking Control-a of screen Windows 211 Creating Windows in screen 211 Detaching and Reattaching from screen 212 Locking Your Console via screen 213Summary 213Exam Preparation Tasks 214 Review All Key Topics 214 Define Key Terms 215 Review Questions 215 Chapter 8 Editing Text 219 "Do I Know This Already?" Quiz 219A Tour of the vim Editor 222 The Message Line 222 Editing in vi 222 Opening a File for Editing 223 Navigating Within a File 224 Force Multipliers 225 Undo Operations 225 Saving Files 226 Quitting vi 226 Changing or Replacing Text 227 Deleting Text and Lines 227 The Cut, Copy, and Paste Commands 228 Named and Unnamed Buffers 229 Searching in vi 230 Searching and Replacing 231 Regular Expression Searches 231 Options in vi 232 Advanced vi 234 Running External Commands in vi 234 Joining Lines 234 Split Windows 234Exam Preparation Tasks 236 Review All Key Topics 236 Review Questions 236 Chapter 9 Partitions and Filesystems 241 "Do I Know This Already?" Quiz 241Creating Partitions 244 Partitions 244 Swap 245 Disk Partitioning Tools 245 fdisk 246 gdisk 250 Parted 254Filesystems 255 Filesystem Types 255 Superblocks 256 Inodes and Files 256 Inodes and Directories 258 Inodes and Disk Space 259 Creating Filesystems 260 The mkfs Command 260 Filesystem Creation Options 261 Advanced Filesystem Commands 263 Filesystem Checker 263 Tuning Filesystems 266 XFS Commands 267 Debugging Filesystems 268 Mounting and Unmounting 269 The Filesystem Table 270 Manually Mounting Filesystems 272 Automatically Mounting Filesystems 273 Unmounting Filesystems 273Space Utilization 274 Using du 274 Using df 275 Using Disk Quotas 277 Quota Commands and Files 277 Quota Concepts 277 Configuring Quotas 278 Hard and Soft Limits 280 Setting the Grace Period 281 Getting Quota Information 281Summary 282Exam Preparation Tasks 282 Review All Key Topics 282 Define Key Terms 284 Review Questions 284 Chapter 10 Permissions and Ownership 289 "Do I Know This Already?" Quiz 289Working with Permissions 292 Permission Trio Bits 292Manipulating Permissions 294 Numeric Mode 294 Symbolic Mode 296Special File Permissions 297 Special Bit Permissions 298 Setting the SUID Bit on Files 299 Setting the SGID Bit on Files 300 Setting the SGID Bit on Directories 301 Setting the Sticky Bit 302Finding Files by Permission 302Default Permissions 303Changing User Ownership 305Changing Group Ownership 306Summary 307Exam Preparation Tasks 307 Review All Key Topics 307 Define Key Terms 308 Review Questions 308 Chapter 11 Customizing Shell Environments 311 "Do I Know This Already?" Quiz 311Working Within the Shell 314 Environment Variables 315 Variable Scope 316 Setting Variables from a Child 316 Setting and Unsetting Variables 317 Subshells 318 The env Wrapper 319Extending the Shell 320 Global and User Settings 320 A Login Shell Session 321 A Non-Login Shell Session 321 The PATH 322 Aliases and Functions 323 Functions 323 PS1 324 Adding More Dynamic Content 325 PS2 326 Creating New Users (skeleton) 326Localization and Internationalization 327 Time Zones 327 Displaying Time 328 Setting Time Zones 328 Character Encoding 329 Representing Locales 330 Fallback Locales 331 Contents of a Locale 331 How Linux Uses the Locale 332 Converting Files Between Encodings 334Exam Preparation Tasks 334 Review All Key Topics 334 Define Key Terms 335 Review Questions 335 Chapter 12 Shell Scripting 339 "Do I Know This Already?" Quiz 339Basics of Scripting 342 Running a Script 343 Good Design 343 Managing Your Scripts 344Shell Script Commands 344 Use the Output of Another Command 344 Do Math 345 Conditions 346 Testing Files 348 An Easier Test Syntax 348 Testing Strings 349 Testing Integers 350 Combining Multiple Tests 351 Case Statements 351 Loops 353 For Loops 353 Sequences 354 While Loops 355 Reading from stdin in a Loop 356 Interacting with Other Programs 356 Returning an Error Code 357 Accepting Arguments 357 Transferring Control to Another Program 358Exam Preparation Tasks 359 Review All Key Topics 359 Define Key Terms 360 Review Questions 360 Chapter 13 Basic SQL Management 365 "Do I Know Th.
CompTIA Linux+ - LPIC-1 : Learn, Prepare, and Practice for Exam Success