Cover: LPI Linux Essentials Study Guide, Third Edition by Christine Bresnahan

LPI
Linux Essentials

Study Guide

Third Edition

Wiley Logo

Christine Bresnahan

Richard Blum

Wiley Logo








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)

Acknowledgments

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.

About the Authors

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.

Introduction

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:

Why Become Linux Certified?

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.

How to Become Certified

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.

images 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).

Who Should Buy This Book

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.

images 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.”

How This Book Is Organized

This book consists of 15 chapters, two appendixes, plus this introduction and the assessment test after the introduction. The chapters are organized as follows:

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.

images 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.

Additional Study Tools

Readers of this book can access a website that contains several additional study tools, including the following:

images 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.

Conventions Used in This Book

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:

In addition to these text conventions, which can apply to individual words or entire paragraphs, a few conventions highlight segments of text:

images 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.

 

images 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.

 

images 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.

 

Exercise

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.

 

image

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.

The Exam Objectives

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.)

images 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.

Exam 010-160 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

Topic 1: The Linux Community and a Career in Open Source

1.1 Linux Evolution and Popular Operating Systems 
(Chapters 1 and 3)

  • Knowledge of Linux development and major distributions
  • Key knowledge areas:
    • Distributions:
      • Embedded Systems
      • Linux in the Cloud

1.2 Major Open Source Applications (Chapter 4)

  • 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

1.3 Open Source Software and Licensing (Chapter 2)

  • 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)

1.4 ICT Skills and Working in Linux (Chapters 4 and 5)

  • 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

Topic 2: Finding Your Way on a Linux System

2.1 Command Line Basics (Chapters 5, 7 and 11)

  • Basics of using the Linux command line
  • Key knowledge areas:
    • Basic shell
    • Command line syntax
    • Variables
    • Quoting

2.2 Using the Command Line to Get Help (Chapter 5)

  • Running help commands and navigation of the various help systems
  • Key knowledge areas:
    • Man pages
    • Info pages

2.3 Using Directories and Listing Files (Chapter 7)

  • 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

2.4 Creating, Moving, and Deleting Files (Chapter 7)

  • Create, move, and delete files and directories under the home directory.
  • Key knowledge areas:
    • Files and directories
    • Case sensitivity
    • Simple globbing

Topic 3: The Power of the Command Line

3.1 Archiving Files on the Command Line (Chapter 8)

  • Archiving files in the user home directory
  • Key knowledge areas:
    • Files, directories
    • Archives, compression

3.2 Searching and Extracting Data from Files (Chapters 5 and 8)

  • Search and extract data from files in the home directory.
  • Key knowledge areas:
    • Command line pipes
    • I/O redirection
    • Basic Regular Expressions using ., [ ], *, and ?

3.3 Turning Commands into a Script (Chapters 10 and 11)

  • Turning repetitive commands into simple scripts
  • Key knowledge areas:
    • Basic shell scripting
    • Awareness of common text editors (vi and nano)

Topic 4: The Linux Operating System

4.1 Choosing an Operating System (Chapter 1)

  • Knowledge of major operating systems and Linux distributions
  • Key knowledge areas:
    • Differences between Windows, OS X, and Linux
    • Distribution life cycle management

4.2 Understanding Computer Hardware (Chapter 6)

  • 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

4.3 Where Data Is Stored (Chapters 7 and 9)

  • Where various types of information are stored on a Linux system
  • Key knowledge areas:
    • Programs and configuration
    • Processes
    • Memory addresses
    • System messaging
    • Logging

4.4 Your Computer on the Network (Chapter 15)

  • 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

Topic 5: Security and File Permissions

5.1 Basic Security and Identifying User Types (Chapter 12)

  • Various types of users on a Linux system
  • Key knowledge areas:
    • Root and standard users
    • System users

5.2 Creating Users and Groups (Chapter 13)

  • Creating users and groups on a Linux system
  • Key knowledge areas:
    • User and group commands
    • User IDs

5.3 Managing File Permissions and Ownership (Chapter 14)

  • Understanding and manipulating file permissions and ownership settings
  • Key knowledge areas:
    • File permissions and ownership
    • Directory permissions and ownership

5.4 Special Directories and Files (Chapter 7)

  • Special directories and files on a Linux system including special permissions
  • Key knowledge areas:
    • Using temporary files and directories
    • Symbolic links

Assessment Test

  1. What elements does a Linux distribution bundle that make it unique? Choose all that apply.

    1. Kernel
    2. Applications
    3. User and group accounts
    4. GNU utilities
    5. Package management utility

  2. What graphical interfaces does Linux support? (Choose all that apply.)

    1. macOS
    2. GNOME
    3. KDE Plasma
    4. Metro
    5. Cinnamon

  3. True or false: The Free Software Foundation (FSF) advocates free software, which means they believe you should not have to pay money for software.

  4. Which of the following are open source software licenses? (Choose all that apply.)

    1. MIT
    2. GPL
    3. BSD
    4. Creative Commons
    5. Apache

  5. What are the three common categories for Linux systems?

    1. Embedded
    2. Graphical
    3. Desktop
    4. Industrial
    5. Server

  6. What are some of the recent changes seen in Linux? (Choose all that apply.)

    1. Improvements in the kernel
    2. Improvements in support tools
    3. Creation of new support tools
    4. Creation of new distributions
    5. Payment is now required to install Linux.

  7. Which of the following are software suites that allow you to set up a private cloud using Linux? (Choose all that apply.)

    1. Nextcloud
    2. Zoho
    3. ownCloud
    4. Castero
    5. Kdenlive

  8. True or false: The dpkg and rpm package management utilities are both low-level tools.

  9. 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.

  10. Which of the following commands allow you to search the man pages for the keyword copy? (Choose all that apply.)

    1. apropos copy
    2. man -k copy
    3. whereis copy
    4. whatis copy
    5. locate copy

  11. Which is the current version of the original ext filesystem?

    1. extfs
    2. ext2fs
    3. ext3fs
    4. ext4fs
    5. btrfs

  12. What command(s) display(s) information about the CPU that your Linux system is running on? (Choose all that apply.)

    1. uname -a
    2. lsusb
    3. lspci
    4. lscpu
    5. man cpu

  13. What type of files are typically stored in the /usr folder?

    1. User data files
    2. Configuration files
    3. Critical system files
    4. Noncritical system program and data files
    5. Program library files

  14. Which wildcard character matches any character or set of characters?

    1. *
    2. ?
    3. []
    4. _
    5. -

  15. Which of the following are considered characters that can be used for regular expression matching rules? (Choose all that apply.)

    1. *
    2. []
    3. >
    4. ?
    5. .

  16. Which tar option is used to compress the archive into a tarball using xz compression?

    1. -X
    2. -j
    3. -z
    4. -v
    5. -J

  17. What commands could you use to see if the MySQL database server is currently running on your system? (Choose all that apply.)

    1. ls
    2. ps
    3. top
    4. free
    5. yum

  18. What command-line command displays the overall memory usage on your Linux system?

    1. ps
    2. top
    3. free
    4. ls
    5. yum

  19. Which of the following are text editors you can use at the command line on a text-based tty terminal? (Choose all that apply.)

    1. vi
    2. nano
    3. gedit
    4. Kate
    5. emacs

  20. The first line of a shell script is #!/bin/bash. What does that mean?

    1. The script won’t run on most Linux systems.
    2. The script requires the Bash shell to run.
    3. The script requires the C shell to run.
    4. The script will run on Unix systems.
    5. The script can be run without specifying the full pathname to the script file.

  21. What variable can you use to view the exit status of a script after it completes?

    1. $?
    2. $0
    3. $1
    4. $PATH
    5. $exit

  22. Which of the following typically holds user account passwords on a modern Linux 
distribution?

    1. /etc/passwd
    2. /bin/bash
    3. /etc/shadow
    4. /etc/group
    5. /sbin/nologin

  23. A(n) _____ account is one that most common users have as their account type.

    1. home
    2. system
    3. administrative
    4. standard
    5. root

  24. When 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?

    1. usermod -u username
    2. password username
    3. passwd username
    4. useradd -p password username
    5. unlock username

  25. True or false: When a user account is created, it is automatically assigned a primary group.

  26. Which commands can you use to change the group a file is assigned to? (Choose all that apply.)

    1. chmod
    2. chgrp
    3. chage
    4. chown
    5. groupadd

  27. What command would you use to make the file myfile.txt a hidden file?

    1. chmod 755 myfile.txt
    2. mv myfile.txt ~myfile.txt
    3. cp myfile.txt ./myfile.txt
    4. mv .myfile.txt myfile.txt
    5. mv myfile.txt .myfile.txt

  28. If your Linux server doesn’t have a graphical desktop installed, what two tools could you use to configure network settings from the command line?

    1. nmcli
    2. iwconfig
    3. ip
    4. netstat
    5. ping

  29. What tool allows you to send ICMP messages to a remote host to test network connectivity?

    1. netstat
    2. ifconfig
    3. ping
    4. iwconfig
    5. ss