Preview: Comptia Linux+ Certification Powered by Lpi

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 78

PR

EV

IE

CompTIA Linux+
Certification
Powered by LPI
Instructors Edition

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI


Jon Winder

Vice President, Product Development:


Vice President, Operations:

President, Axzo Press:

Charles G. Blum
Josh Pincus

Director of Publishing Systems Development:


Writer:

Dan Quackenbush
Tim Poulsen

Copyeditor:

Ken Maher

Cliff Coryea

IE

Keytester:

COPYRIGHT 2011 Axzo Press. All rights reserved.

No part of this work may be reproduced, transcribed, or used in any form or by any meansgraphic, electronic, or
mechanical, including photocopying, recording, taping, Web distribution, or information storage and retrieval
systemswithout the prior written permission of the publisher.
For more information, go to www.axzopress.com.

Trademarks

EV

ILT Series is a trademark of Axzo Press.


Some of the product names and company names used in this book have been used for identification purposes only and
may be trademarks or registered trademarks of their respective manufacturers and sellers.

Disclaimers

We reserve the right to revise this publication and make changes from time to time in its content without notice.
The logo of the CompTIA Authorized Quality Curriculum (CAQC) program and the status of this or other training
material as Authorized under the CompTIA Authorized Quality Curriculum program signifies that, in CompTIAs
opinion, such training material covers the content of CompTIAs related certification exam.
The contents of this training material were created for the CompTIA Linux+ Powered by LPI exams (LX0-101 and
LX0-102), covering CompTIA certification objectives that were current as of April 2010.

PR

ISBN 10: 1-4260-2206-9


ISBN 13: 978-1-4260-2206-7
Printed in the United States of America
1 2 3 4 5 GL 06 05 04 03

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction
Topic A:
Topic B:
Topic C:
Topic D:

Contents
v

About the manual............................................................................... vi


Setting student expectations .............................................................. xi
Classroom setup................................................................................xvii
Support.............................................................................................. xxi

Installing and using Linux

1-1

IE

Topic A: Linux overview................................................................................. 1-2


Topic B: Installing Linux................................................................................. 1-8
Unit summary: Installing and using Linux...................................................... 1-20

Using Linux

2-1

Topic A: Graphical user interfaces .................................................................. 2-2


Topic B: Command-line Linux....................................................................... 2-11
Unit summary: Using Linux............................................................................ 2-30

File and directory management

3-1

EV

Topic A: Directory organization ...................................................................... 3-2


Topic B: File management.............................................................................. 3-11
Topic C: Removable storage........................................................................... 3-38
Unit summary: File and directory management .............................................. 3-44

System administration

4-1

Topic A: Users and groups .............................................................................. 4-2


Topic B: File and directory permissions......................................................... 4-23
Unit summary: System administration ............................................................ 4-40

User environment configuration

5-1

Topic A: Shell configuration ........................................................................... 5-2


Topic B: GUI configuration............................................................................ 5-14
Unit summary: User environment configuration............................................. 5-29

PR

Application management

6-1

Topic A: Package management........................................................................ 6-2


Topic B: Managing shared libraries................................................................ 6-20
Unit summary: Application management........................................................ 6-26

System configuration

7-1

Topic A: Disk management ............................................................................. 7-2


Topic B: File system management.................................................................. 7-24
Topic C: Disk quotas ...................................................................................... 7-30
Topic D: Device management......................................................................... 7-37
Unit summary: System configuration.............................................................. 7-44

Process and module management

8-1

Topic A: Process management......................................................................... 8-2


Topic B: Process priority and execution......................................................... 8-14

NOT FOR PRINTING OR INSTRUCTIONAL USE

ii

CompTIA Linux+ Certification, Powered by LPI


Topic C: Kernel modules ............................................................................... 8-21
Unit summary: Process and module management .......................................... 8-29

System maintenance

9-1

Topic A: Backup and restore ........................................................................... 9-2


Topic B: Scheduling tasks.............................................................................. 9-14
Topic C: Performance monitoring.................................................................. 9-21
Topic D: Logging ........................................................................................... 9-33
Unit summary: System maintenance .............................................................. 9-50

Networking

10-1

IE

Topic A: Networking basics ........................................................................... 10-2


Topic B: Network services ............................................................................ 10-18
Topic C: Domain name services ................................................................... 10-34
Unit summary: Networking ........................................................................... 10-46

File sharing and printing

11-1

Topic A: Network file resources .................................................................... 11-2


Topic B: Printing........................................................................................... 11-10
Unit summary: File sharing and printing ....................................................... 11-20

Accessibility and localization

12-1

EV

Topic A: Accessibility .................................................................................... 12-2


Topic B: Localization.................................................................................... 12-11
Unit summary: Accessibility and localization ............................................... 12-19

Security

13-1

Topic A: System security ............................................................................... 13-2


Topic B: Network security ............................................................................ 13-11
Unit summary: Security ................................................................................. 13-32

Web environment

14-1

Topic A: Web services ................................................................................... 14-2


Topic B: MySQL services............................................................................. 14-16
Topic C: SQL 14-22
Unit summary: Web environment.................................................................. 14-38

FTP and e-mail services

15-1

PR

Topic A: FTP services .................................................................................... 15-2


Topic B: Mail services .................................................................................. 15-19
Unit summary: FTP and e-mail services........................................................ 15-25

Troubleshooting and maintenance

16-1

Topic A: Booting Linux ................................................................................. 16-2


Topic B: Network troubleshooting................................................................ 16-16
Topic C: Scripting basics .............................................................................. 16-23
Topic D: Text stream utilities........................................................................ 16-37
Unit summary: Troubleshooting and maintenance ........................................ 16-42

Certification exam objectives map

A-1

Topic A: Exam 1 Objectives: LX0-101........................................................... A-2


Topic B: Exam 2 Objectives: LX0-102.......................................................... A-14

NOT FOR PRINTING OR INSTRUCTIONAL USE

iii
Course summary

S-1

Topic A: Course summary ............................................................................... S-2


Topic B: Continued learning after class .......................................................... S-5

I-1

PR

EV

IE

Index

G-1

Glossary

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI

PR

EV

IE

iv

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction

After reading this introduction, you will know


how to:

IE

A Use ILT Series manuals in general.


B Use prerequisites, a target student

description, course objectives, and a skills


inventory to properly set students
expectations for the course.

C Set up a classroom to teach this course.

EV

D Get support for setting up and teaching this

PR

course.

NOT FOR PRINTING OR INSTRUCTIONAL USE

vi

CompTIA Linux+ Certification, Powered by LPI

Topic A: About the manual

ILT Series philosophy


Our goal is to make you, the instructor, as successful as possible. To that end, our
manuals facilitate students learning by providing structured interaction with the
software itself. While we provide text to help you explain difficult concepts, the handson activities are the focus of our courses. Leading the students through these activities
will teach the skills and concepts effectively.

IE

We believe strongly in the instructor-led class. For many students, having a thinking,
feeling instructor in front of them will always be the most comfortable way to learn.
Because the students focus should be on you, our manuals are designed and written to
facilitate your interaction with the students, and not to call attention to manuals
themselves.

We believe in the basic approach of setting expectations, then teaching, and providing
summary and review afterwards. For this reason, lessons begin with objectives and end
with summaries. We also provide overall course objectives and a course summary to
provide both an introduction to and closure on the entire course.
Our goal is your success. We encourage your feedback in helping us to continually
improve our manuals to meet your needs.

EV

Manual components

The manuals contain these major components:


Table of contents
Introduction
Units

Appendix
Course summary
Glossary
Index

Each element is described below.

PR

Table of contents

The table of contents acts as a learning roadmap for you and the students.

Introduction

The introduction contains information about our training philosophy and our manual
components, features, and conventions. It contains target student, prerequisite,
objective, and setup information for the specific course. Finally, the introduction
contains support information.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction

vii

Units

Units are the largest structural component of the actual course content. A unit begins
with a title page that lists objectives for each major subdivision, or topic, within the unit.
Within each topic, conceptual and explanatory information alternates with hands-on
activities. Units conclude with a summary comprising one paragraph for each topic, and
an independent practice activity that gives students an opportunity to practice the skills
theyve learned.
The conceptual information takes the form of text paragraphs, exhibits, lists, and tables.
The activities are structured in two columns, one telling students what to do, the other
providing explanations, descriptions, and graphics. Throughout a unit, instructor notes
are found in the left margin.
Appendices

IE

An appendix is similar to a unit in that it contains objectives and conceptual


explanations. However, an appendix does not include hands-on activities, a summary, or
an independent practice activity.
Course summary

EV

This section provides a text summary of the entire course. It is useful for providing
closure at the end of the course. The course summary also indicates the next course in
this series, if there is one, and lists additional resources students might find useful as
they continue to learn about the software.
Glossary

The glossary provides definitions for all of the key terms used in this course.

Index

PR

The index at the end of this manual makes it easy for you and your students to find
information about a particular software component, feature, or concept.

NOT FOR PRINTING OR INSTRUCTIONAL USE

viii

CompTIA Linux+ Certification, Powered by LPI

Manual conventions

Item

Description

Italic text

In conceptual text, indicates a new term or feature.

Bold text

In unit summaries, indicates a key term or concept. In


an independent practice activity, indicates an explicit
item that you select, choose, or type.

Code font

IE

Instructor note/icon

Weve tried to keep the number of elements and the types of formatting to a minimum
in the manuals. We think this approach aids in clarity and makes the manuals more
classically elegant looking. But there are some conventions and icons you should know
about.

Longer strings of
code will look
like this.

Instructor notes.

Indicates code or syntax.

In the hands-on activities, any code thats too long to fit


on a single line is divided into segments by one or more
continuation characters (). This code should be
entered as a continuous string of text.

EV

In the left margin, provide tips, hints, and warnings for


the instructor.

Select bold item

In the left column of hands-on activities, bold sans-serif


text indicates an explicit item that you select, choose,
or type.

Keycaps like e

Indicate a key on the keyboard you must press.

Warning icon.

Warnings prepare instructors for potential classroom


management problems.

Tip icon.

Tips give extra information the instructor can share


with students.

PR

Setup icon.

Projector icon.

Setup notes provide a realistic business context for


instructors to share with students, or indicate additional
setup steps required for the current activity.
Projector notes indicate that there is a PowerPoint slide
for the adjacent content.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction

ix

Hands-on activities

Do it!

A-1:

Creating a commission formula

Heres how
1 Open Sales

Heres why

This is an oversimplified sales compensation


worksheet. It shows sales totals, commissions,
and incentives for five sales reps.

IE

Take the time to make


sure your students
understand this
worksheet. Well be here a
while.

The hands-on activities are the most important parts of our manuals. They are divided
into two primary columns. The Heres how column gives short directions to the
students. The Heres why column provides explanations, graphics, and clarifications.
To the left, instructor notes provide tips, warnings, setups, and other information for the
instructor only. Heres a sample:

2 Observe the contents of cell F4

The commission rate formulas use the name


C_Rate instead of a value for the commission
rate.

EV

For these activities, we have provided a collection of data files designed to help students
learn each skill in a real-world business context. As students work through the activities,
they will modify and update these files. Of course, students might make a mistake and
therefore want to re-key the activity starting from scratch. To make it easy to start over,
students will rename each data file at the end of the first activity in which the file is
modified. Our convention for renaming files is to add the word My to the beginning
of the file name. In the above activity, for example, students are using a file called
Sales for the first time. At the end of this activity, they would save the file as My
sales, thus leaving the Sales file unchanged. If students make mistakes, they can start
over using the original Sales file.

PR

In some activities, however, it might not be practical to rename the data file. Such
exceptions are indicated with an instructor note. If students want to retry one of these
activities, you will need to provide a fresh copy of the original data file.

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI

PowerPoint presentations

The ILT Series PowerPoint add-in

Each unit in this course has an accompanying PowerPoint presentation. These slide
shows are designed to support your classroom instruction while providing students with
a visual focus. Each presentation begins with a list of unit objectives and ends with a
unit summary slide. We strongly recommend that you run these presentations from the
instructors station as you teach this course. A copy of PowerPoint Viewer is included,
so it is not necessary to have PowerPoint installed on your computer.

The CD also contains a PowerPoint add-in that enables you to do two things:
Create slide notes for the class

Display a control panel for the Flash movies embedded in the presentations

EV

IE

To load the PowerPoint add-in:


1 Copy the Course_ILT.ppa file to a convenient location on your hard drive.
2 Start PowerPoint.
3 Choose Tools, Macro, Security to open the Security dialog box. On the Security
Level tab, select Medium (if necessary), and then click OK.
4 Choose Tools, Add-Ins to open the Add-Ins dialog box. Then, click Add New.
5 Browse to and double-click the Course_ILT.ppa file, and then click OK. A
message box will appear, warning you that macros can contain viruses.
6 Click Enable Macros. The Course_ILT add-in should now appear in the
Available Add-Ins list (in the Add-Ins dialog box). The x in front of
Course_ILT indicates that the add-in is loaded.
7 Click Close to close the Add-Ins dialog box.

After you complete this procedure, a new toolbar will be available at the top of the
PowerPoint window. This toolbar contains a single button labeled Create SlideNotes.
Click this button to generate slide-notes files in both text (.txt) and Excel (.xls) format.
By default, these files will be saved to the folder that contains the presentation. If the
PowerPoint file is on a CD-ROM or in some other location to which the slide-notes files
cannot be saved, you will be prompted to save the presentation to your hard drive and
try again.

PR

When you run a presentation and come to a slide that contains a Flash movie, you will
see a small control panel in the lower-left corner of the screen. You can use this panel to
start, stop, and rewind the movie, or to play it again.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction

xi

Topic B: Setting student expectations

Properly setting student expectations is essential to your success. This topic will help
you do that by providing:
Prerequisites for this course
A description of the target student

A list of the objectives for the course


A skills assessment for the course

Course prerequisites

IE

Students taking this course should be familiar with personal computers and the use of a
keyboard and a mouse. Furthermore, this course assumes that students have completed
the following courses or have equivalent experience:
CompTIA A+ certification or equivalent experience

Target student

EV

The target student for this course is a system or network administrator experienced in
Microsoft Windows or another operating system environment. The best-prepared
students will have earned their CompTIA A+ certification and be familiar with common
network administration tasks. Familiarity with any Linux distribution and comfort
working at the command-prompt will be very helpful for students.

How to become CompTIA certified


To achieve CompTIA Linux+ Powered by LPI certification, a student must register for
and pass the CompTIA Linux+ Powered by LPI exams, LX0-101 and LX0-102.

PR

In order to become CompTIA certified, students must:


1 Select a certification exam provider. For more information, students should visit
http://www.comptia.org/certifications/testprep.aspx.
2 Register for and schedule a time to take the CompTIA certification exam(s) at a
convenient location.
3 Read and sign the Candidate Agreement, which will be presented at the time of
the exam. The complete text of the Candidate Agreement can be found at
http://www.comptia.org/certifications/policies/agreement.aspx.
4 Take and pass the CompTIA certification exam(s).

For more information about CompTIAs certifications, such as its industry acceptance,
benefits, or program news, students should visit
http://www.comptia.org/certifications.aspx.

CompTIA is a not-for-profit information technology (IT) trade association. CompTIAs


certifications are designed by subject matter experts from across the IT industry. Each
CompTIA certification is vendor-neutral, covers multiple technologies, and requires
demonstration of skills and knowledge widely sought after by the IT industry.

To contact CompTIA with any questions or comments, please call (630) 678-8300 or
e-mail questions@comptia.org.

NOT FOR PRINTING OR INSTRUCTIONAL USE

xii

CompTIA Linux+ Certification, Powered by LPI

Course objectives

You should share these overall course objectives with your students at the beginning of
the day. This will give the students an idea about what to expect, and it will help you
identify students who might be misplaced. Students are considered misplaced when they
lack the prerequisite knowledge or when they already know most of the subject matter
to be covered.
After completing this course, students will know how to:

Install Linux.
Interact with Linux through both the command line and GUI interfaces.
Manage files, directories, and removable media.
Manage users and groups, set file and directory permissions.

IE

Configure the user environment, and configure the GUI environment.

Install applications, resolve dependencies, update applications, and remove


applications.
Manage partitions and file systems, manage quotas, and manage devices.

View, control, and kill processes, manage process priority, and load and unload
kernel modules.

EV

Back up and restore data, schedule tasks, monitor performance, and manage
logs.
Set up and configure networking and networking services including DHCP,
NTP, and BIND.
Enable file sharing, export file systems, and use remote file systems; set up,
configure, and manage printing.
Enable assistive technologies to provide accessibility and configure localization
settings to tailor the user environment to the locale.
Configure system and network security, configure routing, and configure
firewall filtering services.
Install and configure Apache, PHP, and MySQL server services; use SQL
commands to access information in a database.
Configure FTP services, and enable outgoing and incoming mail services.

PR

Manage the boot process and runlevels, recover a lost root password,
troubleshoot the network, and write shell scripts.

NOT FOR PRINTING OR INSTRUCTIONAL USE

xiii

Introduction

Skills inventory

Use the following form to gauge students skill levels entering the class (students have
copies in the introductions of their student manuals). For each skill listed, have students
rate their familiarity from 1 to 5, with five being the most familiar. Emphasize that this
is not a test. Rather, it is intended to provide students with an idea of where theyre
starting from at the beginning of class. If a student is wholly unfamiliar with all the
skills, he or she might not be ready for the class. A student who seems to understand all
of the skills, on the other hand, might need to move on to the next course in the series.
Skill

Understanding Linux and its advantages

IE

Creating pre-installation checklists

Obtaining hardware and software information necessary to install


Linux
Installing Linux

Downloading Linux

Logging on to Linux

EV

Using Linux via the GNOME environment


Using Linux via the KDE environment

Using Linux via the command-line environment


Entering shell commands

Reusing previous commands and using tab completion


Using piping and redirection

Creating and using named pipes

PR

Using man, info, and other help systems

Understanding the Filesystem Hierarchy Standard


Creating, editing, and deleting files via the GUI
Creating, editing, and deleting files via the command-line
Editing files with vi
Creating and deleting symbolic links
Creating and deleting hard links
Creating, editing, and deleting directories

NOT FOR PRINTING OR INSTRUCTIONAL USE

xiv

CompTIA Linux+ Certification, Powered by LPI


Skill

Mounting and unmounting a CD/DVD disc


Mounting and unmounting a USB drive

Copying and moving files

Creating, modifying, and deleting user accounts


Creating, modifying, and deleting groups
Changing file ownership

IE

Changing file permissions


Modifying special permissions

Setting shell and environment variables


Creating command aliases
Configuring the GUI

EV

Installing packages
Removing packages

Resolving dependencies

Adding or removing a repository


Managing shared libraries

Compressing and uncompressing files

Creating, extending, and deleting partitions


Mounting and using a loop device

PR

Enabling quotas

Managing swap space

Viewing devices on the USB bus


Viewing devices on the PCI bus
Viewing and killing processes
Changing process priority

Installing and removing kernel modules

NOT FOR PRINTING OR INSTRUCTIONAL USE

xv

Introduction
Skill

Scheduling commands with cron


Scheduling commands with at

Backing up and restoring data with tar, cpio, and dd

Monitoring system performance with sysstat


Viewing logs
Managing log rotation

IE

Configuring and enabling DHCP server and client services


Configuring and enabling NTP server and client services

Configuring and enabling BIND server and client services


Installing and configuring NFS
Exporting a file system

EV

Using a remote file system

Installing and configuring CUPS


Managing printers

Choosing appropriate assistive technologies to provide accessibility


Configuring keyboard and mouse accessibility options
Localizing Linux

Configuring keyboard mapping

Managing SELinux operation levels

PR

Configuring routing

Configuring IP filtering
Installing Apache

Installing and testing PHP


Installing and testing MySQL server services
Inserting, updating, and deleting data with SQL statements
Configuring FTP server services

NOT FOR PRINTING OR INSTRUCTIONAL USE

xvi

CompTIA Linux+ Certification, Powered by LPI


Skill

Connecting via SSH


Configuring GRUB
Changing runlevels
Recovering a lost root password

PR

EV

IE

Writing and running a shell script

Uploading and downloading files with FTP

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction

xvii

Topic C: Classroom setup

All our courses assume that each student has a personal computer to use during the
class. Our hands-on approach to learning requires they do. This topic gives information
on how to set up the classroom to teach this course. It includes minimum requirements
for the students personal computers, setup information for the first time you teach the
class, and setup information for each time that you teach after the first time you set up
the classroom.

Hardware requirements

Each students personal computer and the instructors computer should have:

IE

A keyboard and a mouse


Pentium 4 processor or newer

512 MB RAM or more


Two hard drives (preferred) or a single large hard drive of 20 GB or more.
CD/DVD burner

At least one free USB port


Monitor capable of operating at 1024768 or higher resolution
Network adapter

EV

Optionally, you may want to provide this additional equipment for use in the classroom:
One or more Linux compatible printers for students to install and print to
One or more USB flash drives that students may use, format, and write data to

Software requirements

You will need the following software:

Debian GNU/Linux 5.0.6 (Lenny); newer versions will probably work though
some activities might not key exactly as written.

Other versions of Linux might work as well. Some notes are provided where possible.
However, the activities will not work as written for distributions other than Debian.

PR

Network requirements

Student computers must have access to the network and Internet for the duration of the
course. They will download operating system components from the Debian repositories,
which will require Internet access.
You will need the following networking components:
A router to provide network access both within the classroom and to the Internet.
A DHCP server (or device, such as a router that provides DHCP services) to
assign dynamic IP addresses to clients.
A valid static IP address for each classroom computer.

NOT FOR PRINTING OR INSTRUCTIONAL USE

xviii

CompTIA Linux+ Certification, Powered by LPI

Physical versus virtual environment

The preferred configuration for the classroom is that each student has his or her own
physical computer running Debian Linux. However, you can optionally use a
virtualization environment within another operating system. For example, the activities
in this course were tested using Oracles VirtualBox running on a Windows XP
computer. Other virtualization systems are untested, but should work fine. Setup steps
for those alternate systems are not included in this guide.

Make sure to test your virtualization environment prior to class. You might need to
install guest additions or other components to provide a seamless experience between
the host and guest operating systems.

Setup instructions for every class

IE

Students will install Debian Linux onto their computers during class. Provided your
classroom computers support booting from a CD, you dont need to install any
operating system prior to class. Optionally, you could start with working Windows (or
Linux) based systems and have students install Linux in place of that operating system.

EV

You must follow these steps regardless of which setup option you choose:
1 Assign each students computer a lab station number. Write that number on a
place card or sticky note affixed to their computer.
2 Create a bootable CD for each student following these steps:
a Visit www.debian.org
b Click Getting Debian
c Under Download larger CD/DVD image files, click HTTP/FTP.
d Under Official CD/DVD images of the "stable" release, click the link
appropriate to your computer architecture, such as i386 or amd64. Save the
file to your computer.
e Burn the ISO file you downloaded to CD making one copy for each student
in your class.

Alternate setup option: Run VirtualBox within Windows

PR

Instead of installing Linux as the sole operating system on the computer, you can run
Debian within a virtual machine using Oracle VirtualBox. If you choose this method,
you must follow these steps at each computer:
1 Install Windows XP, Windows Vista, or Windows 7 according to the software
manufacturers instructions.
2 Configure networking support so that computers can access the Internet.
3 Install the latest critical updates and service packs from
www.windowsupdate.com.
4 Create a user account for students to use. Record the credentials and be prepared
to provide them to students.
5 Log in under the student user account.
6 Download the Windows version of VirtualBox from www.virtualbox.org.
7 Install VirtualBox according to the manufacturers instructions. If warned about
installing unsigned drivers, install the drivers anyway. They are required to
enable USB and networking support within the virtualized environment.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction

xix

8 Create a virtual machine within VirtualBox by following these steps:


a Open VirtualBox and click New.
b Follow the wizards prompts; we suggest the following settings:

Virtual machine name: Debian (the operating system)

Memory: Assign the recommended amount, roughly one-quarter to onehalf, of your computers physical RAM to the virtual machine.
Disk space: Use a dynamically expanding file with a maximum size of
at least 20 GB.
c Do not start the virtual machine at this time as that would begin the Linux
installation that students should do in Unit 1.

IE

Be prepared to help students through the process of starting their virtual machines and
installing Linux. The initial steps vary from installing onto an actual computer. But once
the Linux installer begins, the steps are identical. The following steps replace steps 1
and 2 of Activity B-3 in Unit 1.
1 Open VirtualBox.
2 Select the virtual machine and click Start.
3 When prompted for the installation media, you may use either a physical
CD/DVD disc or downloaded ISO file.
If using a physical disc, insert the CD/DVD disc in the drive. In
VirtualBox, select the appropriate CD/DVD drive when prompted.

EV

If using an ISO file, select ISO Image File and then browse to and select
the Linux installation ISO file.

After Unit 1, Activity B-3, students must enable Bridged Networking. Without this
option selected, the students virtual computers will be unable to communicate with
each other.
1 In the Linux guest, shut down the computer (choose System, Shut Down).
2 Within VirtualBox, select the virtual machine and click Settings.
3 On the left, select Network.
4 From the Attached to list, select Bridged Adapter.
5 Click OK to save your changes.
6 Start the virtual machine.

PR

Downloading the PowerPoint presentations


If you dont have the CD that came with this manual, you can download the PowerPoint
presentations for this course. Heres what you do:
1 Connect to www.axzopress.com.
2 Under Downloads, click Instructor-Led Training.
3 Browse the subject categories to locate your course. Then click the course title to
display a list of available downloads. (You can also access these downloads
through our Catalog listings.)
4 Click the link(s) for downloading the PowerPoint presentations, and follow the
instructions that appear on your screen.

NOT FOR PRINTING OR INSTRUCTIONAL USE

xx

CompTIA Linux+ Certification, Powered by LPI

CertBlaster software

PR

EV

IE

CertBlaster pre- and post-assessment software is available for this course. To download
and install this free software, students should complete the following steps:
1 Go to www.axzopress.com.
2 Under Downloads, click CertBlaster.
3 Click the link for CompTIA Linux + 2009.
4 Save the .EXE file to a folder on your hard drive. (Note: If you skip this step, the
CertBlaster software will not install correctly.)
5 Click Start and choose Run.
6 Click Browse and then navigate to the folder that contains the .EXE file.
7 Select the .EXE file and click Open.
8 Click OK and follow the on-screen instructions.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Introduction

xxi

Topic D: Support

Contacting us

Your success is our primary concern. If you need help setting up this class or teaching a
particular unit, topic, or activity, please dont hesitate to get in touch with us.

Please contact us through our Web site, www.axzopress.com. You will need to provide
the name of the course, and be as specific as possible about the kind of help you need.

Instructors tools

PR

EV

IE

Our Web site provides several instructor tools for each course, including course outlines
and answers to frequently asked questions. To download these files, go to
www.axzopress.com. Then, under Downloads, click Instructor-Led Training and
browse our subject categories.

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI

PR

EV

IE

xxii

NOT FOR PRINTING OR INSTRUCTIONAL USE

11

Unit 1
Installing and using Linux

Unit time: 90 minutes

Complete this unit, and youll know how to:

IE

A Describe Linux and explain its position and

role in the computing marketplace.

PR

EV

B Install Linux.

NOT FOR PRINTING OR INSTRUCTIONAL USE

12

CompTIA Linux+ Certification, Powered by LPI

Topic A: Linux overview


Linux is a UNIX-like operating system originally developed by Linus Torvalds, starting
in 1991 while a student at the University of Helsinki. Like all operating systems, Linux
enables the most basic common system operations, such as file management, user
account management, and so forth. It provides a means for users to interact with their
computers hardware and software.

EV

IE

Explanation

Exhibit 1-1: Ubuntu Linux with OpenOffice Writer and Mozilla Firefox open
Linux is perhaps most notable because it is free and open source. Programmers have
made versions of Linux available for nearly every computer hardware platform in
current use. Linux is available for:

PR

Network servers and enterprise-class computing environments.


Desktop and end-user computers.
Non-computer devices, such as cell phones, automobile control systems,
network routers, alarm system controllers, and so forth.

Specifically, Linus Torvalds wrote the original Linux kernel. The kernel is the software
components that provide the core set of operating system functions. These include
features for managing system hardware and communicating between software and
hardware.
The Linux kernel is the base on which various versions, or distributions, are built. Each
Linux distribution (typically abbreviated distro) bundles a specific set of features,
software components, and a design philosophy that targets a particular use or market
segment. The following table lists a few of the more common distributions in general
use as of this writing.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux

13

Description

Ubuntu
Make sure students are
clear on the distinctions
among desktop, server,
and embedded versions
of Linux. Many of the
distros are available for
more than one of these
categories, and students
need to choose the
appropriate version for
their own systems.

Ubuntu is a community-developed Linux distro coordinated by


Canonical, Ltd. Its currently one of the most popular end-user versions
of Linux. Ease of use and multi-language support are two key goals of
Ubuntus developers. Linux Mint (http://linuxmint.com/) is a popular
variant of Ubuntu.

Red Hat Enterprise

Red Hat, Inc., authors the Red Hat Enterprise Linux commercial distro
in versions for servers and desktops. It also provides middleware and
software components, consulting, support, and education services. Red
Hat is one of the largest Linux distros in the business marketplace.

Fedora

Fedora is Red Hats end-user Linux distro. While Red Hat engineers
participate, Fedora development is community driven.

According to Novell, its


pronounced soo suh
not Susie or soo see.

SUSE and
openSUSE

Developed by Novell Corporation, SUSE is released in two major


versions: SUSE Linux Enterprise Desktop (SLED) and SUSE Linux
Enterprise Server (SLES), which are built atop the open-source
openSUSE core. Novell adds interoperability, virtualization, and
enterprise service features for its commercial distros.

Debian GNU/Linux

Debian is a community-developed Linux distro managed by the Debian


Project. Debian is regarded as a highly customizable and powerful
distro. Generally, Debian can be described as an intermediate users
version of Linux: slightly harder to use and more customizable than
some distros, but less feature-rich than others. Ubuntu is based on
Debian.

EV

IE

Distro

Slackware

Slackware Linux is one of the oldest distros still undergoing active


development. Its a popular, highly technical distro aimed at
experienced Linux power users.

You can get detailed information about most of the top Linux distros at
http://distrowatch.com/. The http://en.wikipedia.org/wiki/List_of_Linux_distributions
entry at Wikipedia lists even more distributions.

Open source licensing

PR

Linux is distributed under a software licensing model called open source. With open
source licensing, you are free to use, modify, and even redistribute the original
programming code, provided you comply with specific terms of the license. There are
many open source licenses under which software can be distributed. Linux follows the
GNU Public License, or GPL.
Closed source

In contrast to open source, closed source is the software industrys traditional licensing
model. Such licenses give you the right to use the software (with various limitations).
However, you are typically restricted from reverse-engineering, modifying, or
redistributing the software. The original publisher retains ownership and full control of
the software. Microsoft Windows, Microsoft Office, Adobe Photoshop, Apple iTunes,
and so forth are examples of software distributed under closed source licenses.

NOT FOR PRINTING OR INSTRUCTIONAL USE

14

CompTIA Linux+ Certification, Powered by LPI


GPL
Developed by the Free Software Foundation (FSF), the GNU Public License is one of
the premier open source licensing models. GPL software is free software. According to
the FSF, free software is a matter of liberty, not price. In other words, the GPL is
meant to provide you the freedom to use and distribute software and ensure that the
software you distribute under the GPL is free from proprietary claims of ownership,
some forms of legal liability, and onerous burdens associated with the use and sharing
of that software. It doesnt mean GPL software costs nothing or that you cant charge
money for software you release under the GPL.

You could point


out that RHEL is GPL
software, yet you have
to pay to obtain it.

According to the GPL, in general, you may:

Use the software on one or more computers as you see fit

Provided that:

IE

Copy and distribute the program in compiled or source code version


Modify the program and distribute the modified version

Any copies you distribute are covered by the GPL


Any copies you distribute include a copyright notice, exclusion of warranty, and
a copy of the GPL
Any copies you distribute include the source code or an offer to make the source
code available

EV

Together, these provisions protect you as both the user and author of the software. GPL
software is distributed without warranty. This means you cannot sue or be sued by users
of the software should problems arise related to the use of the application. Furthermore,
you cannot, nor can others, take ownership of the software and release it under a
different license.
As of this writing, the current version of the GPL is called the GNU Affero General
Public License v3, or GPL v3. Many programs continue to be distributed under the
older GPL v2 license.

GNU Lesser Public License (LGPL)

PR

The LGPL represents an interim place between the free software covered by the GPL
and software licensed under both more permissive and more restrictive licenses. In a
general case, you cant mix program components using one license with components
using another. For example, you cant create a closed source program that uses
components covered by the GPL.
The classic justification for the LGPL given by the FSF is a programming library. In
programming, a library is a self-contained component that provides a specific type or
class of functionality. For example, a library might provide the means to draw boxes on
the monitor. Any time a program needs to draw a box, it can call the library to do so.
Libraries enable programmers to focus on the task at hand rather than reinventing basic
functions for each program.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux

So lets say you wrote a library for drawing those boxes and released it under the GPL.
Another programmer couldnt use your library in her program unless she also released
her program under the GPL. Libraries are so useful that the FSF decided there should be
an exception for reusable code, such as libraries, so that anyone can benefit.

The LGPL also lets


you mix GPL
components with those
licensed under more
permissive licenses,
such as the MIT
license.

15

If you released your box-drawing library under the LGPL, other programmers could use
your library in their programs, even if those programs are released under another
license. In the broader realm of computing, LGPL is useful for hardware drivers, DLLs,
programming APIs, and so forth. Entire programs are rarely released under the LGPL.
PHP, Apache, and other license models

IE

The FSFs GPL and LGPL models are certainly not the only open source licensing
models. While some are more restrictive, many of these alternate licenses are
considerably more liberal than the GPL.

PHPThe PHP license, which originated with the PHP programming language,
is an open source license with restrictions. Chief among the restrictions is that
derivations cant use the name PHP in their name or to promote their products.
The licenses restrictions apply to the code of the PHP programming language,
not to programs written with that language.
BSDThe BSD license is a generally permissive license that grants permission
to use, modify, and redistribute software. It requires you to include the original
copyright notice and disclaimers with your modified or redistributed versions.
You cant relicense the code under a different license.

EV

ApacheUsed with the Apache Web server software, this model enables you to
use the software for any purpose. You may redistribute the software in original
or modified form. Unlike the GPL, this license doesnt require you to apply the
Apache license to your redistributed program.
MITOne of the more permissive of the open source models, the MIT license
permits you to use, release, and modify software, and even to change the
licensing model used by your modified version. Notable projects released under
the MIT license include the X Window System (X11), jQuery programming
library, PuTTY secure terminal system, and Bouncy Castle (encryption) API.

A large list of open source software licenses is available at www.opensource.org.

Freeware and shareware

PR

Freeware is not a software licensing model. It means only that the software is
provided for free. Freeware could be covered by any of the preceding open source
licenses or could use a proprietary or closed source license.
Likewise, shareware isnt a licensing model. Such software is distributed in a trial
version, with either limited features or a time- or use-limit imposed. You have to pay
the licensing fees to obtain full access to the software. Shareware is typically distributed
under a closed source license.

NOT FOR PRINTING OR INSTRUCTIONAL USE

16

CompTIA Linux+ Certification, Powered by LPI


Creative Commons

The licenses listed so far apply to software. You cant generally use any of those
software licenses with documentation, books, articles, videos, songs, and so forth. The
Creative Commons group has released various licenses designed to be used with these
non-software digital resources, collectively called the Creative Commons licenses.
These are documented at http://creativecommons.org/about/licenses and range from
Attribution (licensees must simply acknowledge you as the original creator) to
Attribution Non-Commercial No Derivatives (which permits non-commercial
redistribution, but no modification or relicensing).
Public domain

IE

In the USA and most other countries, you automatically own a copyright on something
as soon as you commit it to a tangible medium. In most cases, tangible doesnt mean
physical. Writing a Web page, which exists entirely as digital bits and bytes, is
considered tangible in the eyes of copyright law. By controlling the copyright, you
control what can and cant be done with your creation.

PR

EV

The opposite of copyrighted is public domain. Public domain materials arent owned by
anyone in particular but instead by everyone. In the USA, most things created by the
government are owned by the people and are thus in the public domain. Anyone can do
anything with public domain materials. In practice, you probably couldnt claim public
domain materials as your own, copyright them, or release them under some sort of
restrictive license. Someone would simply need to show that the materials existed
before in the public domain to invalidate your claim.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux


Do it!

A-1:

17

Exploring Linux and licensing

Heres how

Heres why
Answers typically include the availability of
professional support and the timely availability of
patches and updates.

What factors would be most


important when choosing a distro
for your personal or home use?

Factors such as ease of use, strong community


support, and bundled applications are likely to be
more important to home users than support and
regular updates.

2 How would using GPL-licensed


software benefit an organization?

Answers typically include cost savings. However,


the flexibility to implement changes and custom
features in the software are potentially even
bigger benefits. Additionally, communitydeveloped projects tend to evolve and improve
more quickly than closed-source software
developed by a single vendor.

IE

1 What factors would you consider


most important when selecting a
distro for use at your workplace?

Answers often include lack of support. However,


in most cases, community-supported software is
updated more quickly than closed-source
software. Additionally, organizations sponsoring
an open-source software application usually
provide support to pay for their operations.

PR

EV

3 What downsides to you see to


using GPL-licensed software in an
organization?

NOT FOR PRINTING OR INSTRUCTIONAL USE

18

CompTIA Linux+ Certification, Powered by LPI

Topic B: Installing Linux

Objective

102.1

Design hard disk layout

This topic covers the following CompTIA exam objectives for Linux+ [Powered by
LPI] Certification, LX0-101 and LX0-102 exams.

Allocate filesystems and swap space to separate partitions or disks


Tailor the design to the intended user of the system

Ensure the /boot partition conforms to the hardware architecture required for booting
The following is a partial list of the used files, terms, and utilities:

IE

/ (root) filesystem
/var filesystem

/home filesystem
swap space

mount points
partitions
102.2

Install a boot manager

EV

Install and configure a boot loaders, such as GRUB

Pre-installation

Explanation

Before you can install Linux, you generally perform the following tasks:
Select the installation type.
Download the appropriate installation files.

PR

If necessary, burn an ISO image to disc.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux

19

Installation types

To install Linux, you need the installation files. Depending on the installation type, this
set of files might comprise a set of DVD discs containing every possible application and
package supported by the distro. Or it might include just the minimal files needed to
boot your PC, connect to the Internet, and download the files required to run your distro.
The following table describes the primary installation types you must choose from.
With this option

CD/DVD media

You purchase or receive CD or DVD media and install in much the


same way youd install any retail software application.

ISO file

You download an image of a CD or DVD. Using disc burning


software, you create your own CD or DVD installation media and then
install using those discs. ISO files are large, typically 700 MB per CD
and multiple gigabytes for DVD images.

IE

Install type

You download an ISO file, burn a disc, and then boot. Unlike the plain
ISO file install option, a live CD provides a fully working Linux
environment. You dont actually have to install anything to run Linux,
provided you have an available hard drive on which to store your files
(the live CD is unwritable). Installable live CDs include programs that
you can use to truly install Linux onto your computer.

Netinst

You download a small bootable file, which you store on a USB drive,
an optical disc, or even a floppy drive. You boot using that medium, at
which point the installation begins. All of the remaining files needed to
install Linux on your computer are downloaded from the Internet,
typically over an HTTP or FTP connection.

EV

Installable live CD

NFS

The Network File System is a means of file sharing across the network
akin to Windows shares. With this installation method, you connect to a
network drive that contains your Linux installation files and load the
installer from there.

Installation files

PR

Most Linux distros are available for multiple hardware platforms. Additionally, many
are available in both 32-bit and 64-bit versions. In general, you should choose the
installation file set that most closely matches your hardware.
For most distros, all Intel-compatible platforms are supported through a single release.
This means that you use the same file whether youre running an Intel Pentium or an
AMD clone system. You see such download files identified with abbreviations such as
x86, i386, i686, and so forth. 32-bit and 64-bit versions are typically be identified with a
suffix: for example, x86_32 or x86_64.
In some cases, a distro takes advantage of specific CPU optimizations; thus you see
processor-specific downloads. For example, you might see an AMD-specific version
identified by the abbreviation amd64.
In most cases, you can run a 32-bit version on a 64-bit CPU. The reverse isnt true,
however. You get the best performance and optimized feature set by using the exact
version for your platform (in other words, use the 64-bit version on a 64-bit platform,
whenever possible).

NOT FOR PRINTING OR INSTRUCTIONAL USE

110

CompTIA Linux+ Certification, Powered by LPI


ISO burning applications

To burn an ISO file or installable live CD to disc, you need a CD/DVD recording
(burning) application that supports ISO files. Windows 7 enables you to burn ISO
images to disc. Simply right-click the ISO file and choose Burn disk image.
For Windows XP and earlier versions, you need to download and install ISO burning
software. The following table lists a few free and commercial applications for burning
ISO images on Windows XP-based computers.
License / cost

URL

InfraRecorder

Free, open source

www.infrarecorder.org

ISO Recorder

Free, closed source

http://isorecorder.alexfeinman.com/isorecorder.htm

Nero Burning ROM

Commercial

www.nero.com

EasyCD Creator

Commercial

www.roxio.com

IE

Application

Do it!

EV

Macintosh OS X and Linux computers include the software needed to burn ISO images
to disc. On a Macintosh, use the Disk Utility program. On Linux, you can use the
command line cdrecord tool or any of the graphical front-ends, including X-CdRoast
or gCombust. The Nautilus file management tool in the GNOME environment also
provides ISO burning functions.

B-1:

Examining installation options

Heres how

Heres why

Either the CD/DVD media or NFS methods would


be best. Either method would be quicker than a
netinst (network installation). The CD/DVD media
would also reduce the amount of data that has to
be transferred across your network.

2 What installation type would you


use to install Linux on a home
computer and why?

Any of the types would work. However,


downloading an ISO file, burning a CD/DVD, and
then installing from that disc is, perhaps, the
most straightforward method.

PR

1 You need to install Linux on a


dozen workstations at your
company. Which installation type
would you choose and why?

3 Do you need to use an ISO


burning application to convert an
.iso file into a physical disc?
Which utility would you use?

Answers will vary.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux

111

File system planning


While you dont need to know every nitty-gritty detail about partitions and file systems
to install Linux, a cursory knowledge will help you create a well-tuned system. A
partition is a logical representation of a hard drive or portion of a hard drive. In
Windows, a partition corresponds to a drive letter, such as the C drive.

Explanation

Each partition uses a file system type. Various file systems are available, each with
(sometimes subtle) benefits and tradeoffs. If you set up multiple partitions on your
system, each can use a distinct file system type.
File system types

Popular hard drive file systems for Windows computers include NTFS (the Windows
NT File System) and FAT32. The older 16-bit FAT (file allocation table) file system
isnt used on hard drives any more. The virtual FAT (VFAT) system introduced with
Windows 95 is still used on some removable media, such as USB drives and camera
memory cards.

IE

Be brief.
Students dont need to
know in-depth file
system info at this
point.

Linux cant use NTFS, FAT32, or FAT/VFAT file systems for its hard disks, though it
can use FAT/VFAT and FAT32 on removable media. Natively, Linux distros use one or
more of the following file systems:
ext2The second extended file system is an older Linux file system type. It
offers benefits for removable media, particularly flash-memory-based devices.

EV

ext3The third extended file system is a journaling file system. Its the
primary file system used by many Linux distros at the time of this writing. In
general, journaling file systems log changes before actually writing them to the
file system, making them less likely to become corrupted during a system crash.
ext4The successor to ext3 was released at the end of 2008, yet for various
reasons, its not the default file system on most distros yet.
JFSIBM has released its Journaling File System (JFS) under the GPL and
makes versions available for Linux, OS/2, and AIX.
ReiserFSA journaling file system created by programmer Hans Reiser at
Namesys. Once the native file system of SUSE Linux, it isnt commonly used in
current distros.

PR

XFSA journaling file system created by Silicon Graphics (SGI) for its IRIX
operating system. Its a high performance file system with features to support
large files. SGI ported the file system to the Linux kernel, which has included
XFS support since kernel version 2.4.

Linux partitions

Typically, Linux computers are set up with two distinct partitions:


root partitionThis partition stores the operating system, application, and data
files.
swap partitionThis partition stores virtual memory data, similar to the
pagefile.sys file on Windows computers.

You may create additional partitions. For example, you can create a volume for just
your data files. Doing so would make backing up your data files a bit easier, as you
could simply back up that entire volume.
Unless volumes are on distinct hard drives, theres generally no performance advantage
to maintaining separate partitions. Putting the root and swap files onto separate
partitions is an exception to this rule.

NOT FOR PRINTING OR INSTRUCTIONAL USE

112

CompTIA Linux+ Certification, Powered by LPI

Swap data, specifically, doesnt need or benefit from journaling. In fact, journaling
requires extra processing and transfer overhead, which is contrary to the purpose of
swap data. Because swap data is dynamic, loss during a drive failure or power outage
isnt a problem; the data will be recreated the next time you boot, regardless.
Swap partition size

When you run programs that consume more memory than you have installed in your
computer, some portions of memory are stored on the swap partition. This creates the
illusion that your computer has more RAM than it actually does. This begs the question
of how much swap space is sufficient.

Amount of RAM

Amount of disk space

Low, less than 1 GB

IE

Most guides make recommendations similar to the following:

Low, less than 1 GB


High, 2 GB or more
High, 2 GB or more

Recommended swap size

Low, 30 GB or less

512 MB 1 GB swap

High, 100 GB or more

1 2 GB swap

Low, 30 GB or less

1 GB swap

High, 100 GB or more

2 GB swap

EV

In all cases, adding more physical RAM is better than adding more swap space.
However, expanding the size of your swap partition later is more difficult than creating
a larger partition when you install Linux. So, dont skimp unless youre very limited on
disk drive space.

Partitioning utilities

Partitioning utilities are the software you use to create and manage partitions and their
file systems. In most cases, these utilities are built into the installer or are run
automatically during installation. You can also download and use some separately. For
example, you can use gparted, the GNOME Partition Editor, to manage partitions.

PR

With gparted, you download an ISO file image, create a CD, and boot with that disc.
Your system loads a minimal Linux environment from that disc and opens the gparted
utility automatically. In fact, you can use gparted to manage Windows and Linux
partitions without installing Linux onto the computer.

Once your Linux computer is up and running, you can use gparted or its command-line
equivalent, parted (for partition editor), to modify your existing partitions. When
creating new partitions with parted, you might also need to use the mkfs (make file
system) command to create your file system. You can execute this command as part of
your parted command. For more information on parted, see your systems man
pages or visit www.gnu.org/software/parted/manual/html_mono/parted.html.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux


Do it!

B-2:

113

Selecting the appropriate file system

Heres how

Heres why
The ext2 file system is more suitable for swap,
because it doesnt include journaling.

2 Why might you choose a file


system type other than ext3 for
your root and data partitions?

The native file system is typically the best choice.


But, if you need to maintain compatibility with
other systems on your network or have
specialized utilities that support only certain file
systems, you might choose a less popular file
system type.

3 Should you put the swap and root


partitions onto the same or
separate drives, and why?

For best performance, as well as for ease of


backups, you should put root and swap onto
separate drives.

4 Your instructor will share your


systems specifications. Using
those, determine a suitable size
for your swap partition

Answers will vary based on the classroom


computer specifications and the guidelines in the
preceding table.

PR

EV

IE

1 Which file system type is more


appropriate for a swap partition?

NOT FOR PRINTING OR INSTRUCTIONAL USE

114

CompTIA Linux+ Certification, Powered by LPI

Installing
With older versions of Linux, you used to have to gather all sorts of technical details
about the hardware in your computer. (Some of the technically complex distributions,
such as Slackware, still require this.) You needed to know the interrupts and IO
addresses of the various adapters in your system, the graphics chipset your video
adapter uses, and so forth. Arguably, one of the largest advancements in more recent
Linux distros has been improved installers that detect all these values for you. In this
way, modern Linux distros are now like Windows and Mac OS X in their ability to
auto-detect and auto-configure hardware configurations.

Explanation

IE

Another way installers have improved is their ability to work cooperatively with
existing operating systems on your computer. Previously, you had to install onto an
empty hard drive or partition your drive prior to installing Linux into an empty partition.
Modern desktop distros, in particular, now handle such details for you.

PR

EV

During an installation, you can often specify to resize an existing Windows partition in
order to make room for running Linux side by side with Windows on the same PC. Or,
you can use the installer to erase a Windows partition for a clean install of Linux.
Most Linux distros include boot loaders, which enable you to select which operating
system to load when you boot your PC.

Exhibit 1-2: The initial Debian installation screen

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux


Do it!

B-3:

Installing Linux

Heres how
1 Insert your Linux installation CD
into your CD drive

2 Restart your computer

Your instructor will provide you with an


installation disc or direct you to follow the
necessary steps to use an alternate installation
method.

Press a key to boot from the CD

3 Press y and the e

If necessary. For Intel architectures, Debian


offers a text or graphical installer, each of which
offers the same options and capabilities.
To start the graphical installer.

IE

See the course


setup instructions for
details on the extra steps
needed to install within the
VirtualBox environment.

Heres why

If youre using a network


installation image,
students need Internet
access for the duration of
the installation.

115

4 Select your language and click


Continue

Select your country and click


Continue

Debian detects your hardware and loads the


appropriate components.

EV

Select your keyboard layout and


click Continue
Help students choose
their primary network
interface, if necessary.

Select your primary network


interface and click Continue

5 In the Hostname box, enter


server##, where ## is the lab
station number assigned by your
instructor

If necessary.

For example, server01.

Click Continue
Click Continue

6 Select your time zone and click

Youre leaving the domain name box empty.


Debian detects the disk drives in your system.

PR

Continue

7 Unless directed otherwise by your


instructor, select Guided use
entire disk

Debian partitions your drive and begins


installing the base components of the operating
system.

Click Continue

8 Select the hard drive to which you


will install Linux

If necessary.

Click Continue

NOT FOR PRINTING OR INSTRUCTIONAL USE

116

CompTIA Linux+ Certification, Powered by LPI


9 Select All files in one

To place all your user files in a single partition.

partition (recommended
for new users)

Click Continue
10 Click Continue

To finish partitioning and write the changes to


disk.

Select Yes
Click Continue

IE

To actually partition your disk.

EV

11 Enter !pass1234 into the Root


password and Re-enter password
boxes and press e

This isnt a strong password but will suffice for


classroom use.

12 In the Full name box, enter your


full name and click Continue

To begin creating a user-level account for your


general use.

In the username box, enter your


first name and click Continue

PR

Set p@ssword as the password

13 Select your country and click


Continue

Debian creates the account. Then, it prompts


you for the location of the package manager
mirror
To configure Debian to search for application
repositories within your country.

In the archive list, select a mirror


near you and click Continue

This is the location from which application files


are loaded. You might be able to tell, from the
domain name, which ones are located nearby.

Enter the HTTP proxy


information as directed by your
instructor and click Continue

Debian configures apt, the package manager, to


download necessary files from the mirror you
specified.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux


14 Select No and click Continue

To opt out of participating in the package usage


survey.

15 In the Software Selection screen,


click Continue

IE

Your classroom use of


packages wont be
representative of normal
use. So, opting out avoids
providing biased data to
the Debian project.

117

To install the desktop environment and standard


system components. Youll install other
packages later.
(Click Continue when prompted.)

17 When the installation is complete,


click Continue

To restart your computer and load Debian.

PR

EV

16 Install the GRUB boot loader

NOT FOR PRINTING OR INSTRUCTIONAL USE

118

CompTIA Linux+ Certification, Powered by LPI

Security
You must log on to Linux before you can perform most operations. In most cases, you
should log on using a normal user account. Linux includes methods to operate as an
administrative user temporarily, when you need to perform restricted operations.

EV

IE

Explanation

PR

Exhibit 1-3: The Debian log on screen

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux


Do it!

B-4:

Logging on to Debian

Heres how
1 Enter your user name
Press e
2 Enter your password
Press e

It should be your first name.

It should be p@ssword.

Youre logged on, and the Debian desktop


displays.

Like Windows or Macintosh OS X, this Linux


graphical user interface uses icons, a menu bar,
and a notification area to enable you to interact
with your computer.

IE

3 Examine the desktop

Heres why

If students systems
are running within a
VirtualBox environment,
they must configure
bridged networking
support at this time. See
the course setup
instructions.

119

To display the applications menu. The entries on


this menu represent the standard set that come
with Debian. Other distributions include other
default applications. You can install more with
Debian as well.

5 Click on a blank area of the


desktop

To close the menu.

6 Choose System,

To log out. You should log out when youre


done using your computer. Alternatively, you
can lock the screen if you plan to be away for
just a short time.

EV

4 Click Applications and then


point to each of the submenus in
turn

PR

Log Out your_username

NOT FOR PRINTING OR INSTRUCTIONAL USE

120

CompTIA Linux+ Certification, Powered by LPI

Unit summary: Installing and using Linux


In this topic, you learned that Linux is available for servers, desktops, and embedded
systems. Various distributions (or distros) of Linux are availableUbuntu, Fedora,
SUSE, Debian, and so forthand all are based on the same core. You also learned that
open source licensing, such as the GNU GPL, grants you permission to use, modify,
and distribute Linux.

Topic B

In this topic, you learned that modern Linux installers automatically perform most of the
hardware-specific configuration tasks needed when installing Linux. You learned about
various installation options, such as installing from CD, network location, or USB boot
image. You briefly examined the file systems used by popular Linux distros. You then
installed Linux onto your computer. Finally, you logged onto your new Linux system.

IE

Review questions

Topic A

1 On what hardware platforms does Linux run?

There are versions of Linux for nearly every hardware platform imaginable.

2 Whats the Linux kernel?

The kernel is software components that provide the core set of operating system functions.

3 Name at least three Linux distros in common use.

EV

Answers might include Ubuntu, Fedora, openSUSE, Debian, Red Hat Enterprise, and Slackware.

4 True or false? GPL software has to be given away; companies cant charge money
for it.
False. GPL software is free in the sense that youre free to use it, modify it, and redistribute it as
you see fit.

5 Lets say you modify a GPL program, such as Linux. According to the licensing
model, what must you do if you redistribute the modified software?
You must license your modified software under the GPL. You must include a copyright notice,
exclusion of warranty statement, and a copy of the GPL. You must also include or provide a
means to obtain the source code to your modified version of the software.

6 Is GPL software freeware?

PR

No. GPL software isnt necessarily freeware. Freeware simply means that theres no monetary
cost for using the software. Freeware could be closed source software. You could charge money
for GPL software.

7 Is GPL software public domain software?


No. Public domain means that the software isnt copyrighted by any entity. GPL software is
copyrighted by its original author. Modified versions might carry additional copyrights.

8 True or false? Only the government can create public domain resources?
False. You can release any original work into the public domain and thereby disclaim any
copyright, title, or rights to the work.

9 True or false? Installing Linux always begins with burning an ISO image to disc.
False. You could install over the network. You could also simply borrow a disc or purchase a
commercially prepared disc.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Installing and using Linux

121

10 Youre about to download a Linux installation image. You want to install it onto an
AMD-based clone computer. Could you use a file named i386.iso?
Yes, though if the distro has an AMD-specific version, youd be better off choosing it instead.

11 Youve inherited a computer running an old version of Debian and want to install a
new version of Ubuntu. Youve downloaded the ISO file. Do you need a third-party
utility to burn a disc from that file?
No. Most Linux distros include utilities for burning discs from ISO files.

12 A ______ file system is one that logs changes before actually committing them to
disk.
journaling or journaled

IE

13 Whats the practical result of this statement? Ext3 volumes use 32-bit namespaces,
and ext4 volumes use 64-bit namespaces.
The ext4 file system supports much larger volumes and much larger files than ext3-based disks.

14 Whats the benefit of creating separate root and swap partitions on the same
physical drive?
You can use a different file system type on each.

15 Whats the benefit of creating separate root and swap partitions on separate physical
drives?

EV

Performance improvement: Your computer can likely perform multiple read and write operations
simultaneously when root and swap are on separate partitions.

16 In most cases, you log onto Linux using a(n) ______ user account and then use a
command to operate temporarily as a(n) ______ account ,when necessary.
normal, administrative

Independent practice activity

Youll compare Linux distros to learn why you might choose one over the other.
1 Log in to your Linux computer.

2 Choose Applications, Internet, Iceweasel Web Browser.

PR

3 Visit http://www.redhat.com/rhel/. Explore the information on that site to determine


the features and target audience for Red Hat Enterprise Linux (RHEL). Determine
the various versions of RHEL that you could use on your systems.
4 Visit http://www.ubuntu.com/server/. Explore the information on that site to
determine the features and target audience for Ubuntu Server Edition.
5 Which of these Linux distros would you use on your servers? Why?
6 Which of these Linux distros include the desktop operating system thats right for
you? Why?
7 Which of these Linux distros would be best suited for a large, multinational
organization with a mixed Windows, Macintosh, and Linux user base?
8 Close Iceweasel and log out.

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI

PR

EV

IE

122

NOT FOR PRINTING OR INSTRUCTIONAL USE

21

Unit 2
Using Linux

Unit time: 90 minutes

Complete this unit, and youll know how to:

IE

A Explore basic operating system functions

and interact with the system through a


graphical interface.

B Execute commands at a shell prompt and

PR

EV

use BASH techniques to work efficiently at


the command line interface.

NOT FOR PRINTING OR INSTRUCTIONAL USE

22

CompTIA Linux+ Certification, Powered by LPI

Topic A: Graphical user interfaces

Objective

103.1

Work on the command line

This topic covers the following CompTIA exam objectives for Linux+ [Powered by
LPI] Certification, LX0-101 and LX0-102 exams.

Use single shell commands and one-line command sequences to perform basic tasks on the
command line
Invoke commands inside and outside the defined path

The following is a partial list of the used files, terms, and utilities:

IE

pwd

GUIs and shells


Explanation

If you come from the Windows or Macintosh world, youre used to working with
graphical user interfaces (GUIs). Linux has GUI interfaces, too. In fact, it has multiple
ones. Whats different is that Linux operates independently of its GUI.

EV

In Linux, user interfaces are components run atop the kernel. You can run a commandline interface (CLI) called a shell. Or, you can run one of various graphical user
interfaces. In fact, because Linux is a multi-user system, one user can be interacting via
a shell while another is using a GUI. Multiple users can even use different GUIs
simultaneously on the same Linux computer.

PR

This is a simplification of
the X Windows system.

Exhibit 2-1: The kernel, shells, and GUI interfaces of Linux


The relationships between the kernel, shells, and GUI interfaces are shown in Exhibit 21. Youll notice that the shells interact directly with the kernel. The GUI interfaces
interact with a layer called X Windows. This software component interacts with the
kernel and video hardware to provide a standard means to draw elements on the screen.
X Windows is what enables Linux systems to switch GUIs and run more than one GUI
at a time. X Windows provides standard interfaces and programming tools, so that GUI
developers can focus on how their interfaces work and look.
In Windows, the GUI is the operating system. In essence, Microsofts Windows
operating system combines the functionality of the X Windows and GUI layers, plus
some of the kernel layer as well. You cant replace the Windows GUI with another you
like better. Sure, you can open a Command Prompt window to access many commandline utilities.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

23

But the Command Prompt runs as a component within the GUI.

Client-server architecture

Prior to OS X, the Macintosh worked the same way. In fact, command-line tools were
supported only through add-ons and not as part of the core operating system. OS X has
changed that, because its built atop a Linux-like BSD core. Most people still work only
with the GUI on their Macs, but the command-line is there, hidden under the covers.

X Windows is a client server system in which display functionality is divided between


client and server components. While it might seem backward, the client is the program
you run and interact with. The server is the component that reads your keystrokes and
mouse clicks and displays output on your monitor.

IE

The X Windows terminology is taken from the perspective of the application (not of the
user). So, applications (clients) make requests of the server to display output or gather
input from the user.
The primary benefit of this split nature is that you can run the server on one computer
and the client on another. In other words, X Windows is built from the ground up to
support remote computing. You can use a GUI terminal interface over the network to
access a central computer that performs most of the heavy duty processing work.
Virtual consoles

EV

Looking again at the diagram in Exhibit 2-1, you can see multiple shells running atop
the kernel. Linux is a multitasking operating system, and it can perform more than one
task at a time for you, including running multiple shells. One way you can run multiple
shells is by using virtual consoles.

In its traditional use, a console refers to your keyboard and monitoryour primary
input and output devices. If your hardware supports it, you can connect more than one
console (keyboard and monitor) to your computer and run separate programs via each
console. Alternatively, Linux supports virtual consoles, which are software equivalents
to separate keyboard and monitor configurations.
You can run more than one virtual console at a time and switch between them using
Ctrl+Alt key combinations. The following table lists the virtual consoles that Linux
supports and the keys you can use to switch among them.
Key combination

Interface type

tty1

Ctrl+Alt+F1

Command-line

tty2

Ctrl+Alt+F2

Command-line

tty3

Ctrl+Alt+F3

Command-line

tty4

Ctrl+Alt+F4

Command-line

tty5

Ctrl+Alt+F5

Command-line

tty6

Ctrl+Alt+F6

Command-line

tty7

Ctrl+Alt+F7

Graphical (GUI)

PR

Console name

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI

A-1:

Do it!

Exploring the GNOME desktop

Heres how

Heres why

1 Log in to your Linux computer

Your password should be p@ssword.

2 Examine the user interface

In GNOME terminology, the bars at the top


and bottom of the screen are called panels. The
large area between the panels is the desktop. The
icons on the desktop are called desktop objects.

3 Examine the menus

24

IE

At the left of the top panel are three menus: the


main menu, places menu, and system menu.

4 Click Applications and then


point at the menu items
Press g

5 Right-click an empty area of the


desktop

Or click an empty area of the desktop to close


the menu.
To view the desktop menu.

Or click an empty area of the desktop to close


the menu.

EV

Press g

This menu contains submenus which contain


commands that open applications.

To open a terminal (shell) emulator window.

7 At the prompt, type whoami and


press e

Your user name prints to the screen. Youre


returned to the command prompt.

8 Enter pwd

(By Enter pwd, we mean type PWD


and press Enter.)

PR

Make sure students


understand that Enter
pwd is our shorthand way
of saying type pwd and
press Enter.

6 Choose Applications,
Accessories, Terminal

This command prints the working directory,


which means it displays the full path of your
current directory. Youre in your home directory
currently.

9 Click where indicated

Open a new terminal window

To switch to another virtual desktop. Your


programs are still open on the first desktop.
(Choose Applications, Accessories, Terminal.)

Click where indicated

To switch to the first virtual desktop. You have


multiple programs running on separate desktops.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux
10 Click within the terminal window
and enter exit

25

To close the terminal window.

Switch to your second desktop


and close the terminal window

Switch back to the first desktop


11 Press c a @
Log in

Using the same user name and password that


you used at the beginning of this activity.
To switch back to the GUI virtual console. Your
login session is still active on this console.

IE

Press c a &

To switch to tty2, the second virtual console.

Press c a @

Having multiple consoles available illustrates


the client-server nature of the Linux display
components.
To log out of this virtual console.

13 Press c a &

To switch back to the GUI virtual console.

PR

EV

12 Enter logout

NOT FOR PRINTING OR INSTRUCTIONAL USE

26

CompTIA Linux+ Certification, Powered by LPI

Desktop environments
Explanation

In Linux, a desktop environment comprises many components, such as the window


manager, icon set, and default applications. A desktop environment is perhaps
equivalent to what you think of when you consider the Windows operating system. Its
made up of the software that draws application windows, dialog boxes, and so forth.
Plus, it includes the built-in utilitiesthe Linux equivalents of utilities, such as
Windows Explorer, Notepad, and so forth.
There are many desktop environments, a few of which are currently popular:
GNOME
KDE
Xfce

GNOME
GNOME is
pronounced ga-nome
just as GNU is
pronounced ga-new.

As of this writing, GNOME (the GNU Network Object Model Environment) is the
most popular Linux desktop environment. Its the default desktop environment for
Debian, Fedora, and Ubuntu, though each of those distros is available with other
environments.
GNOME includes two primary components: the desktop environment and a
programming framework that enables developers to create programs that integrate with
the GNOME environment. The desktop environment is the set of icons, window
borders and colorsas well as the software enginethat enables those components. In
addition, it includes a set of common programs and utilities.

PR

EV

GNOME is no longer
an acronym for
anything. Some have
proposed changing the
name to Gnome to
reflect that change.

IE

Linux distros include a default desktop environment. You can download and install
additional or replacement environments at any time.

NOT FOR PRINTING OR INSTRUCTIONAL USE

27

EV

IE

Using Linux

Exhibit 2-2: The GNOME environment (running on Ubuntu)


Applications and components included with common GNOME implementations
include:

Metacity is pronounced
like capacity with the
emphasis on the
second syllable.

Metacitywindow manager component


Nautilisfile manager
Firefox, Iceweasel, or EpiphanyWeb browser
Evolutione-mail, calendar, address book, and task list manager
GNOME Terminalterminal emulation
GNOME Office or OpenOfficeoffice application suite

PR

KDE

The Kommon Desktop Environment, KDE, has been around longer than GNOME,
having started in 1996. At one time, licensing concerns over the Qt toolkit used within
the KDE project led to the starting of the GNOME project. The Qt toolkit is now
licensed under the GPL, removing those concerns.
At the time of this writing, no major Linux distributions other than Slackware use KDE
as their default environment. That said, most distros support KDE. For example, you
can download Kubuntu, which is the KDE version of Ubuntu (which uses GNOME).
Or, you can install KDE atop other distros.

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI

IE

28

Exhibit 2-3: The KDE environment (running on Debian)

Applications and components included with common KDE implementations include:

EV

KWinwindow manager component


Konquererfile manager
KonquererWeb browser

KMaile-mail
Konsoleterminal emulation

KOfficeoffice application suite

Xfce

PR

The Xfce desktop environment project started in 1996 like KDE. However, it hasnt
reached the prominence that either GNOME or KDE has reached. Xfce is more modular
than the other environments. This means that users and developers can install only the
components they want, making modestly powered computers better suited to Xfce than
other environments are.

NOT FOR PRINTING OR INSTRUCTIONAL USE

29

IE

Using Linux

Exhibit 2-4: The Xfce environment (running on Ubuntu)

Applications and components included with common Xfce implementations include:

EV

Xfwmwindow manager component


Thunarfile manager
MidoriWeb browser

Oragecalendar
Terminalterminal emulation

At the time of this writing, no major Linux distributions use Xfce as their default
environment. That said, most distros support it. For some, you can download a variant
of the distro with Xfce already installed, for example, Xubuntu is Ubuntu with Xfce
installed and configured as the default environment.

Other desktop environments

PR

With a quick search of the Internet, youll easily find a dozen or more other desktop
environments for Linux. These include Enlightenment, Fluxbox, JWM, ROX Desktop,
Blackbox, Ion, and the oddly named Ratpoison. All of these have vocal and loyal
followers. Yet none have achieved widespread use. In most cases, you can download
these environments for most of the major Linux versions.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Do it!

CompTIA Linux+ Certification, Powered by LPI

A-2:

Comparing desktop environments

Heres how

Heres why

1 Why might you choose one


desktop environment over
another?

Answers might include using a common


environment across all your Linux computers,
regardless of the underlying distribution.

2 Are you limited to choosing a


single desktop environment on a
computer?

No. You can install as many as you like and


switch back and forth between them as you need.
Doing so consumes a lot of disk space, however.

3 Do you have to install the desktop


environment when you install
Linux or can you install it later?

You can install new desktop environments at any


time.

PR

EV

IE

210

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

211

Topic B: Command-line Linux

This topic covers the following CompTIA exam objectives for Linux+ [Powered by
LPI] Certification, LX0-101 and LX0-102 exams.
#

Objective

103.1

Work on the command line

Use single shell commands and one line command sequences to perform basic tasks on the
command line
Use and modify the shell environment including defining, referencing, and exporting
environment variables
Use and edit command history

IE

Invoke commands inside and outside the defined path

The following is a partial list of the used files, terms, and utilities:
bash

echo
man

history

103.2

Process text streams using filters

EV

Send text files and output streams through text utility filters to modify the output using
standard UNIX commands found in the GNU textutils package
The following is a partial list of the used files, terms, and utilities:
cat

103.3

Perform basic file management

The following is a partial list of the used files, terms, and utilities:
ls

103.4

Use streams, pipes and redirects

Redirecting standard input, standard output and standard error


Pipe the output of one command to the input of another command

PR

Use the output of one command as arguments to another command


Send output to both stdout and a file
The following is a partial list of the used files, terms, and utilities:
tee

105.1

Customize and use the shell environment


The following is a partial list of the used files, terms, and utilities:
lists

NOT FOR PRINTING OR INSTRUCTIONAL USE

212

CompTIA Linux+ Certification, Powered by LPI

Command line interface (CLI)


Most Linux distros include GUI interfaces. And in most cases, the GUI starts
automatically. This feature provides a comfortable interface for novice users and those
switching from Windows or OS X. Frankly, graphical tools help even experienced
system administrators to perform configuration tasks, particularly those they do only
once in a while.

Explanation

Unlike Windows or OS X, you dont have to use the GUI in Linux. You can work
entirely via the command line interface (CLI) to do everything from managing your
computer to writing and laying out complex technical publications.

Shells

IE

Another advantage of the Linux CLI is that its the engine behind the GUI. Everything
you can do in the GUI you can do with a text command. This isnt always the case with
Windows and OS X. Experienced users and administrators can take advantage of the
CLI to write scripts to automate common tasks or to manage systems remotely over
low-bandwidth network connectionsfeats that are more difficult in other operating
systems.

A shell is a command line interface to an operating system. In the case of Linux, its
your means of interacting with the kernel through typed commands. Actually, a shell
you use to interact with Linux is called an interactive shell. This is the terminal window
type of shell, akin to a Command Prompt window in Microsoft Windows.

EV

Non-interactive shells are used to run scripts and commands in the background. You
cant interact with a non-interactive shell, meaning you cant type or input information
in response to prompts from commands or from the system.
Well focus on interactive shells, of which theres a huge range available for Linux
systems. Linux shells are simply programs that run atop the kernel. Each shell provides
its own set of commands, options, and means of interaction. Common Linux shells
include the Bourne-Again Shell (bash), TC shell (tcsh), Z shell, public domain Korn
shell, and various others.

BASH

PR

The Bourne shell was developed by Stephen Bourne of AT&T Bell Laboratories in
1977. Linux cant use the Bourne shell directly because of licensing restrictions.
However, most Linux distros use the BASH shell, an open source shell modeled on the
Bourne shell and incorporating features from the Korn shell (ksh) and C shell (csh).

NOT FOR PRINTING OR INSTRUCTIONAL USE

213

IE

Using Linux

Exhibit 2-5: A terminal window with the BASH shell loaded

EV

BASH commands follow this general format:


command options arguments

Brevity is a virtue with


Linux commands.
Thus command names
like ls, cd, and man are
the norm.

In the preceding example, command is the command youre executing. Options are
preceded by a hyphen and are most often single letter modifier to the command.
Arguments are input parameters that specify what resource should be used by the
command.
In other words, the command tells Linux what to do, options tell it how to do it, and
arguments tell it where or on what resource to perform the function. For example,
consider this command:
ls l /usr

PR

The command, ls, prints a list of files to your screen. The l option directs the
command to include long details (extra information, such as permissions, size, and so
forth) about each file. And, the argument directs the command to list the files in the
/usr directory, assuming you have permissions to read that directory.

NOT FOR PRINTING OR INSTRUCTIONAL USE

214

CompTIA Linux+ Certification, Powered by LPI


BASH commands are case-sensitive. So, entering whoami displays your login name;
entering WhoAmI will result in an error.
Description

cat

Prints the contents of a file to the screen.

clear

Clears your terminal window but doesnt erase past output.

date

Prints the current date and time.

echo

Prints whatever text you supply as an argument to the screen.

exit

Closes the current shell.

finger

Prints information about users on the system.


Lists files and directories.

who

Prints a list of currently logged-on users.

whoami

B-1:

Prints your login name.

Entering commands at the BASH prompt

EV

Do it!

IE

ls

Command

Heres how

Heres why

To open a terminal (shell) window.

2 At the prompt, type whoami and


press e

Your user name prints to the screen. Youre


returned to the command prompt.

3 Enter ls /usr

BASH displays a list of the files in the /usr


directory.

4 Enter ls -l /usr

This time, the output includes extra details about


each file, including permissions, size, owner,
and so forth.

PR

1 Choose Applications,
Accessories, Terminal

5 Enter clear

To clear the display.

6 Enter date

To display the current date and time

7 Enter cal

To display a calendar with todays date


highlighted.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

215

BASH proficiency
The BASH shell offers many features to ease the difficulty of working with commands
rather than clicks. We examine some of them in this section, starting with a simple trick
to use when the output of a command is too long to fit on the screen. You can press
Shift+Page Up to view previous screens of output. Use Shift+Page Down to scroll back
down a pages worth of output.

Explanation

Lets say youre trying to type whoami, and you type whao and realize youve
reversed the last two letters. You can hit Backspace twice and retype the letters. Or,
pressing Ctrl+T and BASH will reverse the last two letters for you automatically.
Prior commands

You can rerun prior commands by pressing the up-arrow and down-arrow keys until you
find the command you want, then pressing Enter. By default, BASH saves your previous
500 commands in a file named .bash_history (named with a leading period) in your
home directory. You can use the history command to print this command history to
your screen.

IE

Files named with


a leading period are
hidden from normal
display.

EV

In addition to using arrows, you can use the !! command to rerun prior commands.
Entering !! and BASH reruns your previous command. It can also provide a shortcut to
commands you havent used in a while. Lets say you wanted to rerun a command that
began with the letters wh; you could enter !wh and press Enter. BASH reruns the
most recent command you entered that began with those letters. To be sure youre going
to run the right command, enter !wh:p, and BASH prints the command to your screen
rather than executing it.
The history command output includes numbers, which you can use to re-execute the
commands. Simply enter !##, where ## is the number of the command you want to
rerun.
BASH provides a few keyboard shortcuts to ease the task of editing a prior command.
After you press the up or down arrows to arrive at the previous command, you can use
the following shortcuts as you edit that command to meet your current needs:
Ctrl+bto move your cursor one character to the left without erasing (or use the
left arrow key)
Ctrl+f (or use the right arrow key)to move your cursor one character to the
right

PR

Ctrl+wto erase the word to the left of your cursor


Ctrl+uto erase everything to the left of your cursor
Ctrl+ato move your cursor to the beginning of the line
Ctrl+eto move your cursor to the end of the line
Alt+. (Alt period)to reuse the last argument from the previous command

Shell variables

Shell variables are references to system information, such as the path to your home
directory. Rather than typing in one of these values manually, you can use the variable
and let BASH figure out the true values for you. This can be especially handy when you
dont know that real value.
Most shell variables begin with the dollar sign ($) with the variable name following in
all capital letters.

NOT FOR PRINTING OR INSTRUCTIONAL USE

216

CompTIA Linux+ Certification, Powered by LPI


The following table describes a few of the more useful shell variables.
Description

The tilde character is a shell variable representing your home directory.


For example, you can enter the cd ~ command to change your current
directory to your home directory, without even knowing the true path to
it.

$GROUPS

Contains a list of groups to which you belong. Enter echo $GROUPS


to print this list to your screen.

$HISTSIZE

Contains the number of prior commands that are saved to your history
file. Enter echo $HISTSIZE to print this list to your screen.

$HOSTNAME

Contains the host name of the computer on which youre working.


Enter echo $HOSTNAME to print this name to your screen.

Contains the full path of your current working directory. Enter echo
$PWD to print this information to your screen (or use the pwd
command).
This variable doesnt contain information. Instead, enter echo
$RANDOM to print a random number between 0 and 32767 to your
screen.

EV

$RANDOM

IE

$PWD

Variable

$SHELL

Contains the full path name of the shell youre running. Enter echo
$SHELL to print this information to your screen.

Shell metacharacters

PR

In addition to the variables listed in the preceding table, BASH assigns special meaning
to various characters. These metacharacters enable you to group commands, execute
multiple commands in a single statement, and use the output of one command as input
for the next command. BASH uses the term list to denote the sequence of one or more
pipelines separated by the operators shown in the following table.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

217

Description

Command separator. You can enter more than one command on a


single line by separating each with semicolons. For example, entering
pwd; echo $RANDOM; executes both commands: BASH prints
your current directory and then a random number to your screen.

() or {}

Group two or more commands and treat their output or exit status as a
unit.

&

Background execution

&& and ||

AND and OR operators for working with multiple commands. For


example, consider these two lines:

Metacharacters

IE

cd /bin && ls
cd /bin || ls

With the first, BASH attempts to change to the /bin directory. If thats
successful (you had permissions to do so), then it lists the contents of
the directory. If the cd command fails, the second command is
ignored.

With the second line, if you fail to change directories, BASH still lists
the contents of the current directory (not the /bin directory).

EV

Tab completion

You can use the Tab key to perform a few completion tricks. Lets say you want to
change directories to the /usr/games directory. Type cd /usr/g and press Tab. BASH
adds the ames to your command text. Press Enter and change directories.
Of course, this action assumes that youve entered enough information for BASH to
decipher a unique completion. If there are both a games and generic directory in the usr
directory, the preceding trick wont work: /usr/g isnt unique. When you press Tab,
youd hear a beep telling you so. Press Tab twice and BASH lists all the possible
matches for what you entered. You can then try again, entering a unique partial
command and pressing Tab to complete it.

PR

You can also use Tab completion with system commands. Lets say you want to
determine how long your system has been running. The command is uptime. Simply
type upt, press Tab, and BASH completes the command for you.

Sources for further learning


A complete reference to the GNU implementation of BASH is available at
www.gnu.org/software/bash/manual/bashref.html. Check your distributions help
documentation for any distro-specific information.

NOT FOR PRINTING OR INSTRUCTIONAL USE

CompTIA Linux+ Certification, Powered by LPI

B-2:

Do it!

Exploring BASH command-line tools and techniques

Heres how
The terminal window
should still be open. If the
screen saver has begun,
students need to enter
their password to unlock
their station.

Heres why

1 At the shell prompt, type whao


then press c + T
Type mi and press e

To finish and run the whoami command.

To display the last command you entered


(whoami).

2 Press z

To rerun the command.

Press e

To rerun your last commandactually, BASH


displays your previous command on one line,
then executes it, displaying its output on
subsequent lines. Thus, you see whoami on one
line, followed by your username on the next.

IE

3 Type !! and press e

4 Enter history

BASH reverses the order of the last two letters,


making your entry whoa

218

(If necessary.) To display a previous screenful


of output. The commands listed here include
those from previous login sessions.

EV

Press s u

To display your command history.

5 Choose any of the commands in


your history; remember its
number
Type !## and press e

6 Enter ls /usr

Where ## is the commands number. BASH


reruns that command.
To list the files in the /usr directory.
But dont press Enter yet. Make sure theres a
space after the last letter.

Press a .

(Press Alt and the period key.) BASH repeats


the last argument from your previous command.

PR

Type ls -l and press q

Press e

7 Enter echo $RANDOM


A few times, type !! and press
e

To run the ls -l /usr command.


BASH prints a random number to your screen.
To rerun the command. The number should be
different each time.

8 Type ls /usr; ls /dev; ls /home;


Press e

To run the list of three commands.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux
9 Type cd /home/bogus; ls;

To attempt to switch to a nonexistent directory


then list its contents.
BASH outputs a warning that the directory
doesnt exist, then outputs a list of the files in
your current directory.

Press e

219

10 Type cd /home/bogus && ls


Press e

BASH outputs a warning that the directory


doesnt exist. But, then it stops. Because the first
command failed, the second isnt executed.

Again, BASH tells you the directory doesnt


exist, then lists your current directory.

12 Type cd /usr/g

But dont press Enter yet.

IE

11 Repeat the preceding command,


substituting || for && in the list

Press t

BASH completes your statement, assuming you


mean games, since thats the only directory in
usr that begins with g.

Press e

To run the command.

But dont press Enter yet.

EV

13 Type cd /b
Press t

BASH cant complete your statement, because


theres more than one directory in the root
whose name begins with a B.

Press t

After pressing Tab a second time, BASH


displays a list of all the directories beginning
with B.

Type i, press t, and press


e

To change to the /bin directory.

14 Type g

But dont press Enter yet.


BASH asks, Display all 181 possibilities? and
prompts you to enter yes or no. Tab
completion searches commands, files, and
directories when attempting to complete your
entry. In this case, there are many shell
commands that begin with the letter g.

Type n

To display fewer than all of the possibilities.

Press j

You wont enter this command.

PR

Press tt

15 Enter cd ~

To return to your home directory.

16 Enter clear

To clear the screen in preparation for the next


activity.

NOT FOR PRINTING OR INSTRUCTIONAL USE

220

CompTIA Linux+ Certification, Powered by LPI

Piping and redirecting


Explanation

Piping

You can use the output of one command as input to another command. You can also use
text in a file as input for a command rather than typing in required text. You can even
control the output of a command so that its sent to a device other than your screen, such
as to a printer. Collectively, these techniques are called piping and redirection.

Piping is the process of sending the output of one command, or a group of commands,
to another command, which performs some sort of manipulation of that information.
You pipe output using syntax similar to this:
command1 | command2

IE

The output of command 1 becomes the input to command 2. A very common use of
piping is to control the output of a command, such as cat, when that output fills more
than one screen. For example:
cat longfile.txt | more

In this command, the contents of longfile.txt are sent to the more command, which
prints that content to the screen one screenful at a time. Unlike Windows, you can use
the simpler more longfile.txt statement to accomplish the same thing. But the
example still illustrates the use of piping.

EV

Redirecting

Redirecting, or redirection, is similar to piping, except that instead of sending the output
to another program, you send the output to another file or device. For example, the
following command would send the contents of longfile.txt to the printer attached to
/dev/lp0.
cat longfile.txt > /dev/lp0

Redirection can be performed the other way. Lets say you want to automate the transfer
of a file to an FTP server. Typically, you enter a series of commands such as these:
1. ftp e
2. open ftp.example.com e
3. your_username e
4. your_password e
5. lcd ~/localfolder/ e
6. cd ~/serverfolder/ e
7. binary e
8. put myfile.tar.gz e
9. exit e

PR

Briefly explain each of


these commands.

Exhibit 2-6: A sample FTP session


Each time you want to transfer this file, you need to type the same set of commands.
You can use redirection to automate most of this. The exception is that you still need to
enter your password. To start, you create a text file containing all but lines 1 and 3, as
shown in Exhibit 2-6. From then on, to transfer your file, you enter:
ftp < ~/mybackup.txt

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

221

Youre prompted to enter your password. Then, one by one, each line in your text file is
redirected to the ftp command, just as if youd typed in the text yourself.
STDIN, STDOUT, and STDERR

STDIN is the standard input device, which in most cases is your keyboard. In some
Linux implementations, however, STDIN might be something else. Consider Linux
running on a tablet computer with a touchscreen and no keyboard. In such a case, the
touchscreen is likely configured as STDIN and treated much like mouse input.
STDOUT is the standard output device. On modern computers, STDOUT is typically
the monitor. Historically, a line printer or modem was more likely to be the standard
output device.

IE

STDERR is the standard error device, to which the operating system and commands
send error messages. Typically, STDERR is the monitor, but as with STDOUT it used
to be a line printer or modem. STDERR can be configured to go to a nonexistent device,
such as /dev/null, so that error messages arent visible.
Many Linux commands, such as echo, read input from STDIN. Normal output from
these programs is sent to STDOUT. Using piping and redirection, you can temporarily
override these normal input and output locations.
Redirecting STDERR

EV

To override where error messages are sent, you must use a special form of piping and
redirecting. Lets say you want to send the error messages from a fictional program
called someprogram to a file named error log. Youd use a command statement like the
following:
./someprogram 2> error.log

This command says, in essence, to take the output sent to line 2, which is the error
output, and redirect it to the error.log file. The line 1 output, which is the standard
output, is sent to its normal destination (STDOUT). You could send the output of both
lines to the file with this statement:
./someprogram 2&> error.log

The next trick involves using the tee command. It takes the text from STDIN and
writes it to a file you specify. You can use tee to direct output to both a file and the
screen. For example:

PR

./someprogram 2>&1 | tee error.log

NOT FOR PRINTING OR INSTRUCTIONAL USE

Do it!

CompTIA Linux+ Certification, Powered by LPI

B-3:

Exploring piping and redirection

Heres how

Heres why

1 Enter ls /dev

BASH outputs a list of all the files in the /dev


directory. There are many, and the list more than
fills your screen.

222

This time, the output is piped through the more


command, which displays the resulting list one
screenful at a time.

Press q

To advance one screenful of information.

Press Q

To quit the listing and immediately return to the


command prompt.

2 Enter ls

3 Enter

IE

Enter ls /dev | more

tee getdebianinfo

To view a directory listing. There shouldnt be a


file named contact_info.txt in your home
directory.
To begin creating a file named getdebianinfo.
The tee command copies your input at the
keyboard to the file you specify.

EV

Type each of the following lines,


pressing Enter after each line
open ftp.debian.org
anonymous
cd /debian/doc
get bug-reporting.txt
exit

Press c + C

To quit editing and save the file.


To print the contents of the file to your screen.

5 Enter ftp < getdebianinfo

To run the FTP command, piping the contents of


your text file to that command.

PR

4 Enter cat getdebianinfo

Enter your e-mail address

6 Enter ls

Enter cat bug-reporting.txt

When prompted. Anonymous FTP connections


use your e-mail address as the password.
The bug-reporting.txt file should be present in
your home directory.
The contents of the file are displayed.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux
7 Enter cat nonexistent.file

223

As its name suggests, theres no file by that


name, so you see an error message on the
screen.

Enter cat nonexistent.file 2> error.log

This time, you see nothing on the screen. The


error message has been redirected from
STDERR to the error.log file.

8 Enter rm error.log

To delete the file in preparation for the next


step.

IE

9 Enter cat nonexistent.file 2>&1 | tee error.log

The error message is output to your screen.


The error message was also written to the file.

PR

EV

Enter cat error.log

NOT FOR PRINTING OR INSTRUCTIONAL USE

224

CompTIA Linux+ Certification, Powered by LPI

Named pipes
Explanation

In the preceding section, you saw an example of a pipe. For example:

cat longfile.txt | more

With that command, BASH runs both the cat and more programs at the same time,
directing one to send its output to the structure called a pipe, while directing the other to
read from that pipe, as if the pipe were a file. In essence, a pipe is a special kind of file.
In this case, its an unnamed file set up temporarily by BASH for the duration of the
execution of these commands.
You can also create a persistent pipe in the form of a named pipe. Just as with the
unnamed pipes you used already, named pipes are conduits between applications. They
exist as actual files on your disk and remain until you remove them.

IE

Both named and unnamed pipes are FIFO cache, meaning the first byte in is the first
byte out. Practically, this means that, even though a named pipe is a file on your disk,
data sent to a named pipe is never stored on your disk and takes no space. To work, both
programs must be running and looking to the pipe for output or input. As one program
writes a byte to the pipe, the other reads it from the pipe.
You create a named pipe with the mkfifo command. For example:
mkfifo pipe_name

EV

On some systems, particularly older Linux versions, you use the mknod command
instead of mkfifo. If both are available, mkfifo is the preferred method for creating
named pipes. See the man pages for information on using mknod on your distro.

Once created, you can send output from one command to the pipe and direct another
program to read from the pipe. For example, lets say you create a pipe with this
command:
mkfifo mypipe

Next, in the same terminal window, you execute this command:


ls -F > mypipe

Then, you open a new terminal window and enter this command:
cat < mypipe

PR

The file listing created by the ls command is sent to the pipe file named mypipe. In the
other window, the cat reads the mypipe file, as if it were an ordinary file, and outputs
its contents, in this case the file listing, to the screen.

Actually, the order you run the ls and cat commands doesnt matter. The cat
command stops its output when it reaches the end of a file. Basically, it keeps writing
new bytes of data as they arrive in the pipe, just as if it were dealing with an enormous
file. It finally stops when the ls command finishes.
Named pipes are useful when writing shell scripts (mini-programs you write using shell
commands). Theyre also useful to programmers writing applications. You probably
wont use named pipes too often in everyday situations. But there are times they come
in handy.
Lets say you have a program that converts MP3 files to WAV files. And you have a
program that burns WAV files to a CD. To burn a set of MP3 files to a disc, you could
convert the MP3 files to WAV files, then burn the WAV files to disc. But youd need an
extra 700 MB or so of disk space to store the WAV files during the operation. And you
would have to perform the two parts of the operation individually.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

225

Do it!

B-4:

Instead, you could set up a named pipe and funnel the output of the MP3-to-WAV
converter into the pipe. Youd direct your CD burner to read from the pipe, as if the
named pipe were a WAV file ready for burning. As each converted byte went in, it
would come out as input to the burner application. The converted files would never
actually be stored on your hard drive, eliminating the need for temporary storage space.
Of course, youd need a computer fast enough to convert the MP3 files, pass the bytes
through the named pipe, and write the resultant WAV files to the CD all at the same
time. Most modern PCs would be able to handle such an arrangement.

Exploring named pipes

Heres how

To create a named pipe called mypipe. (Older


systems used mknod instead of mkfifo.)

IE

1 Enter mkfifo mypipe

Heres why

2 Enter

To output a directory listing to the pipe.

ls /var/log -F > mypipe

3 Open a second terminal window


4 Enter cat < mypipe

The command outputs the directory listing you


specified in the other terminal.

EV

5 Close the second terminal window

To remove (delete) the pipe file.

PR

6 Enter rm mypipe

NOT FOR PRINTING OR INSTRUCTIONAL USE

226

CompTIA Linux+ Certification, Powered by LPI

Getting help
As you probably know, there are hundreds of BASH commands. Many applications and
services add even more commands for you to learn and use. How can you know all
these commands, their options, and arguments?

Explanation

Fortunately, most Linux distributions include various help tools to make finding such
information easier. You can often turn to the Internet for articles, blog posts, and
examples.
man pages

EV

IE

Linux documentation is typically delivered through man pages, short for manual pages.
To read the documentation on a particular command, enter man followed by the
command name. Syntax and explanatory information about the command will display
on your screen.

Exhibit 2-7: The man page for the ftp command

Each man page includes sections, a few of the more important of which are:

PR

Namestates the commands name and a short description of its purpose.


Synopsisgives the syntax of the command, its options, and arguments.
Descriptionprovides a full description of the command and its purpose.
Options and arguments are described in detail in this section.

The output of a man page is shown one screen at a time. Press Enter to advance one line
or Spacebar to advance one screen. With some distros, you can also use the Page Up
and Page Down keys to move through the screens of information. When you reach the
end of a man page, further presses of the Spacebar or Enter keys dont do anything.
Press the Q key at any time to exit the man page.

Sections

Linux commands are categorized by sections in the man page database depending on
the purpose of the command. The following table lists the man page sections and the
types of commands each contains.

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux
Command types and purposes

User level programs and shell commands

Linux system calls (kernel functions)

Library functions

Special files (usually found in /dev)

File formats and file conventions, such as documenting the /etc/passwd file

Games

Miscellaneous entries, including macro packages

8
9

Section

IE

The section number is


output following the
commands name on the
first line of a man pages
output.

227

Programs and commands that only the root user may execute
Nonstandard kernel routines

Not all distributions use the exact same categorization scheme. You can find out your
systems man structure by viewing the man pages for the man command (enter man
man).

EV

Sometimes the same keyword is used for both a command and something else, such as a
library routine, so that there are two man page entries. For example, locale is both a
shell command and a file used within programs. It has two man page entries: one in
section 1 and one in section 7.
By default, man displays the lowest-number section page first. So, if you type man
locale, the section 1 man page displays. To display a page from a higher section, include
that number in your command. For example:
man 7 locale

Info pages

Novice users in particular find man pages complex and hard to follow. An alternative,
the info pages, were created to provide simpler instructions more suited to end-users and
beginners.

PR

The info and man pages work similarly, though perhaps differently enough to be a bit
frustrating. While viewing an info page, you press Spacebar to view the next page full
of information. With some distros, you can also use the Page Up and Page Down keys
to move through the screens of information. Pressing Enter activates a cross-reference,
if one exists, rather than advancing the display by a single line as with man pages. Also
unlike man pages, when you reach the end of an info page, pressing Spacebar again
returns you to the beginning of the page. But, like man pages, you press the Q key to
exit the info page.
Some info pages begin with copyright or other information not directly germane to
getting help with a command. You have to press Spacebar as necessary to bypass these
screens.

NOT FOR PRINTING OR INSTRUCTIONAL USE

228

CompTIA Linux+ Certification, Powered by LPI


Command help

Some commands, in particular many of the BASH shell commands, provide syntax help
in addition or instead of a man or info page. You can access this syntax summary in one
of two ways:
help echo
ls --help

The first of the preceding statements prints syntax help for the echo command. The
second displays such help for the ls command. Unfortunately, the reverse doesnt
work: entering echo --help results in outputting the characters --help to your screen.

Do it!

B-5:

IE

If you enter help by itself, you get a list of commands for which help pages are
available. If you dont see a command listed in that output, you can try using the
--help command-line option instead. Or, you can simply try your favorite method. If it
doesnt work, try the other.

Getting help

Heres how

1 At the prompt, enter ls --help

Heres why

To view command-line help for the ls command.


It overfills your screen.
To view the output one screen at a time.

Press Q

To quit from more.

EV

Enter ls --help | more

Enter help ls

You receive a message that no help is available.

2 Enter whatis echo

The whatis command tells you that echo


displays a line of text (to your screen).

3 Enter help echo

To get command help for the echo command.

Enter echo --help

The text --help is output to your screen. You


have to use the help command with echo.

Enter echo Hello world

To display Hello world to your screen.

PR

4 Enter man ls

To view the man page for the ls command. You


get a one-line description, then further
information, including the various options and
arguments permitted with this command.

Press e

To advance the display one line.

Press q

To advance the display one screen.

Press Q

To quit viewing this man page and return to the


prompt.

5 Enter man locale

To view information on the locale command.

Press Q

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

Press Q

To view information about the locale.h


programming library. The names of these
utilities are the same. Because they serve
different purposes, theyre in separate man page
sections.

6 Enter man 7 locale

229

7 Open a second terminal window

Arrange the windows so that you


can see as much as possible of
both at the same time

You can also open each on its own virtual


desktop.

IE

8 In the new terminal window, view


the man page for the gzip
command

In the first terminal window, enter

To view the info page for the gzip command.

info gzip

Compare the output produced by


each command

EV

In both, use the Spacebar to


advance screens

In both windows, press Q

It doesnt matter which one you close.

PR

9 Close both terminal windows

To quit the display.

NOT FOR PRINTING OR INSTRUCTIONAL USE

230

CompTIA Linux+ Certification, Powered by LPI

Unit summary: Using Linux


In this topic, you learned that Linux operates independently of its graphical user
interface (GUI). You learned that there are various GUI environments available,
including GNOME, KDE, and Xfce. You used the command line interface (CLI) and
explored the basics of the GUI environment.

Topic B

In this topic, you learned that shells provide the command line interface to Linux. The
default CLI shell for Linux is the BASH shell. You used various commands to interact
with your system. You also used various BASH shell techniques to re-execute previous
commands, edit commands, and pipe and redirect input and output from commands.
Finally, you explored the various help systems, including man pages, info pages, and
command-line help options.

IE

Review questions

Topic A

1 True or false? In Linux, the GUI is tightly integrated with the operating system,
making it difficult to change.
False. GUIs interact with the X Windows system so that you can easily switch between GUIs in a
way not possible with many other operating systems.

2 True or false? In Linux, the command-line interface operates as a component of the


GUI.

EV

False. The CLI interacts directly with the operating system and doesnt rely on any GUI
components.

3 In GNOME, bars at the top or bottom of the screen are called _______.
panels

4 Name three desktop environments for Linux.

GNOME, KDE, and Xfce are the most popular. But the list also includes environments such as
Enlightenment, Fluxbox, Blackbox, and Ratpoison.

5 The default desktop environment for Debian, Fedora, and Ubuntu is _______.
GNOME

6 True or false? You can install both GNOME and KDE on the same Linux system.

PR

True

7 For an older or modestly configured computer, which desktop environment would


be best suitedGNOME, KDE, or Xfce?
Xfce

8 Name at least two common Linux shells.


Answers may include BASH, TC shell, Z shell, and the public domain Korn shell.

9 True or false? Linux commands are case-sensitive.


True

10 Whats the command to print the contents of a file to the screen?


cat

11 Whats the command to print the contents of a directory to the screen?


ls

NOT FOR PRINTING OR INSTRUCTIONAL USE

Using Linux

231

12 With the ________ command, you can determine whos logged onto your system.
who

Press Shift+Page Up

13 Whats the keystroke combination you use to scroll up to view information that has
scrolled off your screen?
14 What the keystroke combination you use to repeat the last argument from the
previous command?
Press Alt+period

15 Whats the command to print a list of previous commands to the screen?


history
Enter !!

IE

16 Whats the command to repeat the command you just executed?

17 True or false? Once youve logged off, the list of your prior commands is erased, so
that its unavailable the next time you log on.
False. Prior commands are saved to the .bash_history file in your home directory, so that theyre
available the next time you log on.

18 Youre helping a user and want to change the working directory to her home
directory. What command do you use?

EV

Type cd ~ and press Enter.

19 You want to determine how long your computer has been running. You can enter
upt and press the ______ key to get BASH to finish the command for you.
Tab

20 Piping uses the ______ of one command as ______ for a second command.
output, input

21 True or false? You can use redirection to send a collection of inputs automatically to
a command.
True

PR

22 Whats the help command used to display technical information best suited for
experienced users and administrators?
man

23 Whats the help command used to display information best suited for end users?
info

24 True or false? The apropos and man - k commands are equivalent.


True

25 To get command syntax help, you enter help command_name or _______.


command_name --help

NOT FOR PRINTING OR INSTRUCTIONAL USE

232

CompTIA Linux+ Certification, Powered by LPI

Independent practice activity

1 Open OpenOffice Calc.

To explore how a graphical user interface makes tasks easier, youll explore the
OpenOffice Calc program. Then, youll practice some shell commands.

EV

IE

2 Using Exhibit 2-8 as a reference, create a basic spreadsheet. Use the buttons and
menus to format your spreadsheet to approximate the exhibit.

Exhibit 2-9: A sample spreadsheet in OpenOffice Calc


3 Save the spreadsheet to your home directory.
4 Close OpenOffice Calc.

PR

5 Open a terminal (shell) window.

6 Explore the cal command: try entering it; use the help systems to determine its
purpose and command options.
7 Explore the find command: try entering it; use the help systems to determine its
purpose and command options.

8 Explore the sudo command: try entering it; use the help systems to determine its
purpose and command options.

9 Close the terminal window.

10 Log out.

NOT FOR PRINTING OR INSTRUCTIONAL USE

You might also like