32,99 €
Provides a solid foundation for those considering a career in IT--covers the objectives of the new Linux Essentials Exam 010-160 v1.6 Linux is a secure, reliable, open source alternative to costly operating systems such as Microsoft Windows. As large organizations worldwide continue to add Linux servers, the need for IT professionals skilled in Linux continues to grow. The LPI Linux Essentials Study Guide is a valuable resource for anyone preparing to take the new Linux Essentials Exam--the entry-level certification from The Linux Professional Institute (LPI) which validates knowledge of Linux concepts and applications. Written by recognized experts on Linux and open source technologies, this accessible, user-friendly guide covers desktop skills, the command line, directories and files, networks, scripting, security, users and permissions, and much more. Clear, concise chapters provide numerous hands-on tutorials, real-world examples, color illustrations, and practical end-of-chapter exercises and review questions. An ideal introduction for those new to Linux or considering a career in IT, this guide helps readers: * Learn the operation and components of Linux desktops and servers * Understand open source software, licensing, and applications * Configure networks, security, cloud services, storage, and devices * Create users and groups and set permissions and ownership * Use the command line and build automation scripts LPI Linux Essentials Study Guide: Exam 010 v1.6 is perfect for anyone beginning a career in IT, newcomers to Linux, students in computer courses, and system administrators working with other operating systems wanting to learn more about Linux and other open source solutions.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 687
Veröffentlichungsjahr: 2020
Christine Bresnahan
Richard Blum
Copyright © 2020 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-119-65769-9ISBN: 978-1-119-65770-5 (ebk.)ISBN: 978-1-119-65771-2 (ebk.)
Manufactured in the United States of America
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission 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 warranties with 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 extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have 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 our Customer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2019955498
TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Linux is a registered trademark of Linus Torvalds. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
Dedicated to the loving memory of Kevin E. Ryan, our longtime technical editor and friend. Kevin's gentle correction and guidance helped make our work better. His contributions will be missed.
“As iron sharpens iron, so one man sharpens another.” Proverbs 27:17 (NIV)
First, all glory and praise go to God, who through His Son, Jesus Christ, makes all things possible, and gives us the gift of eternal life.
Many thanks go to the fantastic team of people at Sybex for their outstanding work on this project. Thanks to Devon Lewis, the acquisitions editor, for offering us the opportunity to work on this book. Also thanks to Stephanie Barton, the development editor, for keeping things on track and making the book more presentable. Thanks, Steph, for all your hard work and diligence. The technical editor, Jason Eckert, did a wonderful job of double-checking all the work in the book in addition to making suggestions to improve the content. We would also like to thank Carole Jelen at Waterside Productions, Inc., for arranging this opportunity for us and for helping us out in our writing careers.
Christine would particularly like to thank her husband, Timothy, for his encouragement, patience, and willingness to listen, even when he has no idea what she is talking about.
Rich would particularly like to thank his wife, Barbara, for enduring his grouchy attitude during this project and helping to keep up his spirits with baked goods.
Christine Bresnahan started working with computers more than 30 years ago in the IT industry as a systems administrator. Christine is an adjunct professor at Ivy Tech Community College, where she teaches Linux certification and Python programming classes. She also writes books and produces instructional resources for the classroom.
Richard Blum has also worked in the IT industry for more than 30 years as both a system and network administrator, and he has published numerous Linux and open source books. Rich is an online instructor for Linux and web programming courses that are used by colleges and universities across the United States. When he is not being a computer nerd, Rich enjoys spending time with his wife, Barbara, and his two daughters, Katie and Jessica.
Cover
Acknowledgments
About the Authors
Introduction
Assessment Test
Answers to Assessment Test
Chapter 1 Selecting an Operating System
What Is an OS?
Investigating User Interfaces
Where Does Linux Fit in the OS World?
What Is a Distribution?
Embedded Linux Systems
Linux in the Cloud
Summary
Exam Essentials
Review Questions
Chapter 2 Understanding Software Licensing
Investigating Software Licenses
Looking at the Free Software Foundation
Looking at the Open Source Initiative
Looking at the Creative Commons
Using Open Source Licenses
Summary
Exam Essentials
Review Questions
Chapter 3 Investigating Linux’s Principles and Philosophy
Linux Through the Ages
Using Open Source Software
Understanding OS Roles
Summary
Exam Essentials
Review Questions
Chapter 4 Using Common Linux Programs
Using a Linux Desktop Environment
Working with Productivity Software
Using Server Programs
Managing Programming Languages
Handling Software Packages
Summary
Exam Essentials
Review Questions
Chapter 5 Getting to Know the Command Line
Starting a Command Line
Running Programs
Using Shell Features
Getting Help Using Man Pages
Review Questions
Chapter 6 Managing Hardware
Learning About Your CPU
Identifying Motherboard Capabilities
Sizing Your Power Supply
Understanding Disk Issues
Managing Displays
Handling USB Devices
Managing Drivers
Summary
Exam Essentials
Review Questions
Chapter 7 Managing Files
Understanding Where Things Go
Exploring Files and Directories
Manipulating Files
Manipulating Directories
Summary
Exam Essentials
Review Questions
Chapter 8 Searching, Extracting, and Archiving Data
Using Regular Expressions
Searching For and Extracting Data
Redirecting Input and Output
Archiving Data
Summary
Exam Essentials
Review Questions
Chapter 9 Exploring Processes and Process Data
Understanding Package Management
Understanding the Process Hierarchy
Identifying Running Processes
Using Log Files
Summary
Exam Essentials
Review Questions
Chapter 10 Editing Files
Understanding the Role of Text Files
Choosing an Editor
Editing Files with
nano
Editing Files with
vi
Summary
Exam Essentials
Review Questions
Chapter 11 Creating Scripts
Beginning a Shell Script
Using Commands
Using Arguments
Using Variables
Using Conditional Expressions
Using Loops
Using Functions
Setting the Script’s Exit Value
Summary
Exam Essentials
Review Questions
Chapter 12 Understanding Basic Security
Understanding Accounts
Using Account Tools
Working as
root
Summary
Exam Essentials
Review Questions
Chapter 13 Creating Users and Groups
Creating New Accounts
Modifying Accounts
Deleting Accounts
Managing Groups
Summary
Exam Essentials
Review Questions
Chapter 14 Setting Ownership and Permissions
Setting Ownership
Setting Permissions
Using Special Permission Bits and File Features
Summary
Exam Essentials
Review Questions
Chapter 15 Managing Network Connections
Configuring Network Features
Basic Network Troubleshooting
Advanced Network Troubleshooting
Summary
Exam Essentials
Review Questions
Appendix A Answers to Review Questions
Chapter 1: Selecting an Operating System
Chapter 2: Understanding Software Licensing
Chapter 3: Investigating Linux’s Principles and Philosophy
Chapter 4: Using Common Linux Programs
Chapter 5: Getting to Know the Command Line
Chapter 6: Managing Hardware
Chapter 7: Managing Files
Chapter 8: Searching, Extracting, and Archiving Data
Chapter 9: Exploring Processes and Process Data
Chapter 10: Editing Files
Chapter 11: Creating Scripts
Chapter 12: Understanding Basic Security
Chapter 13: Creating Users and Groups
Chapter 14: Setting Ownership and Permissions
Chapter 15: Managing Network Connections
Appendix B Setting Up a Linux Environment
Index
End User License Agreement
Chapter 1
Table 1.1
Chapter 4
Table 4.1
Chapter 5
Table 5.1
Table 5.2
Table 5.3
Table 5.4
Table 5.5
Chapter 7
Table 7.1
Table 7.2
Table 7.3
Table 7.4
Chapter 8
Table 8.1
Table 8.2
Table 8.3
Table 8.4
Table 8.5
Table 8.6
Table 8.7
Table 8.8
Table 8.9
Table 8.10
Table 8.11
Chapter 9
Table 9.1
Table 9.2
Chapter 12
Table 12.1
Chapter 13
Table 13.1
Table 13.2
Table 13.3
Chapter 14
Table 14.1
Table 14.2
Table 14.3
Chapter 15
Table 15.1
Chapter 1
Figure 1.1 Some text-mode programs take over the entire display.
Figure 1.2 Graphical login screens on Linux are similar to those for Windows or macOS.
Figure 1.3 Linux desktop environments provide the types of GUI controls that most users ex...
Figure 1.4 Cloud computing methods
Figure 1.5 The IaaS cloud model
Figure 1.6 The PaaS cloud model
Figure 1.7 The SaaS cloud model
Chapter 4
Figure 4.1 A typical Linux desktop login screen where you choose the user account
Figure 4.2 GUI login managers usually provide a selection of desktop environments from whi...
Figure 4.3 With panels you can launch popular programs in GNOME and some other desktop env...
Figure 4.4 Cinnamon’s desktop interface provides launch methods similar to those available...
Figure 4.5 GNOME Files provides a view of your files similar to that in other OSs’ file ma...
Figure 4.6 You can star folders to enable quick access to directories that interest you.
Figure 4.7 GNOME Files lets you associate document types with applications.
Chapter 5
Figure 5.1 Reaching a terminal via a menu on Cinnamon
Figure 5.2 Reaching a terminal via a search on GNOME
Figure 5.3 GNOME’s Terminal program is typical and is dominated by a textual display are...
Figure 5.4 Reaching and logging into a VT
Figure 5.5 Launching Firefox in the background to allow use of both the web browser and ...
Figure 5.6 The formatting of man pages helps you locate information quickly.
Chapter 6
Figure 6.1 Disk partitions are often visualized as boxes within a hard disk.
Figure 6.2 GParted, like other GUI disk partitioning tools, provides a graphical represe...
Figure 6.3 Linux file managers enable you to unmount removable media.
Figure 6.4 Most desktop environments provide GUI tools to help you set your display’s re...
Chapter 7
Figure 7.1 In Linux, all files are referred to relative to a single root (
/
) directory.
Chapter 8
Figure 8.1 Sorting a numeric data list
Figure 8.2 Using
cat
to display and concatenate files
Figure 8.3 Creating an archive tarball
Chapter 9
Figure 9.1 Most Linux distributions tell you when updates are available for your software....
Figure 9.2 Synaptic enables you to search for, select, install, and uninstall software on ...
Figure 9.3 Linux processes are arranged in a hierarchical tree.
Figure 9.4 The
top
command shows system summary information and information about the mo...
Chapter 10
Figure 10.1 The
nano
editor enables you to edit a text file in text mode.
Figure 10.2 The
nano
editor launched with no filename provided.
Figure 10.3 The last line of a
vi
display is a status line that shows messages from the p...
Chapter 12
Figure 12.1 Locating the Users and Groups account tool on Linux Mint
Figure 12.2 The Users and Groups account tool provides minimal account information.
Figure 12.3 Administrative tools in the GUI ask for a password when administrator privilege...
Chapter 13
Figure 13.1 The Linux Mint User and Groups Administration utility provides many options for...
Figure 13.2 You can enter all the basic account information using this dialog.
Figure 13.3 Set the user account’s password using the Change Password dialog.
Figure 13.4 The User and Groups Administration utility enables you to edit a few account pr...
Figure 13.5 The Users utility enables users to change their own passwords.
Figure 13.6 When you delete an account with a GUI utility, you are typically asked to confi...
Figure 13.7 The User and Groups Administration utility enables you to manage groups as well...
Figure 13.8 You can add users to a group after creating the group.
Chapter 14
Figure 14.1 Linux file managers give you access to the file’s ownership and permission me...
Figure 14.2 A symbolic representation of file permissions is broken into four parts.
Chapter 15
Figure 15.1: Network Manager showing a wireless network connection
Figure 15.2: The Network Connections dialog
Figure 15.3: The Network Manager
nmtui
command-line tool
Cover
Table of Contents
Introduction
i
ii
iii
v
vii
xix
xx
xxi
xxii
xxiii
xxiv
xxv
xxvi
xxvii
xxviii
xxix
xxx
xxxi
xxxii
xxxiii
xxxiv
xxxv
xxxvi
xxxvii
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
This book you hold in your hands provides a solid introduction to the Linux operating system. As its title suggests, it will give you the essential knowledge to begin using and managing this powerful operating system (OS), which is an important one in today’s computing world.
The Linux Professional Institute, or LPI (lpi.org), offers a series of Linux certifications. These certifications aim to provide proof of skill levels for employers; if you’ve passed a particular certification, you should be competent to perform certain tasks on Linux computers. The LPI exams include Linux Essentials, LPIC-1, LPIC-2, and the LPIC-3 series. As the name implies, the Linux Essentials exam is the lowest level of the four exams, covering the most basic tasks of using and administering a Linux computer.
The purpose of this book is to help you pass the Linux Essentials exam, updated in 2019 to version 1.6. The Linux Essentials exam is meant to certify that you:
Understand the open source industry
Have knowledge of the most popular open source applications
Understand the major components of Linux
Can work at the Linux command line
Have basic knowledge of security and administration-related concepts
Know where to go for help
With the growing popularity of Linux (and the increase in Linux-related jobs) comes hype. With all the hype that surrounds Linux it’s become hard for employers to distinguish between employees who are competent Linux users and those who just know the buzzwords. This is where the Linux Essentials certification comes in.
With a Linux Essentials certification, you will establish yourself as a Linux user who is familiar with the Linux platform and its applications and who can use any type of Linux system. LPI has created the Linux Essentials exams as a way for employers to have confidence in knowing their employees who pass the exam will have the skills necessary to get the job done.
The certification is available to anyone who passes the LPI Linux Essentials required exam. The current version of the exam is version 1.6 and is denoted as 010-160.
The exam is administered by Pearson VUE. The exam can be taken at any Pearson VUE testing center. If you pass, you will get a certificate in the mail saying that you have passed.
To register for the exam with Pearson VUE register online at home.pearsonvue .com. You’ll have to provide your name, mailing address, phone number, employer, when and where you want to take the test (which testing center), and your credit card number (arrangement for payment must be made at the time of registration).
You may have been assigned this book for a class that you’re taking, but if not, it can still have value for self-study or as a supplement to other resources. If you’re new to Linux, this book covers the material that you will need to learn the OS from the beginning. You can pick up this book and learn from it even if you’ve never used Linux before. If you’re already familiar with Linux, you’ll have a leg up on many of the topics described in these pages.
This book is written with the assumption that you know at least a little about computers generally, such as how to use a keyboard, how to insert a disc into an optical drive, and so on. Chances are that you have used computers in a substantial way in the past—perhaps even Linux, as an ordinary user—or maybe you have used Windows or macOS. We do not assume that you have knowledge of how to use a Linux system.
It will also help to have a Linux system available to follow along with. Each chapter contains a simple exercise that will walk you through the basic concepts presented in the chapter. This provides the crucial hands-on experience that you’ll need, both to pass the exam and to do well in the Linux world.
Although the LPI Linux Essentials exam is Linux distribution neutral, it’s impossible to write exercises that work in all Linux distributions. That said, the exercises in this book assume you have a learning environment similar to the one described in Appendix B “Setting up a Linux Environment.”
This book consists of 15 chapters, two appendixes, plus this introduction and the assessment test after the introduction. The chapters are organized as follows:
Chapter 1
, “Selecting an Operating System,” provides a birds-eye view of the world of operating systems. The chapter will help you understand exactly what Linux is and the situations in which you might want to use it.
Chapter 2
, “Understanding Software Licensing,” describes copyright law and the licenses that both Linux and non-Linux OSs use to expand or restrict users’ rights to use and copy software.
Chapter 3
, “Investigating Linux’s Principles and Philosophy,” covers Linux’s history and the ways in which Linux, and other OSs, are commonly used.
Chapter 4
, “Using Common Linux Programs,” looks at the major categories of Linux software, and it provides pointers to some of the most popular Linux programs.
Chapter 5
, “Getting to Know the Command Line,” tackles using typed commands to control Linux. Although many new users find this topic intimidating, command-line control of Linux is important.
Chapter 6
, “Managing Hardware,” provides advice on how to select and use hardware in Linux. Specific topics range from the central processing unit (CPU) to device drivers.
Chapter 7
, “Managing Files,” describes how to move, rename, delete, and edit files. Directories are just a special type of file, so they are covered here as well.
Chapter 8
, “Searching, Extracting, and Archiving Data,” summarizes the tools that you can use to find data on your computer, as well as how you can manipulate data archive files for data transport and backup purposes.
Chapter 9
, “Exploring Processes and Process Data,” describes how to install programs in Linux and how to adjust the priority of running programs or terminate selected programs.
Chapter 10
, “Editing Files,” introduces the topic of editing text files. This includes the basic features of the
nano
and
vi
text-mode text editors, as well as some common configuration file and formatted text file conventions.
Chapter 11
, “Creating Scripts,” describes how to create simple scripts, which are programs that can run other programs. You can use scripts to help automate otherwise tedious manual tasks, thus improving your productivity.
Chapter 12
, “Understanding Basic Security,” introduces the concepts that are critical to understanding Linux’s multiuser nature. It also covers super user privileges, which Linux uses for most administrative tasks.
Chapter 13
, “Creating Users and Groups,” covers the software and procedures you use to create, modify, and delete accounts and groups, which define who may use the computer.
Chapter 14
, “Setting Ownership and Permissions,” describes how to control which users may access files and in what ways they may do so. In conjunction with users and groups, ownership and permissions control your computer’s security.
Chapter 15
, “Managing Network Connections,” covers the critical topic of telling Linux how to use a network, including testing the connection and some basic network security measures.
Each chapter begins with a list of the exam objectives that are covered in that chapter. The book doesn’t cover the objectives in order. Thus, you shouldn’t be alarmed at some of the odd ordering of the objectives within the book. At the end of each chapter, you’ll find a couple of elements you can use to prepare for the exam:
Exam Essentials This section summarizes important information that was covered in the chapter. You should be able to perform each of the tasks or convey the information requested.
Review Questions Each chapter concludes with 10 review questions. You should answer these questions and check your answers against the ones provided in Appendix A. If you can’t answer at least 80 percent of these questions correctly, go back and review the chapter, or at least those sections that seem to be giving you difficulty.
The review questions, assessment test, and other testing elements included in this book are not derived from the actual exam questions, so don’t memorize the answers to these questions and assume that doing so will enable you to pass the exam. You should learn the underlying topic, as described in the text of the book. This will let you answer the questions provided with this book and pass the exam. Learning the underlying topic is also the approach that will serve you best in the workplace—the ultimate goal of a certification.
To get the most out of this book, you should read each chapter from start to finish and then check your memory and understanding with the chapter-end elements. Even if you’re already familiar with a topic, you should skim the chapter; Linux is complex enough that there are often multiple ways to accomplish a task, so you may learn something even if you’re already competent in an area.
Readers of this book can access a website that contains several additional study tools, including the following:
Readers can access these tools by visiting wiley.com/go/sybextestprep.
Sample Tests All the questions in this book are there, including the assessment test at the end of this introduction and the questions from the review sections at the end of each chapter. In addition, there are two bonus exams.
Electronic Flashcards The additional study tools include questions in flashcard format (a question followed by a single correct answer). You can use these flashcards to review your knowledge of the exam objectives.
Glossary of Terms as a PDF File In addition, there is a searchable glossary in PDF format, which can be read on all platforms that support PDF.
This book uses certain typographic styles in order to help you quickly identify important information and to avoid confusion over the meaning of words such as onscreen prompts. In particular, look for the following styles:
Italicized text
indicates key terms that are described at length for the first time in a chapter. (Italics are also used for emphasis.)
A monospaced font
indicates the contents of configuration files, messages displayed at a text-mode Linux shell prompt, filenames, text-mode command names, and Internet URLs.
Italicized monospaced text
indicates a variable—information that differs from one system or command run to another, such as the name of a client computer or a process ID number.
Bold monospaced text
is information that you’re to type into the computer, usually at a Linux shell prompt. This text can also be italicized to indicate that you should substitute an appropriate value for your system. (When isolated on their own lines, commands are preceded by non-bold monospaced
$
or
#
command prompts, denoting regular user or system administrator use, respectively.)
In addition to these text conventions, which can apply to individual words or entire paragraphs, a few conventions highlight segments of text:
A note indicates information that’s useful or interesting but that’s somewhat peripheral to the main text. A note might be relevant to a small number of networks, for instance, or it may refer to an outdated feature.
A tip provides information that can save you time or frustration and that may not be entirely obvious. A tip might describe how to get around a limitation or how to use a feature to perform an unusual task.
Warnings describe potential pitfalls or dangers. If you fail to heed a warning, you may end up spending a lot of time recovering from a bug, or you may even end up restoring your entire system from scratch.
An exercise is a procedure you should try on your own computer to help you learn about the material in the chapter. Don’t limit yourself to the procedures described in the exercises, though! Try other commands and procedures to really learn about Linux.
A real-world scenario is a type of sidebar that describes a task or example that’s particularly grounded in the real world. This may be a situation I or somebody I know has encountered, or it may be advice on how to work around problems that are common in real, working Linux environments.
Behind every computer industry exam you can be sure to find exam objectives—the broad topics in which exam developers want to ensure your competency. The official exam objectives are listed here. (They’re also printed at the start of the chapters in which they’re covered.)
Exam objectives are subject to change at any time without prior notice and at LPI’s sole discretion. Please visit LPI’s website (lpi.org) for the most current listing of exam objectives.
The following are the areas in which you must be proficient in order to pass the Linux Essentials 010-160 exam. This exam is broken into five main topics, each of which has three to eight objectives. Each objective has an associated weight, which reflects its importance to the exam as a whole. Refer to the LPI website to view the weights associated with each objective. The five main topics are as follows:
Subject Area
1 The Linux Community and a Career in Open Source
2 Finding Your Way on a Linux System
3 The Power of the Command Line
4 The Linux Operating System
5 Security and File Permissions
Knowledge of Linux development and major distributions
Key knowledge areas:
Distributions:
Embedded Systems
Linux in the Cloud
Awareness of major applications as well as their uses and development
Key knowledge areas:
Desktop applications
Server applications
Development languages
Package management tools and repositories
Open communities and licensing Open Source Software for business
Key knowledge areas:
Open source philosophy
Open source licensing
Free Software Foundation (FSF), Open Source Initiative (OSI)
Basic Information and Communication Technology (ICT) skills and working in Linux
Key knowledge areas:
Desktop skills
Getting to the command line
Industry uses of Linux, cloud computing and virtualization
Basics of using the Linux command line
Key knowledge areas:
Basic shell
Command line syntax
Variables
Quoting
Running help commands and navigation of the various help systems
Key knowledge areas:
Man pages
Info pages
Navigation of home and system directories and listing files in various locations
Key knowledge areas:
Files, directories
Hidden files and directories
Home directories
Absolute and relative paths
Create, move, and delete files and directories under the home directory.
Key knowledge areas:
Files and directories
Case sensitivity
Simple globbing
Archiving files in the user home directory
Key knowledge areas:
Files, directories
Archives, compression
Search and extract data from files in the home directory.
Key knowledge areas:
Command line pipes
I/O redirection
Basic Regular Expressions using
.
,
[ ]
,
*
, and
?
Turning repetitive commands into simple scripts
Key knowledge areas:
Basic shell scripting
Awareness of common text editors (
vi
and
nano
)
Knowledge of major operating systems and Linux distributions
Key knowledge areas:
Differences between Windows, OS X, and Linux
Distribution life cycle management
Familiarity with the components that go into building desktop and server computers
Key knowledge areas:
Motherboards, processors, power supplies, optical drives, peripherals
Hard drives, solid state disks and partitions,
/dev/sd
*
Drivers
Where various types of information are stored on a Linux system
Key knowledge areas:
Programs and configuration
Processes
Memory addresses
System messaging
Logging
Querying vital networking configuration and determining the basic requirements for a computer on a Local Area Network (LAN)
Key knowledge areas:
Internet, network, routers
Querying DNS client configuration
Querying network configuration
Various types of users on a Linux system
Key knowledge areas:
Root and standard users
System users
Creating users and groups on a Linux system
Key knowledge areas:
User and group commands
User IDs
Understanding and manipulating file permissions and ownership settings
Key knowledge areas:
File permissions and ownership
Directory permissions and ownership
Special directories and files on a Linux system including special permissions
Key knowledge areas:
Using temporary files and directories
Symbolic links
What elements does a Linux distribution bundle that make it unique? Choose all that apply.
KernelApplicationsUser and group accountsGNU utilitiesPackage management utilityWhat graphical interfaces does Linux support? (Choose all that apply.)
macOSGNOMEKDE PlasmaMetroCinnamonTrue or false: The Free Software Foundation (FSF) advocates free software, which means they believe you should not have to pay money for software.
Which of the following are open source software licenses? (Choose all that apply.)
MITGPLBSDCreative CommonsApacheWhat are the three common categories for Linux systems?
EmbeddedGraphicalDesktopIndustrialServerWhat are some of the recent changes seen in Linux? (Choose all that apply.)
Improvements in the kernelImprovements in support toolsCreation of new support toolsCreation of new distributionsPayment is now required to install Linux.Which of the following are software suites that allow you to set up a private cloud using Linux? (Choose all that apply.)
NextcloudZohoownCloudCasteroKdenliveTrue or false: The dpkg and rpm package management utilities are both low-level tools.
True or false: When working in a terminal, the shell prompt often ends in either a dollar sign or a greater-than symbol for ordinary users.
Which of the following commands allow you to search the man pages for the keyword copy? (Choose all that apply.)
apropos copyman -k copywhereis copywhatis copylocate copyWhich is the current version of the original ext filesystem?
extfsext2fsext3fsext4fsbtrfsWhat command(s) display(s) information about the CPU that your Linux system is running on? (Choose all that apply.)
uname -alsusblspcilscpuman cpuWhat type of files are typically stored in the /usr folder?
User data filesConfiguration filesCritical system filesNoncritical system program and data filesProgram library filesWhich wildcard character matches any character or set of characters?
*?[]_-Which of the following are considered characters that can be used for regular expression matching rules? (Choose all that apply.)
*[]>?.Which tar option is used to compress the archive into a tarball using xz compression?
-X-j-z-v-JWhat commands could you use to see if the MySQL database server is currently running on your system? (Choose all that apply.)
lspstopfreeyumWhat command-line command displays the overall memory usage on your Linux system?
pstopfreelsyumWhich of the following are text editors you can use at the command line on a text-based tty terminal? (Choose all that apply.)
vinanogeditKateemacsThe first line of a shell script is #!/bin/bash. What does that mean?
The script won’t run on most Linux systems.The script requires the Bash shell to run.The script requires the C shell to run.The script will run on Unix systems.The script can be run without specifying the full pathname to the script file.What variable can you use to view the exit status of a script after it completes?
$?$0$1$PATH$exitWhich of the following typically holds user account passwords on a modern Linux distribution?
/etc/passwd/bin/bash/etc/shadow/etc/group/sbin/nologinA(n) _____ account is one that most common users have as their account type.
homesystemadministrativestandardrootWhen you create a new account with the useradd utility, if you did not set a password with an option the account will be locked. What command should you use with super user privileges to unlock it?
usermod -uusernamepasswordusernamepasswdusernameuseradd -ppasswordusernameunlockusernameTrue or false: When a user account is created, it is automatically assigned a primary group.
Which commands can you use to change the group a file is assigned to? (Choose all that apply.)
chmodchgrpchagechowngroupaddWhat command would you use to make the file myfile.txt a hidden file?
chmod 755 myfile.txtmv myfile.txt ~myfile.txtcp myfile.txt ./myfile.txtmv .myfile.txt myfile.txtmv myfile.txt .myfile.txtIf your Linux server doesn’t have a graphical desktop installed, what two tools could you use to configure network settings from the command line?
nmcliiwconfigipnetstatpingWhat tool allows you to send ICMP messages to a remote host to test network connectivity?
netstatifconfigpingiwconfigssA, B, D, and E. A Linux distribution bundles the Linux kernel, GNU utilities, applications, and a package management utility to make it unique, so options A, B, D, and E are all correct. User and group accounts are somewhat standard across Linux systems based on the software packages installed, not on the distribution, so option C is incorrect.
B, C, and E. Linux supports the GNOME, KDE Plasma, and Cinnamon graphical interfaces, so options B, C, and E are correct. Linux does not support the proprietary macOS or Metro environments, so options A and D are incorrect.
False. The FSF does advocate free software, but it defines it in terms of freedom to do things you want to do with the software, not the price of the software.
A, B, C, E. The MIT, GPL, BSD, and Apache are all open source licenses or groups of licenses. Therefore, options A, B, C, and E are correct answers. The Creative Commons is an organization that offers a suite of licenses but not for software. Instead, it targets audio recordings, video recordings, textual works, and so on, not just software programs.
A, C, and E. Linux systems are commonly used in embedded systems, as desktop workstations, and in server environments, so options A, C, and E are correct. Linux systems can use a graphical desktop in either a desktop or server environment, but graphical is not a category of Linux systems, so option B is incorrect. Linux can be used as either a desktop, embedded system, or server in an industrial environment, but industrial is not a category, making option D incorrect.
A, B, C, and D. In the Linux world, constant improvements are being made to the kernel and support tools and new support tools and distributions are being released, so options A, B, C, and D are all correct. Linux is still released under the open source license, which doesn’t prohibit charging a fee for Linux, but most Linux distributions are still available free of charge for installing in any environment, making option E incorrect.
A, C. Nextcloud and ownCloud are both software suites that allow you to set up a private cloud using Linux, so options A and C are correct answers. Zoho is a cloud-based office productivity suite but does not allow you to set up a private cloud, so option B is a wrong answer. Castero is a text-based podcast client that is available on Linux, but it does not provide the ability to configure a private cloud, making option D incorrect. Kdenlive is another useful Linux application (you can use it to perform video editing), but it is not involved with the cloud. Thus, option E is also an incorrect choice.
True. The dpkg and rpm package management utilities are both low-level tools, and they are limited in what functions they can perform for maintaining software packages. It’s typically better to use a higher-level utility, such as yum or apt-get, depending on your Linux distribution.
True. Typically, when working in a terminal, for regular users (users who are not logged into the root account) the default shell prompt ends in either in a dollar sign ($) or a greater-than symbol (>).
A, B, D. The apropos, man -k, and whatis commands can all be used to search the man pages for the keyword copy. Therefore, options A, B, and D are correct answers. The whereis program searches for files in a restricted set of locations instead of keywords within the man pages, so option C is a wrong answer. The locate command also searches for files, but it uses a database—it does not search for keywords within the man pages. Therefore, option E is also an incorrect choice.
D. The ext filesystem is currently at version 4, which is called ext4fs, so option D is correct. The original extfs filesystem is no longer supported, so option A is incorrect. The ext2fs and ext3fs filesystems are still supported and can be used if needed, but they are not recommended for new Linux installations, so options B and C are incorrect. The btrfs filesystem is not part of the extfs family but instead a new type of filesystem, so option E is incorrect.
A, D. The uname command with the -a option displays information about the host system, including the architecture the kernel was built for, which gives you a clue as to the CPU. The lscpu command provides detailed information about the CPU. Thus, both options A and D are correct. The lsusb command provides information about USB devices connected to the system, not the CPU, so option B is incorrect. Likewise, the lspci command provides information about PCI devices connected to the system, not the CPU, so option C is incorrect. The man command provides information about system and application commands, not about the CPU hardware, so option E is incorrect.
D. Linux installs noncritical applications, such as word processors and browsers, in the /usr directory, so option D is correct. User data files are normally stored in each user’s home directory, located in the /home directory structure, so option A is incorrect. Most Linux applications store their configuration files in the /etc directory, so option B is incorrect. Linux installs critical applications in either the /bin directory for user utilities or the /sbin directory for administrator programs, so option C is incorrect. In Linux, program library files are stored within the /lib directory structure, so option E is incorrect.
A. The asterisk (*) wildcard character matches none, one, or a set of characters in filename globbing, so option A is correct. The question mark (?) matches only one character in filename globbing, not a set of characters, so option B is incorrect. The square brackets ([]) match only one character within a set of characters, not the entire set of characters, so option C is incorrect. The underscore (_) and dash (-) characters are not valid wildcard characters used in filename globbing, so options D and E are both incorrect.
A, B, D, E. The *, [], ?, and . are all characters that activate regular expression matching rules. Thus, options A, B, D, and E are correct choices. The > character is used for basic redirection, and not for regular expressions, so option C is a wrong choice.
E. The tar option to compress the archive into a tarball using xz compression is -J, so option E is the correct answer. The -X option has a name of a file passed to it as an argument. That file contains filenames to be excluded from the archive, so option A is a wrong answer. The -j option is for using bzip2 compression, so option B is also an incorrect answer. The -z option is for using gzip compression. Thus, option C is an incorrect choice. The -v option instructs the tar command to produce verbose output (show what files are being archived). Therefore, option D is also an incorrect choice.
B, C. Programs running on the Linux system are called processes. The ps command allows you to display a snapshot of running processes, and the top command produces a real-time display of running processes, so options B and C are correct. The ls command displays files and directories, not running processes, so option A is incorrect. The free command displays memory usage, so option D is incorrect. The yum command is a package management tool used for installing and removing software packages, so option E is incorrect.
C. The free program displays the current memory usage on the Linux system, including memory in-use, free memory, and swap space, so option C is correct. The ps and top commands display information about the processes running on the system, and they can display information about process memory usage but not the overall memory usage on the Linux system, so options A and B are incorrect. The ls command displays file and directory information, so option D is incorrect. The yum program is a package management tool that allows you to install and remove software packages, so option E is incorrect.
A, B, E. The vi, nano, and emacs editor are all text editors you can use at the command line on a text-based terminal such as tty3. Therefore, options A, B, and E are the correct answers. The gedit and Kate editors are GUI-only editors and cannot be used on a text-based terminal. Therefore, options C and D are incorrect choices.
B. The shebang command specifies the shell that the Linux system should use to process the script. The /bin/bash path indicates to use the Bash shell, so option B is correct. The Bash shell is the default shell on most Linux systems, so this script should run on most Linux systems, making option A incorrect. The C shell is specified using either /bin/csh or /bin/tcsh, depending on which C shell your Linux system uses, so option C is incorrect. Most Unix systems don’t support the Bash shell, so option D is incorrect. The shebang specifies the path to the shell, not to the script file, so option E is incorrect.
A. The special $? variable contains the exit status of the last statement in the shell script, or the result of the exit statement if the shell script ends with that, so option A is correct. The $0 variable contains the name of the shell script, not the exit status, so option B is incorrect. The $1 variable contains the first parameter specified on the command line when the shell script is launched, not the exit status, so option C is incorrect. The $PATH environment variable specifies a list of directories the Linux system should search to find executable files, not the exit status of a shell script, so option D is incorrect. The $exit variable is a user variable that you can define either locally in a script or globally in a shell, but it has no special meaning in shell scripts, so option E is incorrect.
C. On modern Linux distributions, the /etc/shadow file typically holds user account passwords, so option C is the correct answer. Although many years ago the /etc/passwd file held the user account passwords, it does not (and should not) due to file permissions, so option A is incorrect. The /bin/bash is a shell program, not an account file, and is typically the default shell assigned to regular user accounts. Thus, option B is also incorrect. The /etc/group file contains group information as well as which user accounts belong to the various groups, so option D is a wrong choice. The /sbin/nologin is a program (not an account file) that helps to prevent system accounts from logging into the system. Therefore, option E is incorrect.
D. Most common users have an account type of standard, so option D is the correct answer. There is no account type of home, so option A is incorrect. A system account is one that is used by daemons, but not common users, so option B is a wrong choice. The administrative account is not for common users, nor is the root account, because they use super user privileges to perform duties such as installing software or changing other accounts’ passwords, so options C and E are also incorrect.
C. The passwdusername command in option C will allow you to set a password for the passwdusername account, effectively unlocking it. Therefore, option C is the correct answer. The usermod -u command modifies an account’s UID but does not unlock it, so option A is a wrong answer. The password command in option B is does not exist and is therefore incorrect. If you had used the useradd -ppassword username command in option D to create the account (not recommended for security reasons), then the account would not be locked. However, you cannot reissue the useradd command for a preexisting account, so option D is a wrong choice. There is no standard command called unlock, so option E is also incorrect.
True. When a user account is created, it is automatically assigned a primary group that typically has the same name as the account’s username.
B, D. You can use either the chgrp or chown command-line command to assign a new primary group to a file or directory, making options B and D correct. The chmod command assigns permissions to a file, not the group, so option A is incorrect. The chage command changes the password options for a user account, not the group of a file, so option C is incorrect. The groupadd command adds a new group to the system and does not change the group assigned to a file, so option E is incorrect.
E. Linux uses a leading period in filenames to indicate hidden files. To change the name of a file, you use the mv command, thus making option E correct. The chmod and cp commands don’t change the name of a file, so options A and C are incorrect. The mv command lists the original filename first and the new filename second, so option D is incorrect. Since Linux uses a period to indicate hidden files, option B is incorrect.
A, C. The nmcli and the ip commands both allow you to set and change network settings from the command line, so options A and C are both correct. The iwconfig command only sets wireless network information, so option B is incorrect. The netstat command displays open ports—it doesn’t change any network settings—so option D is incorrect. The ping command sends ICMP packets to remote hosts for testing—it also doesn’t set any network settings—so option E is also incorrect.
C. The ping command sends ICMP packets to a specified remote host and waits for a response, making option C the correct answer. The netstat command displays statistics about the network interface, so option A is incorrect. The ifconfig command displays or sets network information but doesn’t send ICMP packets, making option B incorrect. The iwconfig command displays or sets wireless network information but doesn’t handle ICMP packets, making option D incorrect. The ss command displays information about open connections and ports on the system, so option E is also incorrect.
Objectives:
1.1 Linux Evolution and Popular Operating Systems
4.1 Choosing an Operating System
The fact that you’re reading this book means you want to learn about the Linux operating system (OS). To begin this journey, you must first understand what Linux is and what an OS is. This chapter describes what an OS is, how users interact with an OS, how Linux compares to other popular OSs, and how even specific Linux implementations vary. Understanding these issues will help you as you make the switch to Linux and learn about the various Linux-based systems.
An OS provides all the fundamental features of a computer, at least from a software point of view. An OS enables you to use the computer’s hardware devices, defines the user interface standards, and provides basic tools that allow applications to run on the computer. This section describes the different parts that make up an OS and how they work together to create your computing experience.
An OS kernel is a software component responsible for managing various low-level features of the computer, including:
Interfacing with hardware devices (network adapters, hard disks, and so on)
Allocating memory to individual programs
Allocating CPU time to individual programs
Enabling programs to interact with one another
When you use a program (say, a web browser), it relies on the kernel for many of its basic functions. The web browser can communicate with the outside world only by using network functions provided by the kernel. The kernel allocates memory and CPU time to the web browser, without which it couldn’t run. The web browser may rely on plug-ins to display multimedia content; such programs are launched and interact with the web browser through kernel services. Any program you run on a computer relies on the kernel in a similar way, although the details vary from one OS to another and from one program to another.
The kernel is the software “glue” that holds the computer together. Without a kernel, a modern computer can do very little.
Kernels are not interchangeable; the Linux kernel is different from the macOS kernel used in Apple workstations and laptops, and from the Windows kernel used in Microsoft-compatible workstations and laptops. Each of these kernels uses a different internal design and provides different software interfaces for programs to use. Thus, each OS is built from the kernel up and uses its own set of programs that further define each OS’s features.
Some programs run on multiple kernels, but most need OS-specific tweaks. Programmers create binaries—the program files for a particular processor and kernel—for each OS. You need to run the binary file created for the specific OS you’re running the program on.
