World Headquarters

Jones & Bartlett Learning

25 Mall Road

Burlington, MA 01803

978-443-5000

info@jblearning.com

www.jblearning.com

Jones & Bartlett Learning books and products are available through most bookstores and online booksellers. To contact Jones & Bartlett Learning directly, call 800-832-0034, fax 978-443-8000, or visit our website, www.jblearning.com.

Substantial discounts on bulk quantities of Jones & Bartlett Learning publications are available to corporations, professional associations, and other qualified organizations. For details and specific discount information, contact the special sales department at Jones & Bartlett Learning via the above contact information or send an email to specialsales@jblearning.com.

Copyright © 2023 by Jones & Bartlett Learning, LLC, an Ascend Learning Company

All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without written permission from the copyright owner.

The content, statements, views, and opinions herein are the sole expression of the respective authors and not that of Jones & Bartlett Learning, LLC. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not constitute or imply its endorsement or recommendation by Jones & Bartlett Learning, LLC and such reference shall not be used for advertising or product endorsement purposes. All trademarks displayed are the trademarks of the parties noted herein. Linux Fundamentals, Second Edition is an independent publication and has not been authorized, sponsored, or otherwise approved by the owners of the trademarks or service marks referenced in this product.

There may be images in this book that feature models; these models do not necessarily endorse, represent, or participate in the activities represented in the images. Any screenshots in this product are for educational and instructive purposes only. Any individuals and scenarios featured in the case studies throughout this product may be real or fictitious but are used for instructional purposes only.

25580-5

Production Credits

Vice President, Product Management: Marisa R. Urbano

Vice President, Content Strategy and Implementation: Christine Emerton

Director, Content Management: Donna Gridley

Manager, Content Strategy: Carolyn Pershouse

Technical Editor: Ric Messier

Content Strategist: Melissa Duffy

Content Coordinator: Mark Restuccia

Director, Project Management and Content Services: Karen Scott

Manager, Project Management: Jackie Reynen

Project Manager: Dan Stone

Senior Digital Project Specialist: Angela Dooley

Marketing Manager: Mark Adamiak

Content Services Manager: Colleen Lamy

VP, Manufacturing and Inventory Control: Therese Connell

Product Fulfillment Manager: Wendy Kilborn

Composition: Straive

Project Management: Straive

Cover Design: Briana Yates

Text Design: Kristin E. Parker

Media Development Editor: Faith Brosnan

Rights & Permissions Manager: John Rusk

Rights Specialist: James Fortney

Cover Image (Title Page, Part Opener, Chapter Opener): © Picsfive/Shutterstock

Printing and Binding: Gasch Printing

Library of Congress Cataloging-in-Publication Data

Names: Blum, Richard, 1962- author.

Title: Linux fundamentals / Richard Blum.

Description: Second edition. | Burlington, Massachusetts : Jones & Bartlett Learning, [2023] | Includes bibliographical references and index.

Identifiers: LCCN 2022023562 | ISBN 9781284254884 (paperback)

Subjects: LCSH: Linux. | Operating systems (Computers)

Classification: LCC QA76.774.L46 B66 2023 | DDC 005.4/46--dc23/eng/20220714

LC record available at https://lccn.loc.gov/2022023562

6048

Printed in the United States of America

26 25 24 23 22 10 9 8 7 6 5 4 3 2 1

To all the teachers, coworkers, students, friends, and Internet posters who continue to teach me new things every day.

“An intelligent heart acquires knowledge, and the ear of the wise seeks knowledge.” Proverbs 18:15 (ESV)

© Picsfive/Shutterstock

Contents

Preface

Acknowledgments

About the Author

CHAPTER 1 Linux Basics

What Is Linux?

The Linux Kernel

System Memory Management

Software Program Management

Hardware Management

Filesystem Management

The GNU Utilities

Linux User Interfaces

The X Window System

The KDE Plasma Desktop

The GNOME Desktop

Other Linux Desktops

The Command Line Interface

Linux Distributions: Why So Many?

Core Linux Distributions

Derivative Linux Distributions

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 1 ASSESSMENT

CHAPTER 2 Linux and Software

Popular Linux Applications

Desktop Applications

Server Applications

Exploring Package Management

Exploring the Debian-Based Systems

The Red Hat–Based Systems

Managing Software Using Containers

Using Snap Containers

Using Flatpak Containers

Installing from Source Code

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 2 ASSESSMENT

CHAPTER 3 Linux and Hardware

Device Driver Modules

Listing Installed Modules

Installing New Modules

Removing Modules

Communicating with Linux Devices

Device Interfaces

The /dev Directory

The /proc Directory

The /sys Directory

Working with Devices

Finding Devices

Working with PCI Cards

Working with USB Devices

Using Hot Pluggable Devices

Detecting Dynamic Devices

Working with Dynamic Devices

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 3 ASSESSMENT

References

CHAPTER 4 Booting Linux

The Linux Boot Process

Following the Boot Process

Viewing the Boot Process

The Firmware Startup

The BIOS Startup

The UEFI Startup

Linux Boot Loaders

GRUB Legacy

GRUB2

Alternative Bootloaders

Process Initialization

The SysVinit Method

The Systemd Method

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 4 ASSESSMENT

CHAPTER 5 Disk Management

Storage Basics

Drive Connections

Partitioning Drives

Automatic Drive Detection

Partitioning Tools

Working with fdisk

Working with gdisk

The GNU Parted Command

Graphical Tools

Understanding File Systems

The Virtual Directory

Maneuvering Around the File System

Formatting File Systems

Common File System Types

Creating File Systems

Mounting File Systems

Manually Mounting Devices

Automatically Mounting Devices

Managing File Systems

Retrieving File System Stats

File System Tools

Storage Alternatives

Multipath

Logical Volume Manager

Using RAID Technology

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 5 ASSESSMENT

CHAPTER 6 Command Line Basics

The Linux Shell

Types of Shells

Starting the Shell

The Shell Command Prompt

Accessing the Command Line

Using Virtual Terminals

Terminal Emulation

Shell Basics

Commands

Getting Help

Running Multiple Commands

Redirecting Input and Output

Output Redirection

Input Redirection

Pipes

Linux Environment Variables

Global Environment Variables

Local Environment Variables

Setting Environment Variables

Removing Environment Variables

Writing Shell Scripts

Getting Started

Displaying Messages

Using Variables

Command Line Arguments

Command Substitution

Logic Statements

Looping

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 6 ASSESSMENT

References

CHAPTER 7 File Management

Filesystem Navigation

The Linux Filesystem

Traversing Directories

Linux Files

Determining File Types

File Names

Hidden Files

File Inodes

File and Directory Listing

Basic Listing

Modifying Listing Information

The Complete Parameter List

Directory Handling

Creating Directories

Deleting Directories

File Handling

Creating Files

Copying Files

Linking Files

Renaming Files

Deleting Files

File Features

Using Wildcards

Quoting

Case Sensitivity

Finding Files

The which Command

The locate Command

The whereis Command

The find Command

Archiving Files

Compressing Files

Creating Archive Files

Archiving Scenarios

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 7 ASSESSMENT

Resources

CHAPTER 8 Networking Concepts

Configuring Network Features

Network Configuration Files

Using Graphical Tools

Using Command-Line Tools

Basic Network Troubleshooting

Sending Test Packets

Finding Host Information

Advanced Network Troubleshooting

The netstat Command

Examining Sockets

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 8 ASSESSMENT

Resources

CHAPTER 9 Managing Processes

Looking at Processes

Monitoring Processes in Real Time

Managing Processes

Setting Priorities

Stopping Processes

Running Programs in Background Mode

Running in the Background

Running Multiple Background Jobs

Running Programs Without a Console

Job Control

Viewing Jobs

Restarting Stopped Jobs

Scheduling Jobs

Scheduling a Job Using the at Command

Scheduling Recurring Programs

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 9 ASSESSMENT

Resources

CHAPTER 10 Advanced Administration

User Management

Examining User Accounts

Accessing Administrator Privileges

Working with Groups

Managing User Accounts

Linux File and Directory Permissions

Understanding Ownership

Changing File or Directory Ownership

Changing the File or Directory Group

Controlling Access Permissions

Exploring Special Permissions

Managing Default Permissions

Advanced Access Control Lists

Managing the Date and Time

Setting the Date and Time Manually

Synching the Time Automatically

Setting the Time Zone

Printer Administration

Configuring CUPS

Using LPD Commands

Using Linux Printer Drivers

Email Administration

Describing Linux Email Architecture

Identifying Linux Email Servers

Using Linux Email Clients

Redirecting Email

Secure Login

Using OpenSSH

Using SSH Keys

Using SSH for Logins

Encrypting Files

Log Files

Using syslogd

Using Systemd-journald

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 10 ASSESSMENT

Resources

CHAPTER 11 Linux Security

Working with Root Access

Gaining Super User Privileges

Determining Your Privilege Elevation Status

Keeping Track of Root Logins

Disabling Root Access from SSH

Enabling Automatic Logout

Blocking Root Access

Context-Based Permissions

Using SELinux

Encrypting Partitions

Network Security Using Firewalls

Red Hat Firewall Concepts

Checking the Firewall Status

Working with Zones

Working with Firewall Rules

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 11 ASSESSMENT

Resources

CHAPTER 12 Linux in the Cloud

Taking a Look at the Cloud

What Is Cloud Computing?

What Are the Cloud Services?

Understanding Virtualization

Hypervisors

Types of Hypervisors

Hypervisor Templates

Exploring Containers

What Are Containers?

Container Software

Container Templates

Using Containers

Creating the Container

Automating the Container

Agent and Agentless Containers

Monitoring Containers

Container Orchestration Engines

Kubernetes

Docker Swarm

Mesos and Marathon

Understanding DevOps Concepts

DevOps Procedures

DevOps Container Attributes

CHAPTER SUMMARY

KEY CONCEPTS AND TERMS

CHAPTER 12 ASSESSMENT

Resources

APPENDIX A Answer Key

Glossary

Index

© Picsfive/Shutterstock

Preface

The Linux world is constantly changing, requiring new knowledge and skills to work as a Linux system administrator. This second edition of Linux Fundamentals not only updates the first edition with new material, but also changes the book’s focus a bit, from a basic approach to Linux to a more advanced server-oriented look at using Linux. While the first edition tracked the skills needed to meet the LPI Linux Fundamentals exam requirements, this edition tracks the more advanced CompTIA Linux+ exam requirements.

The CompTIA Linux+ exam is oriented toward having the skills needed to work as a Linux system administrator in a commercial Linux server environment. Thus, this edition dives deeper into the Linux server environment, covering the commands you are expected to know for the Linux+ exam. In the examples I use both Red Hat and Debian-based Linux distributions so you will have experience working in both of those Linux server environments.

The updated chapters provide expanded coverage on how to manage users, files, devices, and filesystems in a multi-user networked server environment. In these dangerous times, nothing is more important than having a secure Linux system. This edition adds a new chapter focusing on Linux security. It covers the popular SELinux and AppArmor tools for implementing mandatory access control to files, as well as providing tips on using encryption and firewalls to keep your data safe both on and off the network.

Finally, this second edition ends with a brief look at the popular topics of virtualization, containers, and orchestration. These have become hot topics in the IT world, and Linux has played an important role in each of these technologies. The final chapter provides an overview of just how to use these technologies in a Linux environment.

© Picsfive/Shutterstock

Acknowledgments

First, all glory and praise go to God, who through His Son, Jesus Christ, makes all things possible and gives us the gift of eternal life.

Many thanks go to the fantastic team of people at Jones & Bartlett Learning for their outstanding work on this project. Thanks to Ned Hinman for offering me the opportunity to update the first edition of this book, and to Melissa Duffy, the Content Strategist, for her skills in guiding this book through the entire process. It’s been a pleasure working with you and your team! Also, special thanks goes to Ric Messier, fellow Linux author, for taking the time out of his schedule to be the book’s Tech Editor. I am grateful for your excellent suggestions to help make this a better book. I would also like to thank Carole Jelen at Waterside Productions, Inc., for arranging this opportunity for me and helping me out with my writing career.

Finally, I would like to thank my wife Barbara for her patience and the life-sustaining baked goods she prepared to help me keep up my energy while writing!

© Picsfive/Shutterstock

About the Author

RICHARD BLUM, Linux+ ce, has worked in the IT industry for more than 35 years as both a systems and a network administrator. During that time he’s had the opportunity to work with lots of different computer products, including many different flavors of UNIX, and of course, Linux. Over the years he’s also volunteered for several nonprofit organizations to help support small networks that had little financial support. Rich is the author of many Linux-based books for total Linux geeks, and teaches online courses in Linux and web programming. When he’s not busy being a computer nerd, Rich enjoys playing piano and bass guitar and spending time with his wife, Barbara, and two daughters, Katie and Jessica.

© Picsfive/Shutterstock

CHAPTER 1

Linux Basics

THE LINUX OPERATING SYSTEM HAS become one of the most widely used operating systems, popular among researchers, application developers, and hobbyists alike. These days, the Linux operating system can be found in a variety of computer environments, from mobile phones to satellites.

This chapter examines just what the Linux operating system is and why there are so many different Linux distributions available to choose from. With this information, you can select the right Linux distribution for your environment.

CHAPTER 1 TOPICS

This chapter covers the following topics and concepts:

- What Linux is

- What the Linux kernel is

- What the GNU utilities are

- Why there are different Linux desktop environments

- What the Linux shell is, and what it allows you to do

- What a Linux distribution is and why there are so many of them

CHAPTER 1 GOALS

When you complete this chapter, you will be able to:

- List the components of a standard Linux system

- Explain how GNU utilities are used within Linux

- Describe the different user interfaces available for Linux

- Explain why there are different Linux distributions and list the major ones

What Is Linux?

If you’ve never worked with Linux before, you may be confused as to why there are so many different versions of it available. You’ve most likely heard terms such as distribution, LiveDVD, and GNU when looking at Linux packages and may have been confused. This section takes some of the mystery out of the Linux system before you start working on diving into Linux commands and features.

Although people usually refer to the Linux operating system as just “Linux,” in reality quite a few parts make up a complete Linux system. The Linux system has four main parts:

- The Linux kernel

- The GNU utilities

- A user interface

- Application software

Each of these four parts has a specific job in the Linux system. Although each of the parts by itself isn’t very useful, put together, they all create what people refer to as “Linux.” FIGURE 1-1 shows the basic diagram of how these parts fit together to create the overall Linux system.

FIGURE 1-1 The Linux system.

Description

The following sections describe these four parts in detail and give you an overview of how they work together to create a complete Linux system.

The Linux Kernel

The core of the Linux system is the kernel. The kernel controls all of the hardware and software on the computer system, providing access to hardware when necessary, and executing software when required.

If you’ve been following the Linux world at all, no doubt you’ve heard the name Linus Torvalds. Linus is the person responsible for creating the first Linux kernel software while he was a student at the University of Helsinki. He intended it to be a copy of the Unix system, at the time a popular operating system used at many universities.

After developing the Linux kernel, Linus released it to the Internet community and solicited suggestions for improving it. This simple process started a revolution in the world of computer operating systems. Soon Linus was receiving suggestions from students as well as professional programmers from around the world.

Allowing anyone to change programming code in the kernel would result in complete chaos. To simplify things, Linus acted as a central point for all improvement suggestions. It was ultimately Linus’s decision whether or not to incorporate suggested code in the kernel. This same concept is still in place with the Linux kernel code, except that instead of just Linus controlling the kernel code, a team of developers has taken on the task.

The kernel is primarily responsible for four main functions:

- System memory management

- Software program management

- Hardware management

- Filesystem management

The following sections explore each of these functions in more detail.

System Memory Management

One of the primary functions of the operating system kernel is memory management. Memory management is the ability to control how programs and utilities run within the memory restrictions of the system. Not only does the kernel manage the physical memory available on the server, it can also create and manage virtual memory, or memory that doesn’t actually exist but is created on the hard drive and treated as real memory.

It does this by using space on the hard disk called the swap space. The kernel swaps the contents of virtual memory locations back and forth from the swap space to the actual physical memory. This allows applications to think there is more memory available than what physically exists (as shown in FIGURE 1-2).

FIGURE 1-2 The Linux system memory map.

The memory locations are grouped into blocks called pages. The kernel locates each page of memory either in the physical memory or the swap space. The kernel then maintains a table of the memory pages that indicates which pages are in physical memory and which pages are swapped out to disk.

The kernel keeps track of which memory pages are in use and automatically copies memory pages that have not been accessed for a period of time to the swap space area (called swapping out)—even if there’s other memory available. When a program wants to access a memory page that has been swapped out, the kernel must make room for it in physical memory by swapping out a different memory page and swapping in the required page from the swap space. Obviously, this process takes time and can slow down a running process. The process of swapping out memory pages for running applications continues for as long as the Linux system is running.

You can see the current status of the virtual memory on your Linux system by viewing the special /proc/meminfo file. Here’s an example of a sample /proc/meminfo entry:

Description

The MemTotal and MemFree lines show that this Linux server has 20 GB of physical memory and that there is about 14 GB not currently being used (free). The output also shows that there is about 2 GB of swap space memory available on this system. The kernel continually updates the meminfo file to show exactly what’s going on in memory at that moment in time, so you can always get a picture of what’s happening on the system.

Software Program Management

With the Linux operating system, a running program is called a process. A process can run in the foreground, displaying output on a display, or it can run in the background, behind the scenes. The kernel controls how the Linux system manages all the processes running on the system.

The kernel creates the first process, called the init process, to start all other processes on the system. When the kernel starts, it loads the init process into virtual memory. As the kernel starts each additional process, it gives it a unique area in virtual memory to store the data and code that the process uses.

There are a few different types of init process implementations available in Linux, but these days, two are most popular:

- SysVinit—The SysVinit initialization method was the original method used by Linux and was based on the Unix System V initialization method. Though it is not used by many Linux distributions these days, you still may find it around in older Linux distributions

- Systemd—The systemd initialization method was created in 2010 and has become the most popular initialization and process management system used by Linux distributions.

The SysVinit method

The SysVinit initialization method used a concept called run levels to determine what processes to start. The run level defines the state of the running Linux system, and what processes should run in each state. TABLE 1-1 shows the different run levels associated with the SysVinit initialization method.

TABLE 1-1    SysVinit initialization methods.

RUN LEVEL

DESCRIPTION

0

Shut down the system

1

Single-user mode used for system maintenance

2

Multi-user mode without networking services enabled

3

Multi-user mode with networking services enabled

4

Custom

5

Multi-user mode with GUI enabled

6

Reboot the system

The /etc/inittab file defines the default run level for the system. The processes that start for specific run levels are defined in subdirectories of the /etc/rc.d directory. You can view the current run level at any time using the runlevel command:

This output shows the system is currently at run level 5, which is the default used for graphical desktops.

The systemd method

The systemd initialization method has become popular because it has made several improvements over the original init method. One of those improvements is that it has the ability to start processes based on different events:

- When the system boots

- When a particular hardware device is connected

- When a service is started

- When a network connection is established

- When a timer has expired

The systemd method determines what processes to run by linking events to unit files. Each unit file defines the programs to start when the specified event occurs. The systemctl program allows you to start, stop, and list the unit files currently running on the system.

The systemd method also groups unit files together into targets. A target defines a specific running state of the Linux system, similar to the SysVinit run level concept. At system startup, the default.target target defines all of the unit files to start. You can view the current default target using the systemctl command:

The graphical.target target defines the processes to start when a multi-user graphical environment is running, similar to the old SysVinit run level 5.

Viewing processes

The ps command allows you to view the processes currently running on the Linux system. Here’s an example of what you’ll see using the ps command:

Description

Description

There are lots of processes running on a Linux system at any time; I’ve abbreviated the output to show just a few of the listed processes. The first column in the output shows the process ID (or PID). Notice that the first process is the friendly init process, and the Linux system assigns it PID 1. All other processes that start after the init process are assigned PIDs in numerical order. No two processes can have the same PID.

The third column shows the current status of the process (I for idle, S for sleeping, and R for running). The last column shows the process name. The process names that appear in brackets mean that the ps command couldn’t determine the command line parameters used to start the process.

Hardware Management

Still another of the kernel’s responsibilities is hardware management. Any device that the Linux system must communicate with needs driver code. The driver code allows the kernel to pass data back and forth to the device, acting as a middleman between applications and the hardware. Two methods are used for interfacing device driver code with the Linux kernel:

- Compiling the device driver code with the kernel code

- Compile the device driver code into a separate module, which then interfaces with the kernel during runtime

In the very early days of Linux, the only way to insert device driver code was to recompile the kernel. Each time you added a new device to the system, you had to recompile the kernel code. This process became even more inefficient as Linux kernels supported more hardware and as removable storage devices (such as USB sticks) became more popular. Fortunately, Linux developers devised a better method to insert driver code into the running kernel.

Programmers developed the concept of kernel modules to allow you to insert device driver code into a running kernel without having to recompile the kernel. Also, a kernel module could be removed from the kernel when the system had finished using the device. This greatly simplified using hardware with Linux.

The Linux system represents hardware devices as special files, called device files. There are three different classifications of device files:

- Character

- Block

- Network

A character device file is for a device that can only handle data one character at a time. Most types of modems and terminals are created as character files. A block device file is for a device such as a disk drive that can handle data in large blocks at a time.

The network device file types (also called socket files) are used for devices that use packets to send and receive data. This includes temporary files used to send network data between programs running on the same physical host and a special loopback device that allows the Linux system to communicate with itself using common network programming protocols.

Linux creates special files, called nodes, for each device on the system. All communication with the device is performed through the device node. Each node has a unique number pair that identifies it to the Linux kernel. The number pair includes a major and a minor device number. Similar devices are grouped into the same major device number. The minor device number is used to identify a specific device within the major device group. Here is an example of a few device files on a Linux server:

Description

Different Linux distributions handle devices using different device names. In this distribution, the sda device is the first solid state drive (SSD) on the system.

The fifth column is the major device node number. Notice that all of the sda devices have the same major device node, 8. The sixth column is the minor device node number. Each device within a major number has its own unique minor device node number.

The first column indicates the permissions for the device file. The first character of the permissions indicates the type of file. Notice that the SSD files are all marked as block (b) devices.

Filesystem Management

A filesystem defines how the operating system stores data on storage devices. Unlike some other operating systems, the Linux kernel can support different types of filesystems to read and write data to and from hard drives, CD or DVD devices, and USB flash drives. Besides having over a dozen filesystems of its own, Linux can read and write to and from filesystems used by other operating systems, such as Microsoft Windows. The kernel must be compiled with support for all types of filesystems that the system will use, or device driver modules must be built and installed to support the filesystem. TABLE 1-2 lists the standard filesystems that a Linux system can use to read and write data.

TABLE 1-2    Linux filesystems.

FILESYSTEM

DESCRIPTION

ext

Linux extended filesystem—the original Linux filesystem

ext2

Second extended filesystem, provided advanced features over ext

ext3

Third extended filesystem, supports journaling

ext4

Fourth extended filesystem, supports advanced journaling

btrfs

A newer, high performance filesystem that supports journaling and large files

exfat

The extended Windows filesystem, used for SD cards and USB sticks

hpfs

OS/2 high‐performance filesystem

jfs

IBM’s journaling filesystem

iso9660

ISO 9660 filesystem (CD-ROMs)

minix

MINIX filesystem

msdos

Microsoft FAT16

nfs

Network File System

ntfs

Support for Microsoft NT file system

proc

Access to system information

smb

Samba SMB filesystem for network access

sysv

Older Unix filesystem

ufs

BSD filesystem

umsdos

Unix—like filesystem that resides on top of MS-DOS

vfat

Windows 95 file system (FAT32)

XFS

High‐performance 64‐bit journaling filesystem

Any hard drive that a Linux system accesses must be formatted using one of the filesystem types listed in Table 1-1.

The Linux kernel interfaces with each filesystem using the Virtual File System (VFS).
This provides a standard interface for the kernel to communicate with any type of filesystem. VFS caches information in memory as each filesystem is mounted and used.

The GNU Utilities

Besides having a kernel to control hardware devices, a computer operating system needs utilities to perform standard functions, such as handling files and programs. Although Linus created the Linux system kernel, he had no system utilities to run on it. Fortunately for him, at the same time he was working, a group of people on the Internet were working together trying to develop a standard set of computer system utilities that mimicked the popular Unix operating system.

The GNU organization (GNU stands for GNU’s Not Unix, a clever recursive acronym) developed a complete set of Unix-like utilities but had no kernel system to run them on. These utilities were developed under a software philosophy called open source software (OSS).

The concept of OSS allows programmers to develop software and then release it to the world for use, often with no licensing fees attached. Anyone can use the software, modify it, or incorporate it into his or her own system without having to pay a license fee. Uniting Linus’s Linux kernel with the GNU operating system utilities created a complete, functional, free operating system.

Although the bundling of the Linux kernel and GNU utilities is often just called Linux, you will see some Linux purists on the Internet refer to it as the GNU/Linux system to give credit to the GNU organization for its contributions to the cause.

The GNU Project was mainly designed for Unix system administrators to have a Unix-like environment available. This focus resulted in the project porting many common Unix system commandline utilities. The core bundle of utilities supplied for Linux systems is called the coreutils package.

The GNU coreutils package consists of three parts:

- Utilities for handling files

- Utilities for manipulating text

- Utilities for managing processes

Each of these three main groups of utilities contains several utility programs that are invaluable to the Linux system administrator and programmer.

Linux User Interfaces

Having a world-class operating system that can manage your computer hardware and software is great, but you need some way to communicate with it. With the popularity of Microsoft Windows, desktop computer users expect some type of graphical display to interact with their system. This spurred more development in the OSS community, and the Linux graphical desktops emerged.

Linux is famous for being able to do things in more than one way, and no place is this more relevant than in graphical desktops. There are a plethora of graphical desktops you can choose from in Linux. The following sections describe a few of the more popular ones.

The X Window System

Two basic elements control your video environment—the video card in your workstation and your monitor. To display fancy graphics on your computer, the Linux software needs to know how to talk to both of them.

The X Window software is a lowlevel program that works directly with the video card and monitor in the workstation and controls how Linux applications can present fancy windows and graphics on your computer.

Linux isn’t the only operating system that uses X Window; there are versions written for many different operating systems. In the Linux world, a few different software packages can implement X Window, but two are most commonly used:

- X.org

- Wayland

The X.org package is the older of the two, based on the original Unix X Window System version 11 (often called X11). More Linux distributions are migrating to the newer Wayland software, which is more versatile and easier to maintain.

When you first install a Linux distribution, it attempts to detect your video card and monitor, and then creates an X Window configuration file that contains the required information. During installation, you may notice a time when the installation program scans your monitor for supported video modes. Sometimes this causes your monitor to go blank for a few seconds. Because there are lots of different types of video cards and monitors out there, this process can take a little while to complete.

The core X Window software produces an interface for running graphical applications, but nothing else. While this is fine for running individual applications, it is not too useful for day-to-day computer use. There is no desktop environment allowing users to manipulate files or launch programs. To do that, you need a desktop environment on top of the X Window system software.

The KDE Plasma Desktop

The K Desktop Environment (KDE) was first released in 1996 as an open source project to produce a graphical desktop similar to the Microsoft Windows environment. The
KDE desktop incorporates all of the features you are probably familiar with if you are a Windows user. FIGURE 1-3 shows the current version, called KDE Plasma, running in the openSUSE Linux distribution.

FIGURE 1-3 The KDE Plasma desktop in openSUSE.

Courtesy of KDE.

Description

The KDE Plasma desktop allows you to place both application and file icons in a special area on the desktop. If you click an application icon, the Linux system starts the application. If you click on a file icon, the KDE desktop attempts to determine which application to start to handle the file.

The bar at the bottom of the desktop is called the Panel. The Panel consists of four parts:

- The K menu—Similar to the Windows Start menu, the K menu contains links to start installed applications.

- Program shortcuts—These are quick links to start applications directly from the Panel.

- The taskbar—The taskbar shows icons for applications currently running on the desktop.

- Applets—These are small applications that have an icon in the Panel that can change depending on information from the application.

All of the Panel features are similar to what you would find in Microsoft Windows. Besides the desktop features, the KDE project has produced a wide assortment of applications that run in the KDE environment. These applications are shown in TABLE 1-3. (You may notice the trend of using a capital K in KDE application names.)

TABLE 1-3    KDE applications.

APPLICATION

DESCRIPTION

Amarok

Audio file player

digiKam

Digital camera software

Dolphin

File manager

K3b

CD-burning software

Kaffeine

Video player

KMail

Email client

KOffice

Office applications suite

Konqueror

File and web browser

Kontact

Personal information manager

Kopete

Instant messaging client

This is only a partial list of applications produced by the KDE project. Many more applications are included with the KDE desktop.

The GNOME Desktop

The GNU Network Object Model Environment (GNOME) is another popular Linux desktop environment. First released in 1999, GNOME has become the default desktop environment for many Linux distributions (the most popular being Red Hat Enterprise Linux).

NOTE

The GNOME desktop underwent a radical change with version 3, released in 2011. It departed from the standard look-and-feel of most desktops that use standard menu bars and task bars and instead made the interface more menu-driven so it would be user-friendly across multiple platforms, such as tablets and mobile phones. This change led to controversy, spawning many new desktops that kept the GNOME 2 look.

FIGURE 1-4 shows the standard GNOME 3 desktop used in the Ubuntu Linux distribution.

FIGURE 1-4 A GNOME 3 desktop on an Ubuntu Linux system.

Courtesy of GNOME Project.

Not to be outdone by KDE, the GNOME developers have also produced a host of graphical applications that integrate with the GNOME desktop, as shown in TABLE 1-4.

TABLE 1-4    GNOME applications.

APPLICATION

DESCRIPTION

Epiphany

Web browser

Evince

Document viewer

Gcalctool

Calculator

Gedit

GNOME text editor

GNOME Panel

Desktop panel for launching applications

GNOME Nettool

Network diagnostics tool

GNOME Terminal

Terminal emulator

Nautilus

Graphical file manager

Nautilus CD Burner

CD-burning tool

Sound Juicer

Audio CD–ripping tool

Tomboy

Notetaking software

Totem

Multimedia player

As you can see, quite a few applications are also available for the GNOME desktop. Besides all of these applications, most Linux distributions that use the GNOME desktop also incorporate the KDE libraries, allowing you to run KDE applications on your GNOME desktop.

Other Linux Desktops

One of the main features of Linux is choice, and nowhere is that more evident than in the graphical desktop world. A plethora of different types of graphical desktops are available in the Linux world. If you’re not happy with the default desktop in your Linux distribution, it usually doesn’t take much effort to change it to something else!

When the GNOME desktop project radically changed its interface in version 3, many Linux developers who preferred the look-and-feel of GNOME version 2 created spin-off versions based on GNOME 2. Of these, two became somewhat popular:

- Cinnamon The Cinnamon desktop was developed in 2011 by the Linux Mint distribution in an attempt to continue development of the original GNOME 2 desktop. It’s now available as an option in several Linux distributions, including Ubuntu, Fedora, and openSUSE.

- MATE The MATE desktop was also developed in 2011 by an Arch Linux user who disliked the switch to GNOME 3. However, it incorporates a few features of GNOME 3 (such as replacing the taskbar) but maintains the overall look-and-feel of GNOME 2.

FIGURE 1-5 shows the Cinnamon desktop as it appears in the Linux Mint distribution.

FIGURE 1-5 The Cinnamon desktop from Linux Mint.

Courtesy of Linux Mint.

Description

The downside to these fancy graphical desktop environments is that they require a fair amount of system resources to operate properly. In the early days of Linux, a hallmark and selling feature of Linux was its ability to operate on older, less powerful PCs that the newer Microsoft desktop products couldn’t run on. However, with the popularity of KDE Plasma and GNOME 3 desktops, this has changed because it takes just as much memory to run a KDE Plasma or GNOME 3 desktop as the latest Microsoft desktop environment.

If you have an older PC, don’t be discouraged. The Linux developers have banded together to take Linux back to its roots. They’ve created several low-memory–oriented graphical desktop applications that provide basic features that run perfectly fine on older PCs.

While these graphical desktops don’t have a plethora of applications designed around them, they still run many basic graphical applications that support features such as word processing, spreadsheets, databases, drawing, and, of course, multimedia support.

TABLE 1-5 shows some of the smaller Linux graphical desktop environments that can be used on lower-powered PCs and laptops.

TABLE 1-5    Other Linux graphical desktops.

DESKTOP

DESCRIPTION

Fluxbox

A bare-bones desktop that doesn’t include a Panel, only a pop-up menu to launch applications

Xfce

A desktop that’s similar to the GNOME 2 desktop, but with fewer graphics for low-memory environments

JWM

Joe’s Window Manager, a very lightweight desktop ideal for
low-memory and low-disk space environments

fvwm

Supports some advanced desktop features such as virtual desktops and Panels, but runs in low-memory environments

fvwm95

Derived from fvwm, but made to look like a Windows 95 desktop

These graphical desktop environments are not as fancy as the KDE Plasma and GNOME 3 desktops, but they provide basic graphical functionality just fine. FIGURE 1-6 shows what the Xfce desktop used in the MX Linux distribution looks like.

FIGURE 1-6 The Xfce desktop as seen in the MX Linux distribution.

Courtesy of Linux Foundation.

Description

If you are using an older PC, try a Linux distribution that uses one of these desktops and see what happens. You may be pleasantly surprised.

The Command Line Interface

While having a fancy graphical desktop interface is nice, there are drawbacks. The extra processing power required to interact with the graphics card takes away crucial CPU time that can be used for other programs. Nowhere is this more important than in a server environment.

Because of that, many Linux servers don’t install a graphical desktop by default and instead rely on a text-based interface, called the command line interface (CLI). The CLI provides a way for users to start programs, manage files on the filesystem, and manage processes running on the Linux system using simple text commands. The CLI is produced by a program called a shell. The shell allows you to enter text commands, and then it interprets the commands and executes them in the kernel.

The shell contains a set of internal commands that you use to control things such as copying files, moving files, renaming files, displaying the programs currently running on the system, and stopping programs running on the system. Besides the internal commands, the shell also allows you to enter the name of a program at the command prompt. The shell passes the program name off to the kernel to start it.

You can also group shell commands into files to execute as a program. Those files are called shell scripts. Any command that you can execute from the command line can be placed in a shell script and run as a group of commands. This provides great flexibility in creating utilities for commonly run commands or processes that require several commands grouped together.

Quite a few Linux shells are available to use on a Linux system. Different shells have different characteristics, some being more useful for creating scripts and others more useful for managing processes. The default shell used in many Linux distributions is the Bash shell. The Bash shell was developed by the GNU project as a replacement for the standard Unix shell, called the Bourne shell (after its creator). The bash shell name is a play on this wording, referred to as the “Bourne again shell.”

In addition to the Bash shell, there are several other popular shells you could run into in a Linux environment. TABLE 1-6 lists the more popular ones.

TABLE 1-6    Popular Linux shells

SHELL

DESCRIPTION

ash

A simple, lightweight shell that runs in low-memory environments but has full compatibility with the bash shell

ksh

A programming shell compatible with the Bourne shell but supporting advanced programming features like associative arrays and floating-point arithmetic

tcsh

A shell that incorporates elements from the C programming language into shell scripts

zsh

An advanced shell that incorporates features from bash, tcsh, and korn, providing advanced programming features, shared history files, and themed prompts

Most Linux distributions include more than one shell, although usually they pick one of them to be the default. If your Linux distribution includes multiple shells, feel free to experiment with different shells and see which one fits your needs.

Linux Distributions: Why So Many?

Now that you have seen the main components required for a complete Linux system, you may be wondering how you are going to get them all put together to make a Linux system. Fortunately, there are people who have already done that.

A complete Linux system package is called a distribution. Lots of different Linux distributions are available to meet just about any computing requirement you could have. Most distributions are customized for a specific user group, such as business users, multimedia enthusiasts, software developers, or typical home users. Each customized distribution includes the software packages required to support specialized functions, such as audio and videoediting software for multimedia enthusiasts, or compilers and integrated development environments (IDEs) for software developers.

The different Linux distributions are often divided into two categories:

- Full core Linux distributions

- Specialized distributions

The following sections describe these different types of Linux distributions and show some examples of Linux distributions in each category.

Core Linux Distributions

A core Linux distribution contains a kernel, one or more graphical desktop environments, and just about every Linux application that is available. It provides onestop shopping for a complete Linux installation. Often other Linux distributions derive from a core Linux distributions, using a subset of applications available. TABLE 1-7 shows some of the more popular core Linux distributions.

TABLE 1-7    Core Linux distributions.

DISTRIBUTION

DESCRIPTION

Slackware

One of the original Linux distribution sets, popular with Linux geeks

Red Hat Enterprise

A commercial business distribution used mainly for Internet servers

Gentoo

A distribution designed for advanced Linux users, containing only Linux source code

openSUSE

Different distributions for business and home use

Debian

Popular with Linux experts and commercial Linux products

In the early days of Linux, a distribution was released as a set of floppy disks. You had to download groups of files and then copy them onto disks. It would usually take 20 or more disks to make an entire distribution! Needless to say, this was a painful experience.

Nowadays, Linux distributions are released as an ISO image file. The ISO image file is a complete disk image of a DVD as a single file. You use a software application to either burn the ISO image file onto a DVD or create a bootable USB stick. You then just boot your workstation from the DVD or USB stick to install Linux. This makes installing Linux much easier.

However, beginners still often run into problems when they install one of the core Linux distributions. To cover just about any situation in which someone might want to use Linux, a single distribution has to include lots of application software. This includes everything from highend Internet database servers to common games.

Although having lots of options available in a distribution is great for Linux geeks, it can become a nightmare for beginning Linux users. Most distributions ask a series of questions during the installation process to determine which applications and features to load by default. Beginners often find these questions confusing. As a result, they often either load way too many programs on their computer or don’t load enough and later discover that their computer won’t do what they want it to.

NOTE

Most Linux distributions also have a LiveDVD version available. The   LiveDVD version is a self-contained ISO image file that you can burn onto a DVD or USB stick to boot up a running Linux system
directly without having to install it on your hard drive. Depending on the distribution, the LiveDVD either contains a small subset of applications or, in the case of specialized distributions, the entire system. The benefit of the LiveDVD is that you can test it with your system hardware before going through the trouble of installing the system.

Fortunately for beginners, there’s a much simpler way to
install Linux.

Derivative Linux Distributions

A new subgroup of Linux distributions was started aimed specifically at beginning Linux users. These derivative distributions are typically based on one of the core distributions but contain only a subset of applications that would make sense for a specific area of use.

Besides providing specialized software (such as only office products for business users), derivative Linux distributions also attempt to help beginning Linux users by automatically detecting and configuring common hardware devices. This makes installing Linux a much more enjoyable process.

TABLE 1-8 shows some of the specialized Linux distributions available and what they specialize in.

TABLE 1-8    Derivative Linux distributions.

DISTRIBUTION

DESCRIPTION

Fedora

A free distribution used as a testing ground for Red Hat Enterprise Linux

Ubuntu

A free distribution for school and home use

MX Linux

A free distribution for home use

Mint

A free distribution for home entertainment use

Puppy Linux

A free, small distribution that runs well on older PCs

That’s just a small sampling of specialized Linux distributions. There are literally hundreds of specialized Linux distributions, and more are popping up all the time on the Internet. No matter what your specialty, you’ll probably find a Linux distribution made for you.

Many of the specialized Linux distributions are based on the Debian Linux distribution. They use the same installation files as Debian but package only a small fraction of a full-blown Debian system.

CHAPTER SUMMARY

This chapter discussed what the Linux operating system is and why there are so many different distributions. The Linux operating system consists of four parts—the kernel, the GNU utilities, a user interface, and individual application programs. The kernel manages memory, programs, hardware, and the filesystem on the Linux system. The GNU utilities provide programs for handling files, managing programs, and manipulating text files. Linux uses both text-based interfaces and graphical desktop environments. Text-based interfaces use a shell to communicate with the kernel, while graphics-based interfaces use the X Window system to provide a graphical environment for running programs.

Linux distributions combine all of these four elements into one easytoinstall package. Core Linux distributions provide a wide variety of applications to choose from, while specialty Linux distributions customize the applications installed for a specific need, such as program development or audio processing.

KEY CONCEPTS AND TERMS

- Bash

- block device file

- character device file

- Cinnamon

- command prompt

- command line interface (CLI)

- coreutils

- Core Linux distribution

- default.target

- device files

- distribution

- driver code

- filesystem

- GNU (GNU’s Not Unix)

- GNU Network Object Model Environment (GNOME)

- init process

- ISO image file

- KDE Plasma

- K Desktop Environment
(KDE)

- kernel

- kernel modules

- LiveDVD

- MATE

- memory management

- network device file

- nodes

- open source software
(OSS)

- pages

- process

- run levels

- shell

- shell scripts

- swap space

- systemd

- SysVinit

- targets

- unit files

- Virtual File System (VFS)

- virtual memory

- Wayland

- X.org

- X Window

CHAPTER 1 ASSESSMENT

1. The kernel interfaces with hardware connected to the Linux system.

1. True

2. False

2. The graphical desktop manages applications in memory.

1. True

2. False

3. Which part of the Linux system controls memory management?

1. The graphical desktop

2. The command prompt

3. The kernel

4. The shell

4. What is virtual memory stored on the hard drive called?

1. Swap space

2. Physical memory

3. Block device

4. Character device

5. What provides a graphical desktop environment in Linux systems?

1. The kernel

2. LiveDVD

3. Wayland

4. Device files

6. Which initialization method utilizes targets and unit files to determine which processes are started?

1. Systemd

2. SysVinit

3. Bash

4. Zsh

5. X Window

7. Which graphical desktop environment provides a graphical desktop similar to the GNOME 2 interface?

1. KDE Plasma

2. Xfce

3. GNOME 3

4. Cinnamon

8. The Red Hat Enterprise Linux distribution is an example of what type of Linux distribution?

1. Core

2. Specialty

3. LiveDVD

4. Custom

9. The Ubuntu Linux distribution is an example of what kind of Linux distribution?

1. Core

2. Specialty

3. LiveDVD

4. Custom

10. Which X Window package is newer and becoming more popular with Linux distributions?

1. GNOME 3

2. KDE Plasma

3. X.org

4. Wayland

© Picsfive/Shutterstock

CHAPTER 2

Linux and Software

APPLICATIONS MAKE OR BREAK AN operating system. Many good-intentioned operating systems have died due to lack of software support. Fortunately, Linux has benefited from a wide assortment of open source applications, both on the desktop and on the server.

This chapter discusses the most popular desktop and server applications available in Linux. It shows how applications are installed by default and how to add new applications to your Linux system. The chapter finishes up by discussing the different ways Linux distributions keep the installed software updated and patched for security vulnerabilities. These days those features are just as important as the initial installation of the software.

CHAPTER 2 TOPICS

This chapter covers the following topics and concepts:

- Common desktop and server applications available in Linux

- How Linux distributions bundle and install applications

- How to install and maintain applications in the Linux environment

- What methods different Linux distributions use to keep software up-to-date

CHAPTER 2 GOALS

When you complete this chapter, you will be able to:

- List the common applications used in Linux desktops and servers

- Explain how Linux uses package management to install software

- Describe the two main package management systems used by Linux distributions

- Explain how Linux handles software updates and security patches

Popular Linux Applications

Thanks to various open source projects, there are applications available in Linux for just about everything you currently do in Microsoft Windows, Apple macOS, or even Unix desktops and servers. The downside to such a wide assortment of applications, though, is that sometimes it can be difficult to know just which ones to use for your environment. This section walks through some of the more popular desktop and server applications available for Linux to give you an idea of where to start.

Desktop Applications

If you’re running a Linux graphical desktop environment, most likely you’ll want it to be able to run similar applications that you can find in the Microsoft Windows or Apple macOS desktop environments. That includes features such as office productivity (word processing, spreadsheets, and presentation graphics), web browsing, email, and file management. This section walks through the most common Linux applications used for each of these areas.

Office Productivity

At one time the OpenOffice.org software package was the most common office suite package in Linux. It provides programs for word processing (Writer), spreadsheet (Calc), presentation graphics (Impress), drawing (Draw), math formulas (Math), and a desktop database interface (Base). However, the OpenOffice.org software package ran into some controversy of its own a few years back when the Oracle software company purchased the copyright to it as part of the acquisition of Sun Microsystems, the previous owner.

While Oracle kept the OpenOffice.org project open source, a group of open source developers decided to branch off an alternative package, called LibreOffice. The LibreOffice branch includes the exact same packages as OpenOffice.org, using the exact same source code. However, it’s maintained as a separate branch package, so the two packages have now diverged somewhat with various features.

Since then, Oracle has donated the OpenOffice.org package to the Apache foundation, a large open source organization. This has appeased most open source enthusiasts, but unfortunately the damage had already been done. With the popularity of LibreOffice, most of the popular Linux desktop distributions have migrated to it. FIGURE 2-1 shows running the Writer application from an Ubuntu desktop. There’s hope that the two packages will merge back into one package someday, but until then the open source community will have to live with both versions.

FIGURE 2-1 The LibreOffice Writer program in Ubuntu.

Courtesy of The Document Foundation and Mozilla.

Description

NOTE

Both the OpenOffice.org and LibreOffice packages can open, modify, and create Microsoft Office–formatted documents, spreadsheets, databases, and presentations. This feature alone has made the switch to Linux a much simpler process for many.

Besides the OpenOffice.org and LibreOffice packages, both the GNOME and KDE desktop projects have created their own office software suites (called Gnome Office and KOffice). These packages tend not to be as advanced as OpenOffice.org, but they’re great if you’re using an older, low-powered workstation!

Web Browsing

Firefox is by far the most common default web browser software in the Linux platform. The version available for Linux provides the same basic interface and features as the Windows and Mac versions. FIGURE 2-2 shows running Firefox on an Ubuntu desktop.

FIGURE 2-2 The Firefox browser in Ubuntu.

Courtesy of Mozilla Corporation and Canonical Ltd.

You may run into a distribution that uses the GNU IceCat browser. This is a derivative of the Firefox browser, but without the Firefox logos. A few years back, there was some controversy about the Firefox browser. While the program code was open source, the Firefox logo was trademarked and licensed. To retaliate, open source developers created the Iceweasel (get the play on the name?) browser using the original Firefox source code but with a new logo, bypassing the trademark restrictions. That issue has since been resolved, but the GNU Project kept up development on Iceweasel, now calling it IceCat, and some Linux distributions still like to keep using the IceCat release instead of Firefox.

Besides Firefox and IceCat, other popular Linux browsers are Chromium (the open-source version of the Google Chrome browser) and Opera, a commercial (but free) browser. There’s also a text-based browser called Lynx. Since Lynx is a text-based browser, it isn’t used in the standard graphical desktop environment, but it’s popular in the scripting world for scraping data off of webpages without having to download all the graphics elements from the pages

Email Client

Most Linux distributions that use the GNOME desktop environment (such as Red Hat) support the Evolution email client. Similarly, many KDE Plasma desktop distributions use the KMail email client. Both of these packages provide basic email client capabilities, but nothing too fancy.

By default, the Ubuntu distribution uses the Thunderbird email client (as shown in FIGURE 2-3), created by the same development team as the Firefox browser (Mozilla). Thunderbird provides a simple setup that supports most common email servers (including Gmail and Yahoo), as well as interfacing with the local email system in Linux.

FIGURE 2-3 The Thunderbird email client in Ubuntu.

Courtesy of Mozilla Corporation and Canonical Ltd.

Description

You can manage multiple mailboxes with both Evolution and Thunderbird as well as create local mail folders for sorting your messages.

File Management

File management software allows you to graphically peruse through your stored files and folders, creating, copying, moving, and deleting them. The file manager that your Linux distribution uses usually depends on the desktop manager. GNOME desktops use the Files file manager software (previously called Nautilus), while KDE Plasma desktops use the Dolphin file manager package. FIGURE 2-4 shows the Files file manager in Ubuntu.

FIGURE 2-4 The Files file manager in Ubuntu.

Courtesy of Canonical Ltd.

Description

Both Files and Dolphin allow you to navigate through the directory levels in the Linux system with simple clicks, similar to Windows Explorer in Windows, and the Finder on the Mac. The action of copying or moving files is as simple as dragging-and-dropping icons between folders in the graphical interface.

Server Applications

One of the more popular uses of Linux these days is as a server platform. Linux server systems can be cheaper and easier to manage than their Windows counterparts, and they can often run for months without requiring a reboot. The Linux platform supports a robust assortment of server applications that can seamlessly fit into any server environment. This section takes a look at the more popular Linux server applications.

Web Server

The original web server software for Linux is the Apache server. The Apache server software started out as a fork of the original NCSA web server package that started the World Wide Web. The Apache name is a play on the phrase “a patchy server,” due to the large number of software patches that were applied to the NCSA software.

A newer web server package that’s gaining popularity in the Linux world is Nginx (pronounced “engine-X”). The claim to fame of the Nginx package is that it can implement load balancing across multiple web servers. This has become popular in high-volume websites on the Internet.

The Apache and Nginx web servers are the Swiss army knives of Linux web servers. They do everything and then some. Sometimes, you’ll have an application that doesn’t require such a sophisticated web server, or you may be running your application on a low-powered system. There are a few alternatives to these packages that just provide basic web server services. Lighttpd is one popular no-frills web server that you might run into in smaller Linux setups.

Database Server

The Internet runs on data. Every application needs some type of data management system. Linux servers have quite a few different options for database servers. The MySQL (with its clone MariaDB) and PostgreSQL software packages are the two most popular choices for relational database servers.

The MySQL package is known for its speed, but it doesn’t support some of the more advanced database features found in commercial database packages. PostgreSQL, on the other hand, does support lots of advanced database features, but it can be somewhat slower. Many popular online stores forgo advanced features in favor of speed and use the MySQL database server.

A new trend has started toward NoSQL databases. NoSQL databases can handle large quantities of data by forgoing the structured database tables of SQL relational databases and instead store data as structureless collections. Each collection consists of documents, which contain the individual data elements. The key to NoSQL is that unlike relational databases, in a collection each document can contain different data! Queries are structured to look for individual data elements among the varying document types in the collection. Currently the MongoDB database is the tool of choice to set up a document-based NoSQL environment in Linux.

Email Server

The sendmail package is the original email server software for the Unix environment. It has carried over to the Linux environment but shows its age. It’s notoriously complicated to configure, making it difficult to set up even a basic email server, and developers are constantly finding security holes in it to patch.

Because of that, a few other email server packages have risen in popularity. Of these, the three most popular packages are Postfix, eXim, and qMail. All three of these packages use simpler configuration files that allow the server administrator to easily fine-tune how the server handles email both internally and with remote hosts.

Network File Sharing

Most local networks require some type of file sharing between clients. Linux supports two main file sharing applications. The Network File Sharing (NFS) software is the original Unix software for sharing directories between Unix systems. That package works great for Linux-to-Linux file sharing.

With the popularity of Microsoft Windows workstations, though, many networks require interacting with Windows servers to share files and printers. The Samba software package can emulate a Microsoft Windows server environment on a Linux server, including the Active Directory authentication system. This allows you to seamlessly incorporate a Linux server running Samba into a Microsoft network to communicate with both Microsoft servers and clients to provide print and file sharing features.

Exploring Package Management

Trying to keep track of just what software is installed on a Linux system can be somewhat of a challenge. To make life easier, each of the major Linux distributions utilizes some form of a package management system to control installing software applications and libraries. The package management system bundles each application into a separate package that can be installed, modified, or uninstalled as a single bundle. The package management system utilizes a database that keeps track of the following:

- What software packages are installed on the Linux system

- What files have been installed for each package

- What versions of each of the software packages are installed

Software packages are stored on servers, called repositories, and are accessed across the Internet via package management system utilities running on your local Linux system. You can use the package management system utilities to search for new software packages or even updates and security patches to software packages already installed on the system.

A software package will often have dependencies, or other packages that must be installed first for the software to run properly. The package management system utilities detect these dependencies and offer to install any additionally needed software packages before installing the desired package.

The downside to package management system is that there isn’t a single standard utility. The package management system utilities and their associated commands are vastly different between the various Linux distributions. However, two primary package management system utilities have become popular and are commonly used in the Linux world. These are dpkg and rpm.

Debian-based distributions such as Ubuntu and Linux Mint use, at the base of their package management system utilities, the dpkg command. This command interacts directly with the package management system on the Linux system and is used for installing, managing, and removing software packages.

The Red Hat–based distributions, such as Fedora, CentOS, openSUSE, and Rocky, use the rpm command at the base of their package management system. Similar to the dpkg command, the rpm command can list installed packages, install new packages, and remove existing software.

Note that these two commands are the core of their respective package management system, not the entire package management system itself. Many Linux distributions that use the dpkg or rpm methods have built additional specialty package management system utilities upon these base commands to help make your life much easier. The following sections walk through various package management system utility commands you’ll run into in the popular Linux distributions.

Exploring the Debian-Based Systems

The dpkg command is at the core of the Debian-based family of package management system tools. It provides options to install, update, and remove .deb package files on your Linux system.

The dpkg command assumes you have the .deb package file downloaded onto your local Linux system. More often than not that’s not the case. Usually you’ll want to install an application package from the repository for your Linux distribution. To do that you’ll want to use the apt suite of tools:

- apt-cache

- apt-get

- apt

The apt tool is essentially a front-end for both the apt-cache and apt-get tools. The nice thing about apt is that you don’t need to remember which tool to use when; it covers everything you need to do with package management. The apt tool has a basic format:

The command defines the action for the apt tool to take. If needed, you can specify one or more options to fine-tune what happens. This section looks at how to use the apt command line tool to work with the software packages on your Linux system.

Managing packages with apt

A common task faced by Linux system administrators is to determine what packages are already installed on the system. The apt list command displays all the packages available in the repository, but by adding the --installed option, you can limit the output to only those packages already installed on your system:

Description

As you can guess, the list of installed packages will be very long, I’ve abbreviated the output just to show a sample of what the output looks like. Next to the package name is some additional information about the package, such as the version name and whether the package is installed and flagged for automatic upgrades.

If you already know the packages on your system and want to quickly display detailed information about a particular package, use the show command:

Here’s an example of displaying the details of the package zsh:

Description

One detail you cannot get with apt is a listing of all the files associated with a particular software package. To get this list, you will need to go to the dpkg tool itself:

Here’s an example of using dpkg to list all of the files installed as part of the acl package:

WARNING

The apt show command does not indicate that the package is installed on the system. It shows only detailed package information from the software repository.

Description

You can also do the reverse—find what package a particular file belongs to:

Note that you need to use an absolute file reference for this to work:

The output shows the getfacl file was installed as part of the acl package.

Installing software packages with apt

Now that you know more about listing software package information on your system, this section walks you through a software package install. First, you’ll want to determine the package name to install. How do you find a particular software package? Use apt with the search command:

The beauty of the search command is that you do not need to insert wildcards around package_name; wildcards are implied. By default, the search command displays packages that contain the search term in either the package name or the package description, which can be misleading at times. If you want to limit the output to only package names, include the --names-only option:

Description

Once you find the package you’d like to install, installing it using apt is as easy as this:

The output will show some basic information about the package and ask you if you want to proceed with the installation:

Description

To check if the installation processed properly, just use the list command with the --installed option again. You should see the package appear, indicating it is installed.

Notice that when installing the requested package, apt asked to install other packages as well. This is because apt automatically resolved any necessary package dependencies for us and installs the needed additional library and software packages. This is a wonderful feature included in many package management systems.

Upgrading software with apt

While apt helps protect you from problems installing software, trying to coordinate a multiple-package update with dependencies can get tricky. To safely upgrade all the software packages on a system with any new versions in the repository, use the upgrade command:

Notice that this command doesn’t take any software package names as an argument. That’s because the upgrade option will upgrade all the installed packages to the most recent version available in the repository, which is safer for system stabilization.

Here’s a sample output from running the apt upgrade command:

Description

In the output notice that apt lists not only the packages that will be upgraded but also any new packages that are required to be installed because of upgrades.

WARNING

Obviously, running apt’s upgrade option is something you should do on a regular basis to keep your system up-to-date. However, it is especially important to run it after a fresh distribution installation. Usually there are lots of security patches and updates that are released since the last full release of a distribution.

The upgrade command won’t remove any packages as part of the upgrade process. If a package needs to be removed as part of an upgrade, use the following command:

While this may seem like an odd thing, sometimes it’s required to remove packages to keep things synchronized between distribution upgrades.

Uninstalling software with apt

Getting rid of software packages with apt is as easy as installing and upgrading them. The only real choice you have to make is whether or not to keep the software’s data and configuration files around afterward.

To remove a software package, but not the data and configuration files, use the remove command of apt. To remove a software package and the related data and configuration files, use the purge option:

Description

Notice though as part of the purge output apt warns us that the zsh-common package that was installed as a dependency wasn’t removed automatically, just in case it might be required for some other package. If you’re sure the dependency package isn’t required by anything else, you can remove it using the autoremove command:

Description

The autoremove command will check for all packages that are marked as dependencies and no longer required.

The front-end interface, apt, provides intelligent command line options for working with the Debian-based dpkg utility. Now it’s time to take a look at the Red Hat–based distribution’s rpm utility and its various front-end interfaces.

The Red Hat–Based Systems

Like the Debian-based distributions, the Red Hat–based systems have several different frontend tools that are available. Following are the common ones:

- yum: Used in Red Hat, CentOS, and Rocky

- zypper: Used in openSUSE

- dnf: An updated version of yum with some additional features

These frontends are all based on the rpm command line tool. The following section discusses how to manage software packages using these various rpm-based tools. The focus will be on dnf, but the other packages use similar commands and formats.

Listing installed packages

To find out what is currently installed on your system, at the shell prompt type the following command:

The information will probably whiz by you on the display screen, so it’s best to redirect the installed software listing into a file. You can then use the more or less command (or a GUI editor) to look at the list in a controlled manner.

To find out detailed information for a particular software package, dnf really shines. Not only will it give you a very verbose description of the package, but with another simple command, you can see if the package is installed:

Description

Finally, if you need to find out what software package provides a particular file on your filesystem, the versatile dnf can do that, too! Just enter the following command:

Here’s an example of trying to find what software provided the file /usr/bin/gzip:

Description

dnf checked two separate repositories: the local system, and the default Fedora repository.

Installing software with dnf

Installation of a software package using dnf is incredibly easy. The following is the basic command for installing a software package, all its needed libraries, and package dependencies from a repository:

Here’s an example of installing the zsh package, which provides an alternative command line shell:

Description

You can begin to see that one of dnf’s strengths is that it uses very logical and user-friendly commands.

Upgrading software with dnf

In most Linux distributions, when you’re working away in the GUI, you get those nice little notification icons telling you a software upgrade to a new version is needed. Here at the command line, it takes a little more work.

To see the list of all the available upgrades for your installed packages, type the following command:

NOTE

Before the dnf command in the preceding listing, the sudo command is used. This command allows you to switch to the root user to run the command. You should only switch to root user temporarily in order to run administrative tasks, such as installing and updating software.

It’s always nice to get no response to this command because it means you have nothing to upgrade! However, if you do discover a particular software package needs upgrading, then type in the following command:

If you’d like to upgrade all the packages listed in the upgrade list, just enter the following command:

Uninstalling software with dnf

The dnf tool also provides an easy way to uninstall software you no longer want on your system:

Unfortunately at the time of this writing, there isn’t an option or command to remove the application files but keep any configuration or data files.

NOTE

One nice extra feature in dnf is the upgrade-minimal command. It upgrades a package to the latest bug fix or security patch version instead of the latest and greatest version.

While life is considerably easier with package management system packages, it’s not always problem free. Occasionally things do go wrong. Fortunately, there’s help.

Managing Software Using Containers

While package management systems have certainly made software installation in the Linux world much easier, they do have their drawbacks. To start out with, as you’ve already seen in this chapter, there are multiple competing package management systems. So for application developers to distribute an application that can be installed in all Linux distributions, they must create multiple versions to distribute.

But there’s even more complexity than that. Every application has some type of library functions that it depends on to run. When developers create a Linux application, they must take into consideration what library files are available in most Linux distributions, and not only that, but also what versions of the library files. While package management systems can track dependencies, as you can guess, this can quickly turn into a nightmare for software developers trying to get their applications working in most Linux distributions.

With cloud computing came a new paradigm in how applications can be packaged—application containers. An application container creates an environment where all of the files required for an application to run are bundled together, including runtime library files. The developer can then release the application container as a single package and be guaranteed that it’ll run just fine on any Linux system.

While still relatively new, there are already several competing application container standards that are starting to emerge. The following sections take a look at two of the more popular ones—snap and flatpak.

Using Snap Containers

Canonical, the creators of the Ubuntu Linux distribution, have developed an application container format called snap. The snap packaging system bundles all the files required for an application into a single snap distribution file. The snapd application runs in background, and you use the snap command line tool to query the snap database to display installed snap packages as well as to install, upgrade, and remove snap packages.

To check if snap is running on your system, use the snap version command:

Description

If snap is running, you can see a list of the currently installed snap applications by using the snap list command:

Description

To search the snap repository for new applications, use the snap find command:

Description

To view more information about a snap, use the snap info command:

Description

To install a new snap application, use the snap install command:

Description

Notice that you must have root user privileges to install snaps. In Ubuntu, that means using the sudo command.

NOTE

When you install a snap, the snapd program mounts it as a drive. You can see the new snap mount by using the mount command.

If you need to remove a snap, just use the snap remove command:

As the snap is removed, you’ll see some messages about the progress of the removal. Instead of removing a snap, you can just disable it without removing it. Just use the snap disable command. To re-enable the snap, use the snap enable command.

Using Flatpak Containers

The flatpak application container format was created as an independent open source project with no direct ties to any specific Linux distribution. That said, battle lines have already been drawn, with Red Hat-based distributions oriented toward using flatpak instead of Canonical’s snap container format.

If you’re using a Linux distribution that supports flatpak, you can list the installed application containers using the flatpak list command:

Description

To find an application in the flatpak repository, you use the flatpak search command:

Description

I edited out some of the information in the output to help simplify things. When working with a container, you must use its Application ID value and not its name. To install the application, use the flatpak install command:

Description

To check if the installation went well, you can use the flatpak list command again:

Description

And finally, to remove an application container, use the flatpak uninstall command:

Description

While using application containers is similar to using package management systems, what goes on behind the scenes is fundamentally different. However, the end result is that you have an application installed on your Linux system that can be easily maintained and upgraded.

Installing from Source Code

Before package management systems and application containers, open source application developers had to distribute their software as source code and allow users to compile the applications on their own systems. Source code packages were commonly released as a tarball. The tarball package uses the tar command to archive multiple files into a single file (either with or without compression).

If you develop or work with open source software source code much, there’s a good chance you will still find software packed up as a tarball. This section walks you through the process of unpacking and installing a tarball software package.

For this example, the software package sysstat will be used. The sysstat utility is a very nice software package that provides a variety of system monitoring tools.

First, you will need to download the sysstat tarball to your Linux system. While you can often find the sysstat package available on different Linux sites, it’s usually best to go straight to the source of the program. In this case, it’s the website sebastien.godard.pagesperso-orange.fr/.

When you click the Download link, you’ll go to the page that contains the files for downloading. The current version at the time of this writing is 12.5.4, and the distribution file name is sysstat-12.5.4.tar.xz.

Click the link to download the file to your Linux system. Once you have downloaded the file, you can unpack it.

To unpack a software tarball, use the standard tar command. Since the file is compressed using the xz program, you must include the -J switch, along with the -x switch to extract the tarball, the -v switch to use verbose mode, and the -f switch to specify the filename:

Description

Now that the tarball is unpacked and the files have neatly put themselves into a directory called sysstat-12.5.4, you can dive down into that directory and continue.

First, use the cd command to get into the new directory and then list the contents of the directory:

Description

In the listing out of the directory, you should typically see a README or INSTALL file. It is very important to read this file. In the file will be the actual instructions you will need to finish the software’s installation.

Following the advice contained in the INSTALL file, the next step is to run the configure utility for your system. This checks your Linux system to ensure it has the proper library dependencies, in addition to the proper compiler to compile the source code:

Description

Since the configure utility is located in the local directory, you must use the ./ relative path symbol to run it. If anything does go wrong, the configure step will display an error message explaining what’s missing.

The next stage is to build the various binary files using the make command. The make command compiles the source code and then the linker to create the final executable files for the package. As with the configure command, the make command produces lots of output as it goes through the steps of compiling and linking all of the source code files:

Description

When make is finished, you’ll have the actual sysstat software program available in the directory! However, it’s somewhat inconvenient to have to run it from that directory. Instead, you’ll want to install it in a common location on your Linux system. To do that, you’ll need to use the sudo command to obtain root privileges and then use the install option of the make command:

NOTE

Most Linux utility programs are written using the C or C++ programming language. To compile them your system will need the   gcc package installed as well as the make package. Most Linux desktop distributions don’t install these by default. If the configure program shows an error that these parts are missing, consult your specific Linux distribution docs on what packages you need to install.

Description

Now the sysstat package is installed on the system! While not quite as easy as installing a software package via a package management system, installing software using tarballs is not that difficult.

CHAPTER SUMMARY

All operating systems require applications to be useful. Linux has a host of free open source applications created for it, both for the graphical desktop and the server environments. Most Linux distributions bundle application files into a package, then use a package management system to manage the packages. Red Hat–based distributions use the Red Hat Package Manager application, which uses .rpm package files, while Debian-based distributions use the Debian Package Manager, which uses .deb package files. Both use command line tools as well as graphical applications to make it easy to retrieve and install application packages. Open source software can also be distributed as source code files bundled into a tarball. You can use standard tools such as tar, gcc, and make to extract the source code files, compile them, and then install them on your Linux system.

KEY CONCEPTS AND TERMS

- Apache

- application container

- apt

- Chromium

- collection

- configure

- dependencies

- dnf documents

- Dolphin

- dpkg

- Evolution

- eXim

- Files

- Firefox

- flatpak

- gcc

- GNU IceCat

- KMail

- LibreOffice

- Lighttpd

- Lynx

- make

- MariaDB

- MongoDB

- MySQL

- Network File Sharing (NFS)

- NginX

- NoSQL

- OpenOffice.org

- Opera

- package

- package management system

- Postfix

- PostgreSQL

- qMail

- repository

- rpm

- Samba

- sendmail

- snap

- snapd

- software package

- tar

- tarball

- Thunderbird

- yum

- zypper

CHAPTER 2 ASSESSMENT

1. The Files graphical file manager application is used by the GNOME desktop.

1. True

2. False

2. Which application does most GNOME desktop Linux distributions use for an email client?

1. Files

2. Evolution

3. KMail

4. Apache

3. Which applications provide a web server for Linux distributions?

1. Thunderbird

2. Apache

3. Lightttpd

4. Evolution

4. Which application allows you to share files between a Linux server and a Windows desktop?

1. MySQL

2. Postfix

3. Samba

4. Evolution

5. Nautilus

5. What package manager program is used by Red Hat Enterprise Linux?

1. rpm

2. dpkg

3. gcc

4. make

5. None of the above

6. The _______ program connects to Debian-based repositories to check for package updates.

1. rpm

2. dpkg

3. ldconfig

4. apt

7. The dnf package manager can install package updates and patches from an online repository.

1. True

2. False

8. A(n) ________ ______ contains all the files required for an application.

1. shared library

2. package manager

3. software package

4. executable file

9. A __________ contains all of the available software packages for a distribution.

1. shared library

2. dependency

3. package manager

4. repository

10. Which dnf command updates a distribution to the latest patches and software updates?

1. dnf update

2. dnf upgrade

3. dnf install

4. dnf clean

© Picsfive/Shutterstock

CHAPTER 3

Linux and Hardware

ONE OF THE JOBS OF THE OPERATING SYSTEM kernel is to interface with hardware connected to your computer. These days you can connect lots of different types of hardware to a computer, everything from external disk drives to mobile phones. Trying to get Linux working with all of them can be somewhat tricky.

This chapter explores the tools available to get your Linux system to interface with different types of hardware devices. The chapter first explores how the Linux kernel handles the software required to interface with hardware devices. It shows how the idea of modules became invaluable in working with the latest removable devices. Next, the chapter examines how to work with various types of hardware settings, such as interrupts and I/O ports, used in both desktop and server environments to identify hardware. Following that is a section on how Linux works with hotplug devices, especially those using the popular USB interface. With the popularity of the USB interface, it’s crucial that your Linux system can work with them and that you know where to find the utilities on your system.

CHAPTER 3 TOPICS

This chapter covers the following topics and concepts:

- Using Linux device driver modules

- Communicating with hardware devices

- How to detect and work with hotplug devices

- Working with USB devices

CHAPTER 3 GOALS

When you complete this chapter, you will be able to:

- List the different ways you can install hardware device drivers on a Linux system

- Describe how Linux interfaces with hardware devices

- Explain the difference between coldplug and hotplug devices

- Describe how Linux interfaces with USB devices and how to list the USB devices installed

Device Driver Modules

One of the main jobs of the Linux operating system is to provide a standard interface for applications to work with hardware. Lots of different types of hardware devices are available, making it impossible for each application to include software to interact with all of them.

Instead, the Linux operating system provides a generic interface to all the different types of hardware that applications can face. Application programmers just need to know how to interface with the Linux system and then Linux takes over from there. This makes tasks such as printing to a printer or writing to a DVD drive much easier for application developers.

Similar to the Microsoft Windows world, the Linux kernel interfaces with hardware devices using what’s called a device driver. A device driver is a small piece of software written to interact with a specific hardware device. Each device that connects to the Linux system must have a Linux device driver. Fortunately, with the growing popularity of Linux, most hardware manufacturers provide device drivers for their own devices so that Linux users can use the hardware on their Linux systems. There are also a few open source projects for creating device drivers for specific devices where the manufacturer has failed to produce a Linux device driver. This is especially true with printers.

Once you obtain the device driver necessary for the hardware you want to install on your Linux system, there are two ways to include it in the Linux kernel:•

- Compile it into the kernel software

- Plug a module into the kernel software

Compiled device drivers are device driver software that you must compile directly into the Linux kernel software. This method requires the source code for the device driver as well as the source code for the kernel. When the kernel program is recompiled, you must specify the additional device driver software to include in the kernel.

The downside to compiling device drivers into the kernel is that every time you need to add a new hardware device to your Linux system, you must recompile the entire kernel software program. That can get old after a while, not to mention it’s a great way to introduce bugs into the running kernel!

NOTE

One of the great debates in the Linux world is the pros and cons between a monolithic kernel and a modular kernel. A monolithic kernel precompiles all possible features required by the system into a single kernel program. While this makes the Linux kernel versatile, it also makes it somewhat bloated, as there will be hundreds of device drivers compiled into the kernel that you most likely will never use in your environment. That extra bloat takes up memory and can slow down the processing speed of your Linux system.

As a solution, Linux developers created Linux kernel modules. A kernel module can be inserted into a running kernel at any time without affecting the system operation. Similarly, you can also remove a module from the kernel at any time without affecting other operations of the kernel. This provides the flexibility to install only the device drivers that you need for your system to interact with exactly the hardware you use, without the ugliness of having to recompile the kernel for each device.

Device driver modules are now pretty much the default way of handling hardware devices. Linux systems provide a few different utilities for working with device driver modules from the command line. The following sections walk through the commands that you can use to manage hardware modules in your Linux system.

Listing Installed Modules

Before you get too far with your Linux system, you may need to determine just what devices it can support by default. Most Linux distributions include a set of pre-installed device driver modules for most common hardware.

You can take a peek at what device modules are already loaded in the Linux kernel by using the lsmod command line command:

Description

The output of the lsmod command has three columns. The Module column shows the name of the module. The Used by column shows the number of other modules or processes that use the module, and what their names are. This helps you determine module dependencies in case you try to remove a module without knowing just what other modules or processes rely on it.

technical TIP

It’s important to remember that the   lsmod command only displays device driver modules. It’s possible that your Linux system also has device drivers directly compiled into the kernel as well. Those drivers won’t show up in the lsmod output.

Knowing what device modules your Linux distribution pre-installs can help with troubleshooting hardware issues, as well as giving you an idea of what drivers you’ll need to track down for your specific hardware.

Installing New Modules

Once you obtain a device driver module file for your hardware you can install it in your Linux system kernel using one of two common commands:

- insmod

- modprobe

While each of these commands can insert a module, they each work a little differently. The following sections describe what you’ll need to know to use each command.

Using insmod

The insmod command inserts a single device module file into the kernel. You must have the device module file copied onto your Linux system to use this command. Most Linux distributions use the /lib/modules folder structure to store module files. If you look in that folder on your Linux system, you’ll see a folder tree structure that separates the device drivers for each kernel version as well as the different types of hardware.

For example, on my Ubuntu Linux server system I have the following folder for Bluetooth hardware drivers:

This folder is for the currently installed Linux kernel on my system—5.4.0-80. Inside that folder are lots of different device driver module files for various types of Bluetooth systems:

Description

Each .ko file is a separate device driver module file that you can install into the 5.4.0-80 kernel. To install the module, just specify the filename on the insmod command line. Some modules also require parameters, which you must specify on the command line as well:

Description

To install a module you must have root user privileges on the system, which for most Linux systems that’s done using the sudo command. After you install the module you can check for it using the lsmod program.

Using modprobe

The downside to using the insmod program is that you may run into modules that depend on other modules, and the insmod program will fail if those other modules aren’t already installed. To make the process easier, the modprobe command helps resolve module dependencies for you.

Another nice feature of the modprobe command is that it understands module names and will search the module library for the module file that provides the driver for the module name.

Because of this versatility there are lots of options available for the modprobe command. TABLE 3-1 shows the command line options that you can use.

TABLE 3-1    The modprobe command options.

Option

Description

-a

Insert all modules listed on the command line

-b

Apply the blacklist commands specified in the configuration file

-C

Specify a different configuration file other than the default

-c

Display the current configuration used

-d

Specify the root directory to use for installing modules. The default is /

-f

Force the module installation even if there are version issues

-i

Ignore the install and remove commands specified in the configuration file for the module

-n

Perform a dry run of the module install to see if it will work, without actually installing it

-q

Quiet mode—doesn’t display any error messages if the module installation or removal fails

-r

Remove the module listed

-s

Send any error messages to the syslog facility on the system

-V

Display the program version and exit

-v

Provide additional information (verbose) as the module is processed

As you can see, the modprobe command is a full-featured tool all by itself. Perhaps the handiest feature is that it allows you to handle modules based on the module name and not have to list the full module filename:

Description

Notice that by adding the –v option for verbose mode the output shows the insmod command automatically generated by the modprobe command. The insmod command shows the specific module file used to install the module.

Removing Modules

Normally it does no harm to install a module in the system even if the hardware device is not present. The kernel ignores unused modules. However, some Linux administrators prefer to keep the kernel as lightweight as possible, so the Linux developers created a method for removing unnecessary modules—the rmmod command.

However, our friend the modprobe command can also remove modules for us, so you don’t really need to memorize another command. Instead, just use the –r option with the modprobe command:

The modprobe –r command invokes the rmmod command automatically, removing the module by name. You can verify that the module has been removed by using the lsmod command.

Communicating with Linux Devices

After the kernel module is installed, the kernel must know how to communicate with the device. Linux supports several different types of hardware interfaces and methods for communicating with devices. This section discusses how Linux interacts with different types of devices.

Device Interfaces

Each device you connect to your Linux system uses some type of standard protocol to communicate with the system hardware. The kernel module software must know how to send data to and receive data from the hardware device using those protocols. Currently, three popular standards are used to connect devices.

PCI boards

The Peripheral Component Interconnect (PCI) standard was developed in 1993 as a method for connecting hardware boards to PC motherboards. The standard has been updated a few times to accommodate faster interface speeds as well as increase data bus sizes on motherboards. The PCI Express (PCIe) standard is currently used on most server and desktop workstations to provide a common interface for external hardware cards.

Lots of different client devices use PCI boards to connect to a server or desktop workstation:

- Internal Hard Drives: Hard drives using the older Serial Advanced Technology Attachment (SATA) and the Small Computer System Interface (SCSI) connectors often use PCI boards to connect with workstations or servers. The Linux kernel automatically recognizes both SATA and SCSI hard drives connected to PCI boards. Also, the Linux kernel can automatically recognize the newer Non-Volatile Memory (NvMe) controllers, which are used to connect Solid State Drive (SSD) storage devices.

- External Hard Drives: Network hard drives using the Fiber Channel standard provide a high-speed shared drive environment for server environments. To communicate on a fiber channel network, the server usually uses PCI boards that support the Host Bus Adapter (HBA) standard.

- Network Interface Cards: Hard-wired network cards allow you to connect the workstation or server to a local area network using the common RJ-45 cable standard. These types of connections are mostly found in high-speed network environments that require high throughput to the network.

- Wireless Network Cards: There are PCI boards available that support the IEEE 802.11standard for wireless connections to local area networks. While these are not commonly used in server environments, they are very popular in workstation environments.

- Bluetooth Devices: The Bluetooth technology allows for short distance wireless communication with other Bluetooth devices in a peer-to-peer network setup. These are most commonly found in workstation environments.

- Video Accelerators: Applications that require advanced graphics often use video accelerator cards, which offload the video processing requirements from the CPU to provide faster graphics. While these are popular in gaming environments, you’ll also find video accelerator cards used in video processing applications for editing and processing movies.

- Audio Cards: Similarly, applications that require high-quality sound often use specialty audio cards to provide advanced audio processing and play, such as handling Dolby surround sound to enhance the audio quality of movies.

The USB interface

The Universal Serial Bus (USB) interface has become increasingly popular due to its ease of use and its increasing support for high-speed data communication. Since the USB interface uses serial communications, it requires fewer connectors with the motherboard, allowing for smaller interface plugs.

The USB standard has evolved over the years. The original version (1.0) only supported data transfer speeds up to 12Mbps. The 2.0 standard increased the data transfer speed to 480Mbps. The current USB standard, 4.0, allows for data transfer speeds up to 40Gbps, making it useful for high-speed connections to external storage devices.

There are a myriad of devices that can connect to systems using the USB interface. You can find hard drives, printers, digital cameras and camcorders, keyboards, mice, and network cards that have versions that connect using the USB interface.

NOTE

There are two steps to get Linux to interact with USB devices. The first step is that the Linux kernel must have the proper module installed to recognize the USB controller installed on your server or workstation. The controller provides communication between the Linux kernel and the USB bus on the system. When the Linux kernel can communicate with the USB bus, any device you plug into a USB port on the system will be recognized by the kernel but is not necessarily usable. The second step is that the Linux system must have a kernel module installed for the individual device type plugged into the USB bus. Linux distributions have a wide assortment of modules installed by default.

The GPIO Interface

The general purpose input/output (GPIO) interface has become popular with small utility Linux systems designed for controlling external devices for automation projects. This includes popular hobbyist Linux systems such as the Raspberry Pi and BeagleBone kits.

The GPIO interface provides multiple digital input and output lines that you can control individually, down to the single-bit level. The GPIO function is normally handled by a specialty integrated circuit (IC) chip, which is mapped into memory on the Linux system.

The GPIO interface is ideal for supporting communications to external devices such as relays, lights, sensors, and motors. Applications can read individual GPIO lines to determine the status of switches, turn relays on or off, or read digital values returned from any type of analog-to-digital sensors such as temperature or pressure sensors.

With the GPIO interface, you have a wealth of possibilities for using Linux to control objects and environments. You can write programs that control the temperature in a room, sense when doors or windows are opened or closed, sense motion in a room, or even control the operation of a robot.

The /dev Directory

After the Linux kernel can communicate with a device on an interface, it must be able to transfer data to and from the device. For many devices, this is done using device files. Device files are files that the Linux kernel creates in the special /dev directory to interface with hardware devices.

To retrieve data from a specific device, a program just needs to read the Linux device file associated with that device. The Linux operating system handles all the unsightliness of interfacing with the actual hardware. Likewise, to send data to the device, the program just needs to write to the Linux device file.

As you add hardware devices such as USB drives, network cards, or hard drives to your system, Linux creates a file in the /dev directory representing that hardware device. Application programs can then interact directly with that file to store and retrieve data on the device. This is a lot easier than requiring each application to know how to directly interact with a device.

There are two types of device files in Linux, based on how Linux transfers data to the device:

- Character device files: Transfer data one character at a time. This method is often used for serial devices such as terminals and USB devices.

- Block device files: Transfer large blocks of data. This method is often used for high-speed data transfer devices such as hard drives and network cards.

Besides device files, Linux also provides a system called the device mapper. The device mapper function is performed by the Linux kernel. It maps physical block devices to virtual block devices. These virtual block devices allow the system to intercept the data written to or read from the physical device and perform some type of operation on them. Mapped devices are used by the Logical Volume Manager (LVM) for creating logical drives and by the Linux Unified Key Setup (LUKS) for encrypting data on hard drives.

NOTE

The device mapper creates virtual devices in the   /dev/mapper directory. These files are links to the physical block device files in the /dev directory.

The /proc Directory

The /proc directory is one of the most important tools you can use when troubleshooting hardware issues on a Linux system. It’s not a physical directory on the filesystem but instead a virtual directory that the kernel dynamically populates to provide access to information about the system hardware settings and status.

The Linux kernel changes the files and data in the /proc directory as it monitors the status of hardware on the system. To view the status of the hardware devices and settings, you just need to read the contents of the virtual files using standard Linux text commands.

There are different /proc files available for different system features, including the IRQs, I/O ports, and DMA channels in use on the system by hardware devices. The following sections discuss the files used to monitor these features and how you can access them.

Interrupt Requests

Interrupt requests (called IRQs) allow hardware devices to indicate when they have data to send to the CPU. The PnP system must assign each hardware device installed on the system a unique IRQ address. You can view the current IRQs in use on your Linux system by looking at the /proc/interrupts file using the Linux cat command:

Description

The first column indicates the IRQ assigned to the device. Some IRQs are reserved by the system for specific hardware devices, such as 0 for the system timer and 1 for the system keyboard. Other IRQs are assigned by the system as devices are detected at boot time.

I/O Ports

The system I/O ports are locations in memory where the CPU can send data to and receive data from the hardware device. As with IRQs, the system must assign each device a unique I/O port. This is yet another feature handled by the PnP system.

You can monitor the I/O ports assigned to the hardware devices on your system by looking at the /proc/ioports file:

Description

There are lots of different I/O ports in use on the Linux system at any time, so your output will most likely differ from this example. With PnP, I/O port conflicts aren’t very common, but it is possible that two devices are assigned the same I/O port. In that case, you can manually override the settings automatically assigned by using the setpci command.

Direct memory access

Using I/O ports to send data to the CPU can be somewhat slow. To speed things up, many devices use direct memory access (DMA) channels. DMA channels do what the name implies: They send data from a hardware device directly to memory on the system, without having to wait for the CPU. The CPU can then read those memory locations to access the data when it’s ready.

As with I/O ports, each hardware device that uses DMA must be assigned a unique channel number. To view the DMA channels currently in use on the system, just display the /proc/dma file:

This output indicates that only DMA channel 4 is in use on the Linux system.

The /sys Directory

Yet another tool available for working with devices is the /sys directory. The /sys directory is another virtual directory, similar to the /proc directory. It provides additional information about hardware devices that any user on the system can access.

There are lots of information files available within the /sys directory. They are broken down into subdirectories based on the device and function in the system. You can take a look at the subdirectories and files available within the /sys directory on your system using the ls command-line command:

Description

Notice the different categories of information available. You can obtain information about the system bus, devices, kernel, and even kernel modules installed.

Working with Devices

Linux provides a wealth of command-line tools for using the devices connected to your system as well as monitoring and troubleshooting the devices if there are problems. The following sections walk through some of the more popular tools you’ll want to know about when working with Linux devices.

Finding Devices

One of the first tasks for a new Linux administrator is to find the different devices installed on the Linux system. Fortunately there are a few command-line tools to help out with that.

The lsdev command

The lsdev command-line command displays information about the hardware devices installed on the Linux system. It retrieves information from the /proc/interrupts, /proc/ioports, and /proc/dma virtual files and combines them in one output:

Description

This provides you with one place to view all of the important information about the devices running on the system, making it easier to pick out any conflicts that can be causing problems.

NOTE

The   lsdev tool is part of the procinfo package. You may need to manually install that package in some Linux distributions.

The lsblk command

The lsblk command-line command displays information about the block devices installed on the Linux system. By default, the lsblk command displays all the block devices:

Description

If you notice at the end of output the lsblk command also indicates blocks that are related, as with the device-mapped LVM volumes and the associated physical hard drive. You can modify the lsblk output to see additional information about the blocks by adding command-line options. The -S option displays only information about SCSI block devices on the system:

Description

This is a quick way to view the different SCSI drives installed on the system.

The dmesg command

The kernel ring buffer records kernel-level events as they occur. In a ring buffer, the buffer area stays the same, so event messages overwrite after the buffer area fills up. You can view the current messages in the kernel ring buffer by using the dmesg command. It helps to monitor it whenever you install a new device:

Description

The output from the dmesg command shows the steps the kernel took to recognize the new USB device that was plugged into the system.

Because the kernel is responsible for detecting devices and installing the correct modules, the dmesg command is a great troubleshooting tool to use when a device isn’t working correctly. It can help you determine if a hardware device module didn’t load correctly.

Working with PCI Cards

The lspci command allows you to view the currently installed and recognized PCI and PCIe cards on the Linux system. There are lots of command-line options you can include with the lspci command to display information about the PCI and PCIe cards installed on the system. TABLE 3-2 shows the more common ones that come in handy.

TABLE 3-2    The lspci command-line options.

Option

Description

-A

Defines the method to access the PCI information

-b

Displays connection information from the card point of view

-k

Displays the kernel driver modules for each installed PCI card

-m

Displays information in machine-readable format

-n

Displays vendor and device information as numbers instead of text

-q

Queries the centralized PCI database for information about the installed PCI cards

-t

Displays a tree diagram that shows the connections between cards and buses

-v

Displays additional information (verbose) about the cards

-x

Displays a hexadecimal output dump of the card information

The output from the lspci command without any options shows all devices connected to the system:

Description

You can use the output from the lspci command to troubleshoot PCI card issues, such as if a card isn’t recognized by the Linux system.

Working with USB Devices

You can view the basic information about USB devices connected to your Linux system by using the lsusb command. TABLE 3-3 shows the options that are available with that command.

TABLE 3-3    The lsusb command options.

Option

Description

-d

Displays only devices from the specified vendor ID

-D

Displays information only from devices with the specified device file

-s

Displays information only from devices using the specified bus

-t

Displays information in a tree format, showing related devices

-v

Displays additional information about the devices (verbose mode)

-V

Displays the version of the lsusb program

Here’s an example of the basic lsusb program output:

Description

Most systems incorporate a standard USB hub for connecting multiple USB devices to the USB controller. Fortunately there are only a handful of USB hubs on the market, so all Linux distributions include the device drivers necessary to communicate with each of these USB hubs. That guarantees that your Linux system will at least detect when a USB device is connected.

Using Hot Pluggable Devices

Computer hardware is generally categorized into two types:

- Cold pluggable devices

- Hot pluggable devices

Cold pluggable devices are hardware that can be connected to the system only when the system is completely powered down. These usually include things commonly found inside the computer case, such as memory, PCI cards, and hard drives. You can’t remove any of these things while the system is running.

Conversely, you can usually add and remove hot pluggable devices at any time. These are often external components, such as network connections, monitors, and USB devices. The trick with hot pluggable devices is that somehow the Linux kernel needs to know when the device is connected and automatically load the correct device driver module to support the device.

Linux provides an entire subsystem that interacts with hot pluggable devices, making them accessible to users. This subsystem is described in the following sections.

Detecting Dynamic Devices

The udev device manager is a program that is automatically started at boot time by the init process (usually at run level 5 via the /etc/rc5.d/udev script) or the Systemd systems, and runs in the background at all times. It listens to kernel notifications about hardware devices. As new hardware devices are plugged into the running system, or existing hardware devices removed, the kernel sends out notification event messages.

The udev program listens to these notification messages and compares the messages against rules defined in a set of configuration files, normally stored under the /etc/udev/rules.d directory. If a device matches a defined rule, udev acts on the event notification as defined by the rule.

Each Linux distribution defines a standard set of rules for udev to follow. Rules define actions such as mounting USB memory sticks under the /media folder when they’re installed or disabling network access when a USB network card is removed. You can modify the rules defined, but it’s usually not necessary.

Working with Dynamic Devices

While the udev program runs in the background on your Linux system, you can still interact with it using the udevadm command-line tool. The udevadm command allows you to send commands to the udev program. The format of the udevadm command is as follows:

TABLE 3-4 shows the commands available to send to the udevadm program.

TABLE 3-4    The udevadm commands.

Command

Description

control

Modifies the internal state of udev

info

Queries the udev database for device information

monitor

Listens for kernel events and display them

settle

Watches the udev event queue

test

Simulates a udev event

test-builtin

Runs a built-in device command for debugging

trigger

Requests device events from the kernel

The control command allows you to change the currently running udev program. For example, by adding the -R option, you can force udev to reload the rules defined in the /etc/udev/rules.d directory.

CHAPTER SUMMARY

All Linux systems require hardware to operate. The Linux system uses several methods for communicating with the various hardware devices that you can install on your system. Just like Windows, Linux uses device drivers to communicate with hardware devices. You can install hardware device drivers by either compiling them into the kernel, or by using kernel modules that can easily be removed when the hardware is removed. Most hardware communicates with the device driver software using interrupts and I/O ports. Linux uses the /proc directory to provide access to the system setup for these settings.

Linux allows you to use hotplug hardware devices as well. It provides the   udev program to monitor hardware events and notify user programs when new hardware is added to the system. The popularity of USB devices has made it a necessity for Linux to provide support for them. The Linux kernel can detect USB devices, automatically load the appropriate device driver modules and produce a notice that udev can detect to notify user programs. This makes using USB devices in Linux a simple process.

KEY CONCEPTS AND TERMS

- block devices

- character devices

- cold pluggable

- compiled device driver

- device driver

- direct memory access (DMA)

- general purpose input/output

- hot pluggable

- insmod

- interrupt requests

- I/O ports

- lsmodlspcilsusb

- modprobe

- modules

- Peripheral Component Interface (PCI)

- /proc directory

- rmmod

- /sys directory

- udev

- Universal Serial Bus (USB)

CHAPTER 3 ASSESSMENT

1. The insmod program can install modules by module name.

1. True

2. False

2. Which program lists the modules currently installed on the Linux system?

1. insmod

2. rmmod

3. modprobe

4. lsmod

3. Which two programs will remove a module from the kernel?

1. rmmod

2. insmod

3. modprobe

4. lsmod

4. The /proc/ports file displays the current interrupts assigned on the Linux system.

1. True

2. False

5. Which file documents the interrupts assigned on the Linux system?

1. /proc/ioports

2. /proc/interrupts

3. /proc/dma

4. /sys/interrupts

5. None of the above

6. The __________ system allows a hardware device to directly communicate with the system CPU using the memory.

1. DMA

2. IRQ

3. I/O Ports

4. /proc/dma

7. What command would you use to see a list of the USB devices connected to the Linux system?

1. lsusb

2. lspci

3. lsblk

4. cat /proc/usb

8. The ________ system uses rules to determine how the system should handle hot pluggable devices.

1. kernel modules

2. PCI

3. udev

4. USB

9. The __________ directory contains virtual files that provide information about hardware to user programs.

1. /udev

2. /root

3. hald

4. /sys

10. Which program provides information about devices connected to a PCI board?

1. lspci

2. lsusb

3. modprobe

4. usblist

References

Egidio Docile, “Tutorial on how to write basic udev rules in Linux,” LinuxConfig.org, August 2018, Retrieved October 14, 2021 from https://linuxconfig.org/tutorial-on-how-to-write-basic-udev-rules-in-linux.

Jon Masters, Robby Workman, and Lucas De Marchi, “modprobe,” Ubuntu Manuals, retrieved October 14, 2021 from http://manpages.ubuntu.com/manpages/trusty/man8/modprobe.8.xhtml.

References

Egidio Docile, “Tutorial on how to write basic udev rules in Linux,” LinuxConfig.org, August 2018, Retrieved October 14, 2021 from https://linuxconfig.org/tutorial-on-how-to-write-basic-udev-rules-in-linux.

Jon Masters, Robby Workman, and Lucas De Marchi, “modprobe,” Ubuntu Manuals, retrieved October 14, 2021 from http://manpages.ubuntu.com/manpages/trusty/man8/modprobe.8.xhtml.

© Picsfive/Shutterstock

CHAPTER 4

Booting Linux

BEFORE YOU CAN LOG IN AND START using your Linux system, a complicated process of booting the operating system must take place. A lot happens behind the scenes in the Linux boot process. It helps to know just what all goes on in case something goes wrong.

This chapter examines the boot and start up processes in Linux systems. It first takes a look at the role the computer firmware plays in getting the process started. After that, it discusses Linux boot loaders and examines how to configure them. Finally the chapter ends with a discussion about the Linux initialization process, showing how Linux decides which background applications to start at bootup.

CHAPTER 4 TOPICS

This chapter covers the following topics and concepts:

- The Linux boot process

- Linux boot loaders

- Process initialization

CHAPTER 4 GOALS

When you complete this chapter, you will be able to:

- Describe the Linux boot process

- List the different IBM-compatible firmware software

- List the common Linux boot loaders

- Describe how the GRUB Legacy and GRUB2 boot loaders work

- List the common Linux process initialization methods

- Describe how the SysV, systemd, and Upstart initialization methods work

The Linux Boot Process

When you turn on the power to your Linux system, it triggers a series of events that eventually leads to the login prompt. Normally you don’t worry about what happens behind the scenes of those events; you just log in and start using your applications.

However, there may be times when your Linux system doesn’t boot quite correctly, or perhaps an application that you expected to be running in background mode isn’t. In those cases, it helps to have a basic understanding of just how Linux boots the operating system and starts programs so you can troubleshoot the problem.

Following the Boot Process

The Linux boot process can be split into three steps:

1. The workstation firmware starts, performing a quick check of the hardware (called a power-on self-test [POST]), and then looks for a boot loader program to run from a bootable device.

2. The boot loader runs and determines what Linux kernel program to load.

3. The kernel program loads into memory and starts the necessary background programs required for the system to operate (such as a graphical desktop manager for desktops, or web and database servers for servers).

While on the surface these three steps may seem simple, there’s a somewhat complicated ballet of operations that happen behind the scenes to keep the boot process working. Each step performs several actions as they prepare your system to run Linux.

Viewing the Boot Process

You can monitor the Linux boot process by watching the system console screen as the system boots. You’ll see lots of informative messages scroll by as the system detects hardware and loads software.

TIP

Some graphical desktop Linux distributions hide the boot messages on a separate console window. Often you can hit either the ESC key, or the Ctrl-Alt-F1 key combination to view those messages.

Sometimes the boot messages scroll by somewhat quickly, and it’s hard to see just what’s happening. If you need to troubleshoot boot problems, you can review the boot time messages using the dmesg command. Most Linux distributions copy the boot kernel messages into a special ring buffer in memory, called the kernel ring buffer. The buffer is circular, and set to a predetermined size. As new messages are logged in the buffer, older messages are rotated out.

You use the dmesg command displays boot messages currently stored in the kernel ring buffer:

Description

Most Linux distributions also store the boot messages in a log file, usually in the /var/log folder.

While it helps to be able to see the different messages generated during boot time, it is also helpful to know just what generates those messages. This chapter discusses each of these three boot steps and goes through some examples showing just how they work.

The Firmware Startup

All workstations and servers utilize some type of built-in firmware to control just how the installed operating system starts. On older workstations and servers this firmware was called the Basic Input/Output System (BIOS). On newer workstations and servers, a new method, called the Unified Extensible Firmware Interface (UEFI) is responsible for maintaining the system hardware status and launching an installed operating system.

Both methods launch the Linux boot loader but use different methods for doing that. This section walks through the basics of both BIOS and UEFI methods, showing just how they participate in the Linux boot process.

The BIOS Startup

The BIOS firmware found in older workstations and servers was somewhat limited in what it could do. The BIOS firmware had a simplistic menu interface that allowed you to change some settings to control just how the system found hardware and define what device the BIOS should use to start the operating system.

The BIOS firmware itself could only read one sector’s worth of data from a hard drive into memory to run. As you can probably guess, that’s not enough space to load an entire operating system. This caused most operating systems (including Linux and Microsoft Windows) to split the boot process into two parts.

First, the BIOS runs a boot loader program. The boot loader program is a small program that initializes the necessary hardware to find and run the full operating system program, usually located at another location on the same hard drive, but sometimes on a separate internal or external storage device.

The boot loader program usually has a configuration file, so you can tell it just where to look to find the actual operating system file to run, or even to produce a small menu allowing the user to boot between multiple operating systems.

To get things started, the BIOS must know where to find the boot loader program on an installed storage device. Most BIOS setups allow you to load the boot loader program from several locations:

- An internal hard drive

- An external hard drive

- A CD/DVD drive

- A USB memory stick

- A network server

When booting from a hard drive, you must designate which hard drive, and partition on the hard drive, the BIOS should load the boot loader program from. This is done by defining a Master Boot Record (MBR).

The MBR is the first sector on the first hard drive partition on the system. There is only one MBR for the computer system. The BIOS looks for the MBR and reads the program stored there into memory. When it runs the boot loader program, that program then points to the location of the actual operating system kernel file, stored in a boot sector of a separate partition installed on the system. There are no size limitations on the kernel boot file.

technical TIP

The boot loader program isn’t required to point directly to an operating system kernel file; it can point to any type of program, including another boot loader program. You can create a primary boot loader program that points to a secondary boot loader program, which provides options to load multiple operating systems. This process is called   chainloading.

The UEFI Startup

While there were extreme limitations with BIOS, computer manufacturers learned to live with them, so BIOS became the default standard for workstations and servers for many years. However, as operating systems and hardware became more complicated, it eventually became clear that a new method needed to be developed.

Intel created the Extensible Firmware Interface (EFI) in 1998 to address some of the limitations of BIOS. By 2005, the idea caught on with other vendors, and the UEFI specification was adopted as a standard. These days just about all desktop and server systems can support the UEFI firmware standard.

The UEFI firmware can work with MBR formatted hard disks, but also uses a newer format, called GUID Partition Table (GPT). Instead of relying on a single boot sector on a hard drive to hold the boot loader program, GPT specifies a special disk partition, called the EFI System Partition (ESP) to store boot loader programs. This allows for any size of boot loader program, plus the ability to store multiple boot loader programs for multiple operating systems.

The ESP setup utilizes the old Microsoft File Allocation Table (FAT) filesystem to store the boot loader programs, which restricts the size of the filesystem. On Linux systems, the ESP is typically mounted in the /boot/efi folder, and the boot loader files are typically stored using the .efi filename extension.

The UEFI firmware utilizes a built-in mini boot loader (sometimes referred to as a boot manager) that allows you to configure just which boot loader program file to launch.

With UEFI you need to register each individual boot loader file you want to appear at boot time in the boot manager interface menu. You can then select the boot loader to run each time you boot the system.

Once the firmware finds and runs the boot loader, its job is done. The boot loader step in the boot process can be somewhat complicated; the next section dives into covering that.

Linux Boot Loaders

The boot loader program helps bridge the gap between the system firmware and the full Linux operating system kernel. In Linux there are several choices of boot loaders to use. However, the most popular ones that you’ll run across are the following:

- Linux Loader (LILO)

- Grand Unified Boot Loader (GRUB) Legacy

- GRUB2

In the original versions of Linux the LILO boot loader was the only boot loader program available. It was extremely limited in what it could do, but it accomplished its purpose—loading the Linux kernel from the BIOS startup. LILO became the default boot loader used by Linux distributions in the 1990s. Unfortunately, LILO doesn’t work with GPT disks, so it has limited use on modern systems and is quickly fading into history.

The first version of the GRUB boot loader (now called GRUB Legacy) was created in 1999 to provide a more robust and configurable boot loader to replace LILO. GRUB quickly became the default boot loader for all Linux distributions, whether they were run on BIOS or UEFI systems.

GRUB2 was created in 2005 as a total rewrite of the GRUB Legacy system. It supports advanced features, such as the ability to load hardware driver modules and using logic statements to dynamically alter the boot menu options, depending on conditions detected on the system (such as if an external hard drive is connected).

NOTE

Since UEFI can load any size of boot loader program, it’s now possible to load a Linux operating system kernel directly without a special boot loader program. This feature was incorporated in the Linux kernel starting with version 3.3.0. However, this method isn’t common, as boot loader programs can provide more versatility in booting, especially when working with multiple operating systems.

This section walks through the basics of both the GRUB Legacy and GRUB2 boot loaders, which should cover just about every Linux distribution that you’ll run into these days.

GRUB Legacy

The GRUB Legacy boot loader was designed to simplify the process of creating boot menus and passing options to kernels. GRUB Legacy allows you to select multiple kernels and/or operating systems using both a menu interface as well as an interactive shell. You configure the menu interface to provide options for each kernel or operating system you want to boot with. The interactive shell provides a way for you to customize boot commands on the fly.

Both methods utilize a set of commands that control features of the boot loader. This section walks through how to configure the GRUB Legacy bootloader, how to install it, and how to interact with it at boot time.

Configuring GRUB Legacy

When you use the GRUB Legacy interactive menu, you need to tell it just what options to show. You do that using special GRUB commands.

The GRUB Legacy system stores the menu commands in a standard text file. The configuration file used by GRUB Legacy is called menu.lst and is stored in the /boot/grub folder (while not a requirement, some Linux distributions create a separate /boot partition on the hard drive). Red Hat–derived Linux distributions (such as CentOS and Fedora) use grub.conf instead of menu.lst for the configuration file.

The GRUB Legacy configuration file consists of two sections:

- Global definitions

- Operating system boot definitions

The global definitions section defines commands that control the overall operation of the GRUB Legacy boot menu. The global definitions must appear first in the configuration file. There are only a handful of global settings that you can make; TABLE 4-1 shows these settings.

TABLE 4-1    GRUB Legacy global commands.

Setting

Description

color

Specifies the foreground and background colors to use in the boot menu

default

Defines the default menu option to select

fallback

A secondary menu selection to use if the default menu option fails

hiddenmeu

Don’t display the menu selection options

splashimage

Points to an image file to use as the background for the boot menu

timeout

Specifies the amount of time to wait for a menu selection before using the default

For GRUB Legacy, to define a value for a command you just list the value as a command line parameter:

The color command defines the color scheme for the menu. The first pair define the foreground/background pair for normal menu entries, while the second pair define the foreground/background pair for the selected menu entry.

After the global definitions, you place definitions for the individual operating systems that are installed on the system. Each operating system should have its own definition section. There are a lot of boot definition settings that you can use to customize how the boot loader finds the operating system kernel file. Fortunately, just a few commands are required to define the operating system. The ones to remember are the following:

- title—the first line for each boot definition section, this is what appears in the boot menu

- root—defines the disk and partition where the GRUB /boot folder partition is on the system

- kernel—defines the kernel image file stored in the /boot folder to load

- initrd—defines the initial RAM Disk file, which contains hardware drivers necessary for the kernel to interact with the system hardware

- rootnoverify—defines non-Linux boot partitions, such as Windows

The root command defines the hard drive and partition that contains the /boot folder for GRUB Legacy. Unfortunately, GRUB Legacy uses a somewhat odd way of referencing those values:

GRUB Legacy doesn’t refer to hard drives the way Linux does; it uses a number system to reference both disks and partitions, starting at 0 instead of 1. For example, to reference the first partition on the first hard drive on the system, you’d use (hd0,0). To reference the second partition on the first hard drive, you’d use (hd0,1).

Here’s a sample GRUB configuration file that defines both a Windows and a Linux partition for booting:

This example shows two boot options—one for an Ubuntu Linux system and one for a Windows system. The Ubuntu system is installed on the first partition of the second hard drive, while the Windows system is installed on the first partition of the first hard drive.

Installing GRUB Legacy

Once you build the GRUB Legacy configuration file (as either menu.lst or grub.conf, depending on your Linux distribution), you must install GRUB in the MBR. The command to do this is grub-install.

The grub-install command uses a single parameter—the partition to install GRUB on. You can specify the partition using either Linux or GRUB Legacy format. For example, to use Linux format you’d use

to install GRUB on the MBR of the first hard drive. To use GRUB Legacy format, you must enclose the hard drive format in quotes:

If you’re using the chainloading method and prefer to install a copy of GRUB Legacy on the boot sector of a partition instead of to the MBR of a hard drive, you must specify the partition, again using either Linux or GRUB format:

You don’t need to reinstall GRUB Legacy in the MBR after making changes to the configuration file — GRUB Legacy reads the configuration file each time it runs.

Interacting with GRUB Legacy

When you boot a system that uses the GRUB Legacy boot loader you’ll see a menu that shows the boot options you defined in the configuration file. If you wait for the timeout to expire, the default boot option will process. Alternatively, you can use the arrow keys to select one of the boot options, then press the ENTER key to select it.

You can also edit boot options on the fly from the GRUB menu. First, arrow to the boot option you want to modify, then press the E key. A new screen will appear, showing the currently configured options for that entry. Use the arrow key to move the cursor to the line you need to modify, then press the E key to edit it. Press the B key to boot the system using the new values. You can also press the C key at any time to enter an interactive shell mode, allowing you to submit commands on the fly.

GRUB2

Since the GRUB2 system was intended to be an improvement over GRUB Legacy, many of the features are the same, with just a few twists. For example, the GRUB2 system changes the configuration file name to grub.cfg, and stores it in the /boot/grub/ folder. (This allows you to have both GRUB Legacy and GRUB2 installed at the same time.)

Configuring GRUB2

There are also a few changes to the commands used in GRUB2. For example, instead of the title command, GRUB uses the menuentry command, and you must also enclose each individual boot section with braces immediately following the menuentry command. Here’s an example of a sample GRUB2 configuration file:

Description

Notice that GRUB2 uses the set command to assign values to the root keyword as well as uses an equal sign to assign the device. GRUB2 utilizes environment variables to configure settings instead of commands.

To make things more confusing, GRUB2 changes the numbering system for partitions. While it still uses 0 for the first hard drive, the first partition is set to 1. So to define the /boot folder on the first partition of the first hard drive, you now need to use:

Also, notice that the rootnoverify and kernel commands are not used in GRUB2. Non-Linux boot options are now defined the same as Linux boot options using the root environment variable, and you define the kernel location using the linux command.

The configuration process for GRUB2 is also somewhat different. While the /boot/grub/grub.cfg file is the configuration file that GRUB2 uses, you should never modify that file. Instead, separate configuration files are stored in the /etc/grub.d folder. This allows you (or the system) to create individual configuration files for each boot option installed on your system (for example, one configuration file for booting Linux, and another for booting Windows).

For global commands, use the /etc/default/grub configuration file. You’ll notice that the format for some of the global commands has changed from the GRUB Legacy commands, such as GRUB_TIMEOUT instead of just timeout.

Most Linux distributions generate the new grub.cfg configuration file automatically after certain events, such as upgrading the kernel.

Installing GRUB2

Unlike GRUB Legacy, you don’t need to install GRUB2; all you need to do is rebuild the main installation file. This is done by running the grub-mkconfig program.

The grub-mkconfig program reads configuration files stored in the /etc/grub.d folder and assembles the commands into the single grub.cfg configuration file.

You can update the configuration file manually by running the grub-mkconfig command:

Notice that you must manually redirect the output of the grub-mkconfig program to the grub.cfg configuration file. By default the grub-mkconfig program outputs the new configuration file commands to standard output.

Interacting with GRUB2

The GRUB2 boot loader produces a boot menu similar to the GRUB Legacy method. You can use arrow keys to switch between boot options, the E key to edit a boot entry, or the C key to bring up the GRUB2 command line to submit interactive boot commands.

Alternative Bootloaders

While GRUB Legacy and GRUB2 are the most popular Linux bootloader programs in use, there are still a few others that you may run into, depending on which Linux distributions you use.

The Syslinux project includes five separate bootloader programs that have special uses in Linux:

- SYSLINUX—a bootloader for systems that use the Microsoft FAT filesystem (popular for booting from USB memory sticks)

- EXTLINUX—a mini bootloader for booting from an ext2, ext3, ext4, or btrfs filesystem

- ISOLINUX—a bootloader for booting from a LiveCD or LiveDVD

- PXELINUX—a bootloader for booting from a network server

- MEMDISK—a utility to boot older DOS operating systems from the other Syslinux bootloaders

The ISOLINUX bootloader is popular for use in distributions that release a LiveDVD version. The bootloader requires two files: isolinux.bin, which contains the bootloader program image, and isolinux.cfg, which contains the configuration settings.

The PXELINUX bootloader is somewhat complicated. It uses the Pre-boot eXecution Environment (PXE) standard, which defines how a network workstation can boot and load an operating system from a central network server. PXE uses DHCP to assign a network address to the workstation and BOOTP and TFTP to load the bootloader image from the server.

To utilize PXELINUX the TFTP server needs to have the PXELINUX bootloader program, commonly stored as /tftpboot/pxelinux.0, available for the workstations to download. Each workstation must also have a configuration file available in the /tftpboot/pxelinux.cfg folder. The files are named based on the MAC address of the workstation and contain specific configuration settings required for that workstation.

Process Initialization

A Linux system includes lots of programs running in background to provide services for the system. It’s the init program’s job to start all of those programs when the Linux system starts up. This is called the initialization process.

You must configure the initialization process to start programs based on the desired features you want running in your Linux system. For example, a Linux server doesn’t necessarily need to start a graphical desktop environment, or a Linux desktop doesn’t necessarily need to start the Apache web server service.

While several initialization methods are available in Linux, two have risen to the top and are the most popular used in Linux distributions:

- Unix System V (also called SysVinit)

- Systemd

The original Linux init program was based off of the Unix System V init program, and became commonly called SysVinit. The init program uses a series of shell scripts, divided into separate runlevels, to determine what programs run at what times. Each program uses a separate shell script to start and stop the program. The system administrator sets which runlevel the Linux system starts in, which in turn determines which set of programs are running. The system administrator can also change the runlevel at any time while the system is running.

The init program had served the Linux community well for many years, but as Linux systems became more complicated and required more services, the runlevel shell scripts have become more complicated. This has caused Linux developers to look for other solutions.

The systemd program was developed by the Red Hat Linux distribution to handle dynamic Linux environments. Instead of runlevels it uses targets and units to control what applications run at any time on the system. It uses separate configuration files that determine this behavior.

To find out which method your Linux system uses, use the ps command to display the program assigned process ID (PID) 1:

Description

The output from this Ubuntu system shows that it’s running the systemd program. The following sections take a closer look at each of these initialization process methods to help you get comfortable in any Linux environment.

The SysVinit Method

The key to the SysVinit initialization process is runlevels. The init program determines which programs to start, based on the runlevel of the system.

Runlevels are numbered from 0 to 6, and each one is assigned a set of programs that should be running for that runlevel. When the Linux kernel starts, it determines which runlevel to start by a configuration file. It’s important to know how to manage runlevels and how to determine when each runlevel is used by the kernel. The following sections show how to do just that.

Runlevels

While each Linux distribution defines applications that should be running at specific runlevels, you can use some general guidelines. TABLE 4-2 shows the general use of the Linux runlevels.

TABLE 4-2    Linux runlevels.

Runlevel

Description

0

Shut down the system

1

Single-user mode. Used for system maintenance.

2

On Debian-based systems, multi-user graphical mode

3

On Red Hat-based systems, multi-user text mode

4

Undefined

5

On Red Hat–based systems, multi-user graphical mode

6

Reboot the system

Most Linux distributions use the Red-Hat runlevel method of using runlevel 3 for multi-user text mode and runlevel 5 for multi-user graphical mode.

Starting applications in a runlevel

There are two ways to start applications in runlevels:

- Using the /etc/inittab file

- Using startup scripts

The /etc/inittab file defines what applications start at which runlevel. Each line in the /etc/inittab file defines an application and uses the following format:

The id field contains one to four characters that uniquely defines the process. The runlevels field contains a list of runlevels in which the application should be running. The list is not comma separated, so the value 345 indicates the application should be started in runlevels 3, 4, and 5.

The action field contains a keyword that tells the kernel what to do with the application for that runlevel Possible values are shown in TABLE 4-3.

TABLE 4-3    The SysV inittab action values.

Action

Description

boot

The process is started at boot time.

bootwait

The process is started at boot time and the system will wait for it to finish.

initdefault

The runlevel to enter after the system boots is specified.

kbrequest

The process is started after a special key combination is pressed.

once

The process is started once when the runlevel is entered.

powerfail

The process is started when the system is powered down.

powerwait

The process is started when the system is powered down, and the system will wait for it to finish.

respawn

The process is started when the runlevel is entered and restarted whenever it terminates.

sysinit

The process is started at boot time before any boot or bootwait items.

wait

The process is started once and the system will wait for it to finish.

The initdefault line specifies the runlevel that the system normally runs in after boot:

Besides the runlevels, the SysVinit method also specifies startup scripts to control how applications start and stop. The /etc/init.d/rc or /etc/rc.d/rc script runs all scripts with a specified runlevel. The scripts themselves are stored in the /etc/init.d/rcx.d or /etc/rcx.d folders, where x is the runlevel number.

Scripts are stored with a specific filename that specifies whether they start or stop at the runlevel. Scripts that start with an S start the program, and scripts that start with a K stop it. The script filenames also contain a number, which indicates the order the rc program runs the scripts. This allows you to specify which scripts get started before others to control any dependency issues.

Checking the runlevel

You’ve seen that the /etc/inittab file indicates the default runlevel with the initdefault action; however, there’s no guarantee that’s the runlevel your Linux system is currently running at. The runlevel command displays both the current runlevel and the previous runlevel for the system:

The first character is the previous runlevel. The N character means the system is in the original boot runlevel. The second character is the current runlevel.

Changing Runlevels

You can change the current runlevel of your Linux system using either the init or telinit command. Just specify the runlevel number as the command line parameter. For example, to reboot your system you can enter the command:

The downside to using the init command is that it immediately changes the system to the specified runlevel. That may not be an issue if you’re the only person on your Linux system, but in a multi-user Linux environment that can have adverse effects for the other users.

A kinder way to change the runlevel on multi-user systems is to use one of a handful of special commands used just for that purpose:

- shutdown—Gracefully changes the runlevel to 1, or single-user mode

- halt—Gracefully changes the runlevel to 0 to stop the system

- poweroff—Gracefully changes the runlevel to 0 to stop the system

- reboot—Gracefully changes the runlevel to 6 to restart the system

Each of these commands also allow you to specify a message to send to any other users on the system before it changes the runlevel. You can also specify a time for the change, such as +15 for 15 minutes, along with a message to send to other users.

NOTE

To permanently change the runlevel the Linux system starts at, modify the /etc/inittab file.

The Systemd Method

The systemd initialization process method has quickly become a standard. While it started out as a Red Hat feature, now most Linux distributions have adopted it as their default initialization method.

The systemd initialization process introduced a major paradigm shift in how Linux systems handle services, which has also caused some controversy in the Linux world. Instead of lots of small initialization shell scripts, the systemd method uses one monolithic program that uses individual configuration files for each service. This is somewhat of a departure from earlier Linux philosophy.

This section walks through the basics of how the systemd initialization process works.

Units and targets

Instead of using shell scripts and runlevels, the systemd method uses units and targets. A unit defines a service or action on the system. It consists of a name, a type, and a configuration file. There are currently 12 different types of systemd units:

- automount

- device

- mount

- path

- scope

- service

- slice

- snapshot

- socket

- swap

- target

- timer

The systemd program identifies units by their name and type using the format name.type. You use the systemctl command when working with units. To list the units currently loaded in your Linux system, use the list-units parameter:

Description

Linux distributions can have hundreds of different units loaded and active, this listing shows just a few from the output to show you what they look like. The systemd method uses service type units to manage the daemons on the Linux system. The target type units are important in that they group multiple units together so they can be started at the same time. For example, the network.target unit groups all the units required to start the network interfaces for the system.

The systemd initialization process uses targets similar to the way SysV runlevels. Each target represents a different group of services that should be running on the system. Instead of changing runlevels to alter what’s running on the system, you just change targets.

To make the transition from SysV to systemd smoother, there are targets that mimic the standard 0 through 6 SysV runlevels, called runlevel0.target through runlevel6.target.

NOTE

Another feature of the systemd method is that it allows you to list any required units that must be started before a unit can start (called dependencies). If a target specifies a unit that has dependencies configured, the dependent units are automatically started first.

Configuring units

Each unit requires a configuration file that defines what program it starts and how it should start the program. The systemd system stores unit configuration files in the /usr/lib/systemd/system folder. Here’s an example of the cron.service unit configuration file used in Ubuntu:

Description

The cron.service configuration file defines the program to start (/usr/sbin/cron), along with some other features, such as what services should run before the cron service starts (the After line), what target level the system should be in (the WantedBy line), and how to reload the program (the Restart line).

Target units also use configuration files. They don’t define programs but, instead, define which service units to start. Here’s an example of the graphical.target unit configuration file used in CentOS:

Description

The target configuration defines what targets should be loaded first (the After line), what targets are required for this target to start (the Requires line), what targets conflict with this target (the Conflicts line), and what targets or services the target requires to be running (the Wants line).

Setting the default target

The default target used when the Linux system boots is defined as the file default.target, located in the /usr/lib/systemd/system folder. This is the file the systemd program looks for when it starts up. This file is normally set as a link to a standard target file also in the /usr/lib/systemd/system folder:

Description

On this Ubuntu system, the default target is set to the graphical.target unit.

You can also see the default target for the system by using the systemctl command:

This again shows that the graphical.target target is the default.

The systemctl program

You use the systemctl program to also control services and targets. The systemctl program uses options to define what action to take, as shown in TABLE 4-4.

TABLE 4-4    The systemctl commands.

Command name

Explanation

get-default

Displays the default target configured for the system

list-units

Displays the current status of all configured units

default name

Changes to the default target unit

isolate name

Starts the named unit and stops all others

start name

Starts the named unit

stop name

Stops the named unit

reload name

Causes the named unit to reload its configuration file

restart name

Causes the named unit to shut down and restart

status name

Displays the status of the named unit (You can pass a PID value rather than a name, if you like.)

enable name

Configures the unit to start when the computer next boots

disable name

Configures the unit to not start when the computer next boots

Instead of using shell scripts to start and stop services, you use the start and stop commands:

Description

To change the target that is currently running, you must use the isolate command. For example, to enter single-user mode you’d use:

To go back to the default target for the system, you just use the default command.

One of the more controversial features of the systemd initialization process is that it doesn’t use the standard Linux syslogd log file system. Instead, it has its own log files, and those log files are not stored in text format. To view the systemd log files, you need to use the journalctl program.

CHAPTER SUMMARY

Booting a Linux system is a three-step process. First, the system firmware must test the hardware and launch the boot loader program. There are two popular firmware systems for both workstation and server systems—BIOS and UEFI.

Linux has several boot loader programs that you can use. The GRUB Legacy and GRUB2 boot loaders are currently the most popular. Both allow you to define a configuration file that creates a boot menu, providing for a multi-boot system. The boot loader program points to the appropriate operating system kernel file to load to start the Linux system.

Once the Linux kernel loads, it must determine what services and applications to start. This is done by using an initialization process. There are two popular initialization process methods in Linux. The SysV method is the oldest and utilizes startup script files similar to the Unix system. It uses runlevels to determine which programs start. The most distribution now use the Systemd method. This method defines units and targets that control which programs start.

KEY CONCEPTS AND TERMS

- Basic Input/Output System (BIOS)

- boot loader

- boot manager

- chainloading

- EFI System Partition (ESP)

- Extensible Firmware Interface (EFI)

- File Allocation Table (FAT)

- Grand Unified Boot Loader (GRUB) Legacy

- GRUB2

- init

- initialization process

- kernel ring buffer

- Linux Loader (LILO)

- Master Boot Record (MBR)

- power-on self-test (POST)

- runlevels

- systemd

- SysVinit

- target

- Unified Extensible Firmware Interface (UEFI)

- unit

CHAPTER 4 ASSESSMENT

1. What Linux program allows you to view the kernel boot messages?

1. dmesg

2. system

3. upstart

4. systemctl

2. Which firmware allows you to store the initial boot loader file in a folder?

1. BIOS

2. systemd

3. UEFI

4. upstart

3. Which was the first Linux boot loader program used?

1. GRUB2

2. LILO

3. GRUB Legacy

4. systemd

4. The SysVinit initialization process method duplicates the method used on Unix systems.

1. True

2. False

5. ___________ determine which programs are running on the Linux system at any time

1. Units

2. Boot loaders

3. Chainloaders

4. Runlevels

6. The systemd initialization process uses __________ to define which programs run.

1. targets

2. units

3. runlevels

4. boot loaders

7. Which GRUB2 command defines the start of a new boot option section?

1. title

2. root

3. menuentry

4. set

8. Which GRUB2 environment variable defines the location of the /boot folder?

1. title

2. root

3. menuentry

4. set

9. The __________ command allows you to view the current runlevel of the Linux system.

1. systemd

2. grub

3. init

4. runlevel

10. The init command allows you to change the runlevel of a running Linux system.

1. True

2. False

© Picsfive/Shutterstock

CHAPTER 5

Disk Management

SOME PEOPLE ARE AFRAID to use Linux because they do not understand how to use or find their drives. With some of the earlier versions of Linux, people would insert an external disk such as a USB thumb drive and it wouldn’t pop up on the screen like it does in Microsoft Windows. This caused a great deal of frustration for novice Linux users. If people cannot find or use their storage, they will not feel comfortable using the operating system.

There have been many enhancements to the Linux operating system over the years that make it much easier to work with disks. Linux has an extensive number of command-line and graphical user interface tools for managing disks. Though having experience with Linux disks gives you an advantage; you don’t have to be an expert in Linux to use these tools. An extensive development of disk management tools for Linux makes it easy for even the most novice user.

The control, reliability, and predictability of the way Linux handles disks have made the operating system one of the primary choices of people performing computer forensic acquisitions, which involves making an image of a disk. After reading this chapter, you will have a better understanding of how Linux assigns drive device names and what all of the drive letters and number destinations, such as sdb2 and sde3, mean. The drive letter designations may initially seem more difficult to understand, but as you will learn, the process by which the Linux operating system assigns them is logical and predictable.

The Linux operating system supports many different filesystem types. Linux has its own filesystems, such as ext2, ext3, ext4, and btrfs, and it can support a large number of other filesystems including FAT32 and New Technology File System (NTFS), the primary filesystems used by Microsoft Windows operating systems. The versatility of Linux and its support for a large number of filesystems have helped contribute to the increase in overall market share.

If you want to use the Linux operating system effectively, you need to have an understanding of how disks are accessed and managed. This chapter will explore the various aspects of disk management in Linux. Understanding the convention that Linux uses for disks and knowing the commands that are used to interact with storage devices are critical knowledge for anyone who wants to use
Linux effectively.

CHAPTER 5 TOPICS

This chapter covers the following topics and concepts:

- What disk types are

- How to use Linux partitioning tools

- How the Linux filesystem is supported

- How to make filesystems

- How to mount filesystems

- How to use filesystem maintenance tools

- What the Linux Filesystem Hierarchy Standard is

CHAPTER 5 GOALS

When you complete this chapter, you will be able to:

- Explain how hard drives are assigned in Linux

- Identify filesystems that Linux supports and common filesystems

- Explain the numbering designations for partitions

- Explain how to mount a filesystem in Linux and identify mounted partitions

- Explain how the fdisk command can be used to identify and partition disks

- Identify tools used to check disk integrity

- Explain how to format a drive in Linux

- Identify which Linux filesystems use journaling

- Explain how to use the mkfs command in Linux

- Articulate what /etc/fstab is used for

- Identify common directories in Linux systems

- Explain how a drive can be disconnected (unmounted)

- Identify the location of files within the Linux filesystem hierarchy

Storage Basics

The most common way to persistently store data on computer systems is using a hard disk drive (HDD). Hard disk drives are physical devices that store data using a set of disk platters that spin around, storing data magnetically on the platters with a moveable read/write head that writes and retrieves magnetic images on the platters.

These days another popular type of persistent storage is called a solid-state drive (SSD). These drives use integrated circuits to store data electronically. There are no moving parts contained in SSDs, making them faster and more resilient than HDDs. While currently SSDs are more expensive than HDDs, technology is quickly changing that, and it may not be long before HDDs are a thing of the past.

Linux handles both HDD and SSD storage devices the same way. It mostly depends on the connection method used to connect the drives to the Linux system. This section describes the different methods that Linux uses in connecting and using both HDD and SSD devices.

Drive Connections

While HDDs and SSDs differ in the way they store data, they both interface with the Linux system using the same methods. There are three main types of drive connections that you’ll run into with Linux systems:

- Parallel Advanced Technology Attachment (PATA) connects drives using a parallel interface, which require a wide connector. PATA supports two devices per adapter.

- Serial Advanced Technology Attachment (SATA) connects drives using a serial interface, but at a much faster speed than PATA. SATA supports up to four devices per adapter.

- Small Computer System Interface (SCSI) connects drives using a parallel interface, but with the speed of SATA. SCSI supports up to eight devices per adapter.

- Non-Volatile Memory Express (NVMe) connects solid state drives using a parallel interface for maximum data transfer speeds. The NVMe standard supports up to 12 devices per adapter.

When you connect a drive to a Linux system, the Linux kernel assigns the drive device a file in the /dev directory. That file is called a raw device, as it provides a path directly to the drive from the Linux system. Any data written to the file is written to the drive, and reading the file reads data directly from the drive.

For PATA devices, this file is named /dev/hdx, where x is a letter representing the individual drive, starting with a. For SATA and SCSI devices, Linux uses /dev/sdx,
where x is a letter representing the individual drive, again, starting with a. Thus, to reference the first SATA device on the system, you’d use /dev/sda, then for the second device /dev/sdb, and so on.

Partitioning Drives

Most storage devices allow you to partition the device into multiple sections. A partition is a self-contained section within the drive that the operating system treats as a separate storage space.

Partitioning drives can help you better organize your data, such as segmenting operating system data from user data. If a rogue user fills up her /home disk space with data, the operating system will still have room to operate on the separate partition.

Partitions must be tracked by some type of indexing system on the drive. Systems that use the old BIOS boot loader method (see Chapter 4) use the Master Boot Record (MBR) method for managing disk partitions. This method only supports up to four primary partitions on a drive. Alternatively, you can create one or more extended partitions, which can be split into multiple partitions.

Systems that use the UEFI boot loader method (see Chapter 4) use the more advanced GUID Partition Table (GPT) method for managing partitions, which supports up to 128 partitions on a drive. Linux assigns the partition numbers in the order that the partition appears on the drive, starting with number 1.

Linux creates /dev files for each separate disk partition. It attaches the partition number to the end of the device name, and numbers the primary partitions starting at 1, so the first primary partition on the first SATA drive would be /dev/sda1. MBR extended partitions are numbered starting at 5, so the first extended partition is assigned the file /dev/sda5.

Automatic Drive Detection

Linux systems detect drives and partitions at boot time and assigns each one a unique device file name. However, with the invention of removable USB drives (such as memory sticks), which can be added and removed at will while the system is running, that method needed to be modified.

Most Linux systems now use the udev application. The udev program runs in the background at all times and automatically detects new hardware connected to the running Linux system. As you connect new drives, USB devices, or optical drives (such as CD and DVD devices), udev will detect them and assign each one a unique device file name in the /dev directory.

Another feature of the udev application is that it also creates persistent device files for storage devices. When you add or remove a removable storage device, the /dev name assigned to it may change, depending on what devices are connected at any given time. That can make it difficult for applications to find the same storage device each time.

To solve that problem, the udev application uses the /dev/disk directory to create links to the /dev storage device files based on unique attributes of the drive. There are four separate directories udev creates for storing links:

- /dev/disk/by-id—Links storage devices by their manufacturer make, model, and serial number

- /dev/disk/by-label—Links storage devices by the label assigned to them

- /dev/disk/by-path—Links storage devices by the physical hardware port they are connected to

- /dev/disk/by-uuid—Links storage devices by the 128-bit Universal Unique Identifier (UUID) assigned to the device.

With the udev device links you can specifically reference a storage device by a permanent identifier rather than were or when it was plugged into the Linux system.

Partitioning Tools

After you connect a drive to your Linux system, you’ll need to create partitions on it (even if there’s only one partition). Linux provides several tools for working with raw storage devices to create partitions. This section covers the most popular partitioning tools you’ll run across in Linux.

Working with fdisk

The most common command line partitioning tool is the fdisk utility. The fdisk program allows you to create, view, delete, and modify partitions on any drive that uses the MBR method of indexing partitions; it can’t work with GPT indexed partitions.

To use the fdisk program, you must specify the drive device name (not the partition name) of the device you want to work with:

Description

The fdisk program uses its own command line that allows you to submit commands to work with the drive partitions. TABLE 5-1 shows the common commands you have available to work with.

TABLE 5-1    Common fdisk commands.

COMMAND

DESCRIPTION

a

toggle a bootable flag

b

edit bsd disklabel

c

toggle the DOS compatibility flag

d

delete a partition

g

create a new empty GPT partition table

G

create an IRIX (SGI) partition table

l

list known partition types

m

print this menu

n

add a new partition

o

create a new empty DOS partition table

p

print the partition table

q

quit without saving changes

s

create a new empty Sun disklabel

t

change a partition’s system id

u

change display/entry units

v

verify the partition table

w

write table to disk and exit

x

extra functionality (experts only)

The p command displays the current partition scheme on the drive:

Description

In this example, the /dev/sda drive is sectioned into two partitions, sda1 and sda2. The Id and System columns refer to the type of file system the partition is formatted to handle. Both partitions are formatted to support a Linux file system. The first partition is allocated about 1GB of space, while the second is allocated a little over 9GB of space.

The fdisk command is somewhat rudimentary in that it doesn’t allow you to alter the size of an existing partition; all you can do is delete the existing partition and rebuild it from scratch.

To be able to boot the system from a partition the boot flag must be set for the partition. You do that with the a command. The bootable partitions are indicated in the output listing with an asterisk.

If you make any changes to the drive partitions, you must exit using the w command to write the changes to the drive.

Working with gdisk

If you’re working with drives that use the GPT indexing method, you’ll need to use the gdisk program:

Description

The gdisk program identifies the type of formatting used on the drive. If the drive doesn’t currently use the GPT method, gdisk offers you the option to convert it to a
GPT drive.

The gdisk program also uses its own command prompt, allowing you to enter commands to manipulate the drive layout, as shown in TABLE 5-2.

TABLE 5-2    Common gdisk commands.

COMMAND

DESCRIPTION

b

back up GPT data to a file

c

change a partition’s name

d

delete a partition

i

show detailed information on a partition

l

list known partition types

n

add a new partition

o

create a new empty GUID partition table (GPT)

p

print the partition table

q

quit without saving changes

r

recovery and transformation options (experts only)

s

sort partitions

t

change a partition’s type code

v

verify disk

w

write table to disk and exit

x

extra functionality (experts only)

?

print this menu

You’ll notice that many of the gdisk commands are similar to those in the fdisk program, making it easier to switch between the two programs.

technical TIP

Be careful with converting the drive method specified for your drive. The method you select must be compatible with the system firmware (BIOS or UEFI). If not, your drive will not be able
to boot.

The GNU parted Command

The GNU parted program provides yet another command line interface for working with drive partitions:

Description

Description

One of the selling features of the parted program is that it allows you to modify existing partition sizes, so you can easily shrink or grow partitions on the drive.

Graphical Tools

There are also some graphical tools available to use if you’re working from a graphical desktop environment. The most common of these is the GNOME Partition Editor, called gparted. FIGURE 5-1 shows an example of running gparted in an Ubuntu desktop environment.

FIGURE 5-1 The gparted interface.

Courtesy of Gparted.

Description

The gparted window displays each of the drives on a system one at a time, showing all of the partitions contained in the drive in a graphical layout. You right-click a partition to select options for mounting or unmounting, formatting, deleting, or resizing the partition.

While it’s certainly possible to interact with a drive as a raw device, that’s not usually how Linux applications work. There’s a lot of work trying to read and write data to a raw device. Instead, Linux provides a method for handling all of the dirty work for us, which is covered in the next section.

Understanding File Systems

Just like a storing stuff in a closet, storing data in a Linux system requires some method of organization for it to be efficient. Linux utilizes file systems to manage data stored on storage devices. A file system utilizes a method of maintaining a map to locate each file placed in the storage device. This section describes the Linux file system and shows how you can locate files and directories contained within it.

The Linux file system can be one of the most confusing aspects of working with Linux. Locating files on drives, CDs, and USB memory sticks can be a challenge at first.

If you’re familiar with how Windows manages files and directories, you know that Windows assigns drive letters to each storage device you connect to the system. For example, Windows uses C: for the main drive on the system, or E: for a USB memory stick plugged into the system.

In Windows, you’re used to seeing file paths such as:

This path indicates the file is located in the Documents directory for the rich user account, which is stored on the disk partition assigned the letter C (usually the first drive on the system).

The Windows path tells you exactly what physical device the file is stored on. Unfortunately, Linux doesn’t use this method to reference files. It uses a virtual directory structure. The virtual directory contains file paths from all the storage devices installed on the system, consolidated into a single directory structure.

The Virtual Directory

The Linux virtual directory structure is a way of organizing files and directories regardless of their physical location. It contains a single base directory, called the root directory, which lists files and directories beneath it based on the directory path used to get to them, similar to the way Windows does it.

NOTE

Be careful with the terminology here. While the main admin user account in Linux is called root, that’s not related to the root virtual directory folder. The two are separate, which can be confusing.

For example, a Linux file path could look like this:

First, note that the Linux path uses forward slashes instead of the backward slashes that Windows uses. That’s an important difference that trips many novice Linux administrators. As for the path itself, also notice that there’s no drive letter. The path only indicates that the file test.doc is stored in the Documents directory for the user rich; it doesn’t give you any clues as to which physical device contains the file.

Linux places physical devices in the virtual directory using mount points. A mount point is a directory placeholder within the virtual directory that points to a specific physical device. FIGURE 5-2 demonstrates how this works.

FIGURE 5-2 The Linux virtual directory structure divided between two drives.

Description

In Figure 5-2, there are two partitions used on the Linux system. One partition is associated with the root of the virtual directory (indicated by the single forward slash). The second partition is mounted at the location /home, which is where the user directories are located. Once the second partition is mounted to the virtual directory, files and directories stored on the partition are available under the /home directory.

Since Linux stores everything within the virtual directory, it can get somewhat complicated. Fortunately, there’s a standard format defined for the Linux virtual directory, called the Linux file system hierarchy standard (FHS). The FHS defines core directory names and locations that should be present on every Linux system and what type of data they should contain. TABLE 5-3 shows just a few of the more common directories defined in the FHS.

TABLE 5-3    Common Linux FHS directories.

DIRECTORY

DESCRIPTION

/boot

Contains bootloader files used to boot the system

/home

Contains user data files

/media

Used as a mount point for removable devices

/mnt

Also used as a mount point for removable devices

/opt

Contains data for optional third-party programs

/tmp

Contains temporary files created by system users

/usr

Contains data for standard Linux programs

/usr/bin

Contains local user programs and data

/usr/local

Contains data for programs unique to the local installation

/usr/sbin

Contains data for system programs and data

NOTE

While the FHS helps standardize the Linux virtual file system, not all Linux distributions follow it completely. It’s best to consult with your specific Linux distribution’s documentation on how it manages files within the virtual directory structure.

Maneuvering Around the File System

Using the virtual directory makes it a breeze to move files from one physical device to another. You don’t need to worry about drive letters, just the locations within the virtual directory:

The full path to a file lists each directory within the virtual directory structure to walk your way down to find the file. This format is called an absolute path. The absolute path to a file always starts at the root directory (/), and includes every directory along the virtual directory tree to the file.

Alternatively, you can use a relative path to specify a file location. The relative path to a file denotes the location of a file relative to your current location within the virtual directory tree structure. If you were already in the Documents directory, you’d just need to type the following:

When Linux sees that the path doesn’t start with a forward slash, it assumes the path is relative to the current directory.

Formatting File Systems

Before you can assign a drive partition to a mount point in the virtual directory, you must format it using a file system. Linux supports a myriad of different file system types, with each having different features and capabilities. This section discusses the different file systems that Linux supports and how to format a drive partition for the file systems.

Common File System Types

Each operating system utilizes its own file system type for storing data on drives. Linux not only supports several of its own file system types, but it also supports file systems of other operating systems. This section covers the most common Linux and non-Linux file systems that you can use in your Linux partitions.

Linux file systems

When you create a file system specifically for use on a Linux system, you can choose from four main file systems:

- btrfs—A newer, high-performance file system that supports files up to 16 EiB in size, and a total file system size of 16 EiB. It also can perform its own form of Redundant Array of Independent Disks (RAID) as well as logical volume management (LVM). It includes additional advanced features such as built-in snapshots for backup, improved fault-tolerance, and data compression on the fly.

- ecryptfs—The Enterprise Cryptographic File System (eCryptfs) applies a POSIX-compliant encryption protocol to data before storing it on the device. This provides a layer of protection for data stored on the device. Only the operating system that created the file system can read data from it.

- ext3—Also called ext3fs, this is a descendant of the original Linux ext file system. It supports files up to 2TiB, with a total file system size of 16TiB. It supports journaling as well as faster startup and recovery.

- ext4—Also called ext4fs, it’s the current version of the original Linux file system. It supports files up to 16TiB, with a total file system size of 1EiB. It also supports journaling, and utilizes improved performance features.

- reiserFS—Created before the Linux ext3fs file system and commonly used on older Linux systems, it provides features now found in ext3fs and ext4fs. Linux has dropped support for the most recent version, reiser4fs.swap: The swap file system allows you to create virtual memory for your system using space on a physical drive. The system can then swap data out of normal memory into the swap space, providing a method of adding additional memory to your system. This is not intended for storing persistent data.

The default file system used by many Linux distributions these days is ext4fs. The ext4fs file system provides journaling, which is a method of tracking data not yet written to the drive in a log file, called the journal. If the system fails before the data can be written to the drive, the journal data can be recovered and stored upon the next system boot.

Non-Linux file systems

One of the great features of Linux that makes it so versatile is its ability to read data stored on devices formatted for other operating systems, such as Apple and Microsoft. This feature makes it a breeze to share data between different systems running different operating systems.

Here’s a list of the more common non-Linux file systems that Linux can handle:

- HFS—The Hierarchical File System (HFS) was developed by Apple for its macOS systems. Linux can also interact with the more advanced HFS+ file system.

- ISO-9660—The ISO-9660 standard is used for creating file systems on CD-ROM devices.

- NTFS—The New Technology File System (NTFS) is the file system used by the Microsoft NT operating system and subsequent versions of Windows. Linux can read and write data on an NTFS partition as of kernel 2.6.x.

- UDF—The Universal Disc Format (UDF) is commonly used on DVD-ROM devices for storing data. Linux can both read data from a DVD and write data to a DVD using this file system.

- VFAT—The Virtual File Allocation Table (VFAT) is an extension of the original Microsoft File Allocation Table (FAT) file system. It’s not commonly used on drives but is commonly used for removable storage devices such as USB memory sticks.

- XFS—The X File System (XFS) was created by Silicon Graphics for their (now defunct) advanced graphical workstations. The file system provided some advanced high-performance features that makes it still popular in Linux.

- ZFS—The Zettabyte File System (ZFS) was created by Sun Microsystems (now part of Oracle) for its Unix workstations and servers. Another high-performance file system, it has features similar to the btrfs Linux file system.

While these are all filesystems that originated outside of Linux, many are commonly used in Linux distributions, such as the xfs and zfs filesystems.

Creating File Systems

The Swiss army knife for creating file systems in Linux is the mkfs program. The mkfs program is actually a frontend to several individual tools for creating specific file systems, such as the mkfs.ext4 program for creating ext4 file systems. Fortunately, you don’t need to remember all the individual programs; just specify the filesystem type in the mkfs command, and it automatically runs the correct program.

The beauty of the mkfs program is that you only need to remember one program name to create any type of file system on your Linux system. Just use the -t option to specify the file system type:

Description

Just specify the partition device file name for the partition you want to format on the command line. Notice that the mkfs program does a lot of things behind the scenes when formatting the file system. Each file system has its own method for indexing files and directories and tracking file access. The mkfs program creates all of the index files and tables necessary for the specific file system.

WARNING

Be very careful when specifying the partition device name. When you format a partition, any existing data on the partition is lost. If you specify the wrong partition name you could lose important data or make your Linux system not able to boot.

Mounting File Systems

Once you’ve formatted a drive partition with a file system, you can add it to the virtual directory file system on your Linux system. This process is called mounting the file system.

You can either manually mount the partition within the virtual directory structure from the command line, or you can allow Linux to automatically mount the partition at boot time. This section walks through both of these methods.

Manually Mounting Devices

To temporarily mount a file system to the Linux virtual directory, use the mount command. The basic format for the mount command is:

Use the -f command line option to specify the file system type of the device:

If you specify the mount command with no parameters, it displays all the devices currently mounted on the Linux system. Be prepared for a long output though, as most Linux distributions mount lots of virtual devices in the virtual directory to provide information about system resources. Here’s a partial output from a mount command:

Description

To save space I trimmed down the output from the mount command to show only the physical devices on the system. The main hard drive device (/dev/sda) contains two partitions, and the USB memory stick device (/dev/sdb) also contains two partitions.

NOTE

The   mount command uses the -o option to specify additional features of the file system, such as mounting it in read-only mode, user permissions assigned to the mount point, and how data are stored on the device. These options are shown in the output of the mount command. Usually you can omit the -o option to use the system defaults for the new mount point.

The downside to the mount command is that it only temporarily mounts the device in the virtual directory. When you reboot the system, you have to manually mount the devices again. This is usually fine for removable devices, such as USB memory sticks, but for more permanent devices, it would be nice if Linux could mount them for us automatically. Fortunately for us, Linux can do just that.

To remove a mounted drive from the virtual directory, use the umount command (note the missing “n”). You can remove the mounted drive by specifying either the device file name or the mount point directory.

Automatically Mounting Devices

For permanent storage devices, Linux maintains the /etc/fstab file to indicate which drive devices should be mounted to the virtual directory at boot time. The
/etc/fstab file is a table that indicates the drive device file (either the raw file or one of its permanent udev file names), the mount point location, the file system type, and any additional options required to mount the drive. Here’s an example of the /etc/fstab file from an Ubuntu workstation:

Description

This /etc/fstab file references the devices by their udev UUID value, ensuring the correct drive partition is accessed no matter what order it appears in the raw device table. The first partition is mounted at the /boot/efi mount point in the virtual directory. The second partition is mounted at the root (/) of the virtual directory, and the third partition is mounted as a swap area for virtual memory.

You can manually add devices to the /etc/fstab file so that they are mounted automatically when the Linux system boots. However, if they don’t exist at boot time, that will generate a boot error.

NOTE

If you use the encryptfs file system type on any partitions, they will appear in the   /etc/crypttab file, and will be mounted automatically at boot time. While the system is running, you can also view all of the currently mounted devices, whether they were mounted automatically by the system or manually by users by viewing the /etc/mstab file.

Managing File Systems

Once you’ve created a file system and mounted it to the virtual directory you may have to manage and maintain it to keep things running smoothly. This section walks through some of the Linux utilities available for managing the file systems on your Linux system.

Retrieving File System Stats

As you use your Linux system, there’s no doubt that at some point you’ll need to monitor disk performance and usage. There are a few different tools available to help you do that:

- df—Displays disk usage by partition

- du—Displays disk usage by directory; good for finding users or applications that are taking up the most disk space

- iostat—Displays a real-time chart of disk statistics by partition

- lsblk—Displays current partition sizes and mount points

In addition to these tools, the /proc and /sys directories are special file systems that the kernel uses for recording system statistics. Two directories that can be useful when working with file systems are the /proc/partitions and /proc/mounts directories, which provide information on system partitions and mount points, respectively. Additionally, the /sys/block directory contains separate directories for each mounted drive, showing partitions and kernel-level stats.

Some file systems, such as ext3 and ext4, allocate a specific number of inodes when created. An inode is an entry in the index table that tracks files stored on the file system. If the file system runs out of inode entries in the table, you can’t create any more files, even if there’s available space on the drive. Using the -i option with the df command will show you the percentage of inodes used on a file system and can be a lifesaver.

File System Tools

Linux uses the e2fsprogs package of tools to provide utilities for working with ext file systems (such as ext3 and ext4). The following are the most popular tools in the e2fsprogs package:

- blkid—Display information about block devices, such as storage drives

- chattr—Change file attributes on the file system

- debugfs—Manually view and modify the file system structure, such as undeleting a file or extracting a corrupt file

- dumpe2fs—Displays block and superblock group information

- e2label—Change the label on the file system

- resize2fs—Expand or shrink a file system

- tune2fs—Modify file system parameters

These tools help you fine-tune parameters on an ext file system, but if corruption occurs on the file system, you’ll need the fsck program.

The XFS file system also has a set of tools available for tuning the file system. You’ll most likely run across the following two:

- xfs_admin—Display or change file system parameters such as the label or UUID assigned

- xfs_info—Display information about a mounted file system, including the block sizes and sector sizes, as well as label and UUID information

While these ext and XFS tools are useful, they can’t help fix things if the file system itself has errors. For that, the fsck program is the tool to use:

Description

The fsck program is a front end to several different programs that check the various file systems to match the index against the actual files stored in the file system. If any discrepancies occur, run the fsck program and it will attempt to reconcile the discrepancies and fix the file system.

Storage Alternatives

Standard partition layouts on storage devices do have their limitations. Once you create and format a partition, it’s not easy making it larger or smaller. Individual partitions are also susceptible to disk failures, in which case all of the data stored in the partition will be lost.

To accommodate more dynamic storage options, as well as fault-tolerance features, Linux has incorporated a few advanced storage management techniques. This section covers three of the more popular techniques you’ll run into.

Multipath

The Linux kernel now supports Device Mapper Multipathing (DM-multipathing), which allows you to configure multiple paths between the Linux system and storage devices. With Multipathing the kernel can either combine the paths, providing for increased throughput while all of the paths are active, or use a path for fault-tolerance if one of the paths becomes inactive.

The Linux DM-multipathing tools include the following:

- dm-multipath—The kernel module that provides multipath support

- multipath—A command line command for viewing multipath devices

- multipathd—A background process for monitoring paths and activating/deactivating paths

- kpartx—A command line tool for creating device entries for multipath storage devices

The dm-multipath feature uses the dynamic /dev/mapper device file directory in Linux. Linux creates a /dev/mapper device file named mpathN for each new multipath storage device you add to the system, where N is the number of the multipath drive. That file acts as a normal device file to the Linux system, allowing you to create partitions and file systems on the multipath device just as you would a normal drive partition.

Logical Volume Manager

The Linux Logical Volume Manager (LMV) also utilizes the /dev/mapper dynamic device directory to allow you to create virtual drive devices. You can aggregate multiple physical drive partitions into virtual volumes, which you then treat as a single partition on your system.

The benefit of LVM is that you can add and remove physical partitions as needed to a logical volume, expanding and shrinking the logical volume as needed.

Using LVM is somewhat complicated. FIGURE 5-3 demonstrates the layout for an LVM environment.

FIGURE 5-3 The Linux LVM layout.

Description

In the example shown in Figure 5-3, three physical drives each contain three partitions. The first logical volume consists of the first two partitions of the first drive. The second logical volume spans drives, combining the third partition of the first drive, with the first and second partitions of the second drive to create one volume. The third logical volume consists of the third partition of the second drive, and the first two partitions of the third drive. The third partition of the third drive is left unassigned, and can be added later to any of the logical volumes when needed.

For each physical partition, you must mark the partition type as the Linux LVM file system type in fdisk or gdisk. Then, you must use several LVM tools to create and manage the logical volumes:

- pvcreate—Creates a physical volume

- vgcreate—Groups physical volumes into a volume group

- lvcreate—Creates a logical volume from partitions in each physical volume

The logical volumes create entries in the /dev/mapper directory, which represent the LVM device you can format with a file system and use like a normal partition.

While the initial setup of a LVM is complicated, it does provide great benefits. If you run out of space in a logical volume, just add a new disk partition to the volume.

Using RAID Technology

RAID technology allows you to improve data access performance and reliability as well as implement data redundancy for fault-tolerance by combining multiple drives into one virtual drive. Several versions of RAID are commonly used:

- RAID 0—Disk striping, spreads data across multiple disks for faster access

- RAID 1—Disk mirroring, duplicates data across two drives

- RAID 10—Disk mirroring and striping: provides striping for performance, and mirroring for fault-tolerance

- RAID 4—Disk striping with parity, adds a parity bit stored on a separate disk so that data on a failed data disk can be recovered

- RAID 5—Disk striping with distributed parity, adds a parity bit to the data stripe so that it appears on all of the disks so that any failed disk can be recovered

- RAID 6—Disk striping with double parity stripes both the data and the parity bit so two failed drives can be recovered

If your storage hardware doesn’t support RAID, Linux has implemented a software RAID system that can implement RAID features on any disk system.

The mdadm utility allows you to specify multiple partitions to be used in any type of RAID environment. The RAID device appears as a single device in the /dev/mapper directory, which you can then partition and format to a specific file system.

CHAPTER SUMMARY

The ability to permanently store data on a Linux system is a must. The Linux kernel supports both HDD and SSD technologies for persistently storing data. It also supports the three main types of drive connections—PATA, SATA, and SCSI. For each storage device you connection to the system, Linux creates a raw device file in the /dev directory. The raw device is hdx for PATA drives and sdx for SATA and SCSI drives, where x is the drive letter assigned to the drive.

Once you connect a drive to the Linux system, you’ll need to create partitions on the drive. For MBR disks, you can use the fdisk or parted command line tools or the gparted graphical tool. For GPT disks you can use the gdisk or gparted tools. When you partition a drive you must assign it a size and a file system type.

After you partition the storage device, you must format it using a file system that Linux recognizes. The mkfs program is a frontend utility that can format drives using most of the file systems that Linux supports. The ext4 file system is currently the most popular Linux file system. It supports journaling and provides good performance. Linux also supports more advanced file systems, such as btrfs, xfs, zfs, and of course, the Windows vfat and ntfs file systems.

After creating a file system on the partition, you’ll need to mount the file system into the Linux virtual directory using a mount point and the mount command. The data contained in the partition’s file system appears under the mount point directory within the virtual directory. To automatically mount partitions at boot time, make an entry for each partition in the /etc/fstab file.

A host of tools are available to help you manage and maintain file systems. The df and du command line commands are useful for checking disk space for partitions and the virtual directory, respectively. The fsck utility is a vital tool for repairing corrupt partitions and is run automatically at boot time against all partitions automatically mounted in the virtual directory.

Linux also supports alternative solutions for storage, such as multipath IO for fault tolerance, logical volumes, where you can add and remove physical partitions within a logical volume, and software RAID technology.

KEY CONCEPTS AND TERMS

- /dev/disk/by-id

- /dev/disk/by-label

- /dev/disk/by-path

- /dev/disk/by-uuid

- /dev/mapper

- /etc/fstab

- /etc/crypttab

- /etc/mstab

- /proc/mounts

- /proc/partitions

- /sys/block

- absolute path

- blkid

- btrfs

- chattr

- debugfs

- df

- drive letters

- dm-multipath

- du

- dumpe2fs

- e2label

- ecryptfs

- ext3

- ext4

- extended partition

- fdisk

- file system

- file system hierarchy standard (FHS)

- fsck

- GUID Partition Table (GPT)

- gdisk

- gparted

- hard disk drive (HDD)

- Hierarchical File System (HFS)

- iostat

- ISO-9660

- journaling

- kpartx

- logical volume manager (LVM)

- lsblk

- lvcreate

- Master Boot Record (MBR)

- mdadm

- mkfs

- mount

- mount points

- mounting

- multipath

- multipathd

- Network File System (NFS)

- New Technology File System (NTFS)

- Parallel Advanced Technology Attachment (PATA)

- parted

- partition

- persistent device files

- primary partition

- pvcreate

- RAID 0

- RAID 1

- RAID 4

- RAID 5

- RAID 6

- RAID 10

- raw device

- Redundant Array of Inexpensive Disks (RAID)

- reiserFS

- relative path

- resize2fs

- root directory

- Serial Advanced Technology Attachment (SATA)

- Small Computer System Interface (SCSI)

- solid-state drive (SSD)

- swap

- tune2fs

- udev

- Universal Disc Format (UDF)

- umount

- unmounting

- Virtual File Allocation Table (VFAT)

- vgcreate

- virtual directory

- X File System (XFS)

- xfs_admin

- xfs_info

- Zettabyte File System (ZFS)

CHAPTER 5 ASSESSMENT

1. Which type of storage device uses integrated circuits to store data with no moving parts?

1. SSD

2. SATA

3. SCSI

4. HDD

5. PATA

2. What raw device file would Linux create for the second SCSI drive connected to the system?

1. /dev/hdb

2. /dev/sdb

3. /dev/sdb1

4. /dev/hdb1

5. /dev/sda

3. What program runs in the background to automatically detect and mount new storage devices?

1. mkfs

2. fsck

3. umount

4. mount

5. udev

4. What directory does the udev program use to create a permanent link to a storage device based on its serial number?

1. /dev/disk/by-path

2. /dev/sdb

3. /dev/disk/by-id

4. /dev/disk/by-uuid

5. /dev/mapper

5. Which partitioning tool provides a graphical interface?

1. gdisk

2. gparted

3. fdisk

4. parted

5. fsck

6. Linux uses ___________ to add the file system on a new storage device to the virtual directory.

1. mount points

2. drive letters

3. /dev files

4. /proc directory

5. /sys directory

7. What file system is the latest version of the original Linux file system?

1. reiserFS

2. btrfs

3. ext3

4. ext4

5. nfs

8. What tool do you use to create a new file system on a partition?

1. fdisk

2. mkfs

3. fsck

4. gdisk

5. parted

9. What tool do you use to manually add a file system to the virtual directory?

1. fsck

2. mount

3. umount

4. fdisk

5. mkfs

10. The __________ program is a handy tool for repairing corrupt file systems.

1. fsck

2. mount

3. umount

4. fdisk

5. mkfs

© Picsfive/Shutterstock

CHAPTER 6

Command Line Basics

IF YOU’RE USING A LINUX desktop distribution that uses a graphical desktop, it’s easy to launch programs, view files and folders, and manage system programs, all from the graphical desktop interface. However, the real power of Linux comes from working directly with the Linux kernel. To do that, you’ll need to learn about the Linux command line interface (CLI).

The CLI provides an interactive way for a user on the Linux system to access the Linux kernel. It prompts you for commands and then sends the commands to the Linux kernel for processing. Of course there are plenty of security restrictions in place, so that you’re only allowed to do what the system administrator allows you to do (unless of course you are the system administrator, in which case you can do everything).

This chapter walks through the basic features of the command line. First it shows just how to get to the command line. There are different ways to get to the command line, depending on whether you’re using a graphical desktop environment or a server console. Next the chapter discusses the basics of finding your way around the shell, such as getting help for commands, and recovering previously entered commands. After that, the chapter presents a brief discussion on redirecting input and output in the shell—a popular topic for storing data to a file or reading data from a file. After a brief discussion on using variables in the Linux shell, the chapter finishes up by walking through how to create shell scripts to help automate your everyday administration tasks.

CHAPTER 6 TOPICS

This chapter covers the following topics and concepts:

- The Linux shell

- Getting to the Linux shell

- How to run commands in the shell

- How to redirect input and output in the shell

- Using environment variables to store data in the shell

- Create shell scripts to automate submitting commands to the shell

CHAPTER 6 GOALS

When you complete this chapter, you will be able to:

- Describe the Linux shells, and how to start a shell

- List the different ways to access the shell from Linux

- Submit commands to the kernel using the command line interface

- Look up shell commands and application manual pages

- Redirect input and output in shells

- Describe how shells use environment variables to store configuration settings and data

- Write simple shell scripts for running command line commands automatically

The Linux Shell

A Linux shell is a special program that is the middleman between the user and the Linux kernel. It uses an interactive command line interface (CLI) that allows you to send commands to the Linux kernel, load applications to run, and receive messages from both the kernel and applications.

There are basically two actions that the shell allows users to perform from the CLI:

- Run internal shell commands

- Launch external programs

The shell itself has a set of built-in commands that provide different types of information to the user. These internal commands range from allowing you to log out from the system to controlling how your user account creates files on the system. The shell is an integral part of working with the Linux kernel, and it comes in handy knowing how to use it.

External commands include the GNU utilities that are included with Linux systems as well as any application programs, such as desktop and server programs.

This section takes a closer look at the Linux shell and how the CLI provides a basic interface for you to use to communicate with the Linux kernel.

Types of Shells

As with everything else in the Linux world, there are multiple types of shells available for you to use on your Linux system. Some Linux distributions only install one shell by default, while others install multiple shells, allowing you to experiment with which ones you like best.

The most common Linux shells that you’ll run into are the following:

- bash—The original Linux shell, created to duplicate the Unix Bourne shell

- dash—An improvement of bash, created by the Debian developers, used in Ubuntu Linux

- ash—A simplified version of bash for low-powered desktops

- tcsh—An improvement over the original csh shell that supports C-style programming

- ksh—The Korn shell, popular in many Unix distributions, but not as popular in Linux

- zsh—The Z shell, which provides plugin modules for advanced network and math features

As you can see, the different shells provide different features for users and programmers. For example, tcsh is a programming-oriented shell, providing C program language features that help programmers create scripts to automatically process data and control programs from the shell. Another popular shell used by script programmers is zsh, which uses separate plugin modules to provide advanced mathematical equation processing, and even network communication support!

By far the most common shell in Linux is bash. It’s available in all Linux distributions and is what all Linux certification exams focus on. That’s the shell that this book focuses on.

Starting the Shell

The shell that the system starts for your session depends on your user account configuration. The /etc/passwd file contains a list of all the system user accounts, along with some basic configuration information about each user. Here’s a sample entry from a /etc/passwd file:

Each entry has seven data fields, with each field separated by a colon. The system uses the data in these fields to assign specific features for the user:

- The username

- The user’s password (or a placeholder if the password is stored in another file)

- The user’s system user ID number

- The user’s system group ID number

- The user’s full name

- The user’s default home directory

- The user’s default shell program

Most Linux systems use bash as the default shell when starting a CLI environment for the user.

The bash program also uses command line parameters to modify the type of shell you can start. TABLE 6-1 lists the command line parameters available in bash that define what type of shell to use.

TABLE 6-1    The bash command line parameters.

PARAMETER

DESCRIPTION

-c string

Read commands from the specified string and process them

-r

Start a restricted shell, limiting the user to only the default directory

-i

Start an interactive shell, allowing input from the user

-s

Read commands from the standard input

By default, when bash starts, it automatically processes commands in the .bashrc file, located in the user’s home directory. Many Linux distributions use this file to also load a common file that contains commands and settings for everyone on the system. This common file is normally located in the file /etc/bashrc. This file often sets environment variables (described later in this chapter) used in various applications.

The Shell Command Prompt

Once you start a shell the CLI displays a command prompt. The command prompt is your interactive gateway to the shell. This is the place where you enter shell commands.

The default prompt symbol for the bash shell is the dollar sign ($). This symbol indicates that the shell is waiting for you to enter text. However, you can change the format of the prompt used by your shell. The different Linux distributions use different formats for the prompt. In the Ubuntu Linux system, the command prompt looks like this:

You can configure the prompt to provide basic information about your environment. The first example above shows three pieces of information in the prompt:

- The username that started the shell (rich)

- The hostname of the system (ubuntu02)

- The current directory (the tilde sign is shorthand for the home directory)

There are two environment variables that control the format of the command line prompt:

- PS1—Controls the format of the default command line prompt

- PS2—Controls the format of the second-tier command line prompt

The shell uses the default PS1 prompt for initial data entry into the shell. If you enter a command that requires additional information, the shell displays the second-tier prompt specified by the PS2 environment variable.

To display the current settings for your prompts, use the echo command:

The format of the prompt environment variables can look pretty odd. The shell uses special characters to signify elements within the command line prompt. TABLE 6-2 shows the special characters that you can use in the prompt string.

TABLE 6-2    bash shell prompt characters.

CHARACTER

DESCRIPTION

\a

The bell character

\d

The date in the format “Day Month Date”

\e

The ASCII escape character

\h

The local hostname

\H

The fully qualified domain hostname

\j

The number of jobs currently managed by the shell

\l

The basename of the shell’s terminal device name

\n

The ASCII newline character

\r

The ASCII carriage return

\s

The name of the shell

\t

The current time in 24-hour HH:MM:SS format

\T

The current time in 12-hour HH:MM:SS format

\@

The current time in 12-hour am/pm format

\u

The username of the current user

\v

The version of the bash shell

\V

The release level of the bash shell

\w

The current working directory

\W

The basename of the current working directory

\!

The bash shell history number of this command

\#

The command number of this command

\$

A dollar sign if a normal user, or a pound sign if the root user

\nnn

The character corresponding to the octal value nnn

\\

A backslash

\[

Begins a control code sequence

\]

Ends a control code sequence

Notice that all of the special prompt characters begin with a backslash (\). This is what delineates a prompt character from normal text in the prompt. In the earlier example, the prompt contained both prompt characters and a normal character (the “at” sign and the square brackets). You can create any combination of prompt characters in your prompt. To create a new prompt, just assign a new string to the PS1 variable:

Description

This new shell prompt now shows the current time, along with the username. The new PS1 definition only lasts for the duration of the shell session. When you start a new shell, the default shell prompt definition is reloaded. For the change to be permanent, you can place the PS1 assignment in the .bashrc file in your home directory.

NOTE

Most Linux distributions change the command prompt to a pound sign (#) for the root user account. This provides an easy way for you to tell when you have root privileges at the CLI.

Accessing the Command Line

In the early days of Linux, the only way to access the system was via a hard-wired text-based terminal, called a console. All interaction with the Linux system had to be through the console device. Not only was that the only way to interact with the Linux system, it was also the only way for the system to display any system error messages.

Modern-day Linux systems use virtual terminals and terminal emulators to interact with users and administrators. This section describes both methods for getting to the CLI on your Linux system.

Using Virtual Terminals

With modern Linux systems, when the Linux system starts it automatically creates several virtual terminals, also called virtual consoles. A virtual terminal is a CLI session that runs in memory on the Linux system. Instead of having several dumb terminals connected to the computer, most Linux distributions start seven (or sometimes even more) virtual terminals that you can access from the single keyboard and monitor.

In most Linux distributions, you can access the virtual terminals using a simple keystroke combination. Usually you must hold down either the Alt key, or the Ctrl+Alt key combination, and then press a function key (F1 through F8) for the virtual terminal session you want to use. Function key F1 produces virtual terminal 1, key F2 produces virtual terminal 2, and so on. FIGURE 6-1 shows a virtual terminal used in the Rocky Linux distribution.

FIGURE 6-1 The full-screen text login in virtual terminal 1 for Rocky Linux.

Courtesy of Rocky Enterprise Software Foundation.

Description

The virtual terminal prompts you for your user account and password. After logging in with your user ID and password, you are taken to the Linux bash shell CLI. In the Linux virtual terminal, you do not have the ability to run any graphical programs directly. You can only run text programs that display output on the Linux text console.

After logging in to a virtual terminal, you can switch to another virtual terminal session without losing your existing active session. You can switch between all of the virtual terminals, with multiple active sessions running.

With Linux server systems, all you have available are the text-oriented virtual terminal console sessions. However, with Linux desktop distributions, usually the first or the last virtual terminals is reserved for an X Window graphical desktop. You may have to test which virtual terminal runs the graphical desktop on your Linux system by trying Ctrl+Alt+F1 and Ctrl+Alt+F7 to see which one your particular distribution uses.

Most distributions automatically switch to one of the graphical virtual consoles after the boot sequence completes, providing a complete graphical login and desktop experience.

If you log into a desktop virtual terminal and want to switch to a graphical desktop, often you can run the startx command to start the X Window system and the graphical desktop environment. Logging in to a text virtual terminal session and then switching over to a graphical one can get tedious though.

Fortunately, there’s a better way to jump between graphical and text mode on the Linux system. Terminal emulation packages are a popular way to access the shell CLI from within a graphical desktop session.

Terminal Emulation

A terminal emulation package provides a CLI contained within a window in a graphical desktop environment. You don’t need to switch to a separate virtual terminal to access the CLI. The terminal emulation package emulates the console operation within the window, allowing you to enter data into the CLI using the keyboard, and displaying the output from the CLI in the window.

There are three basic terminal emulation packages used in Linux:

- xterm

- Konsole

- GNOME Terminal

The Konsole package is created specifically for KDE desktop environments, and the GNOME Terminal package is created (obviously) for the GNOME desktop environment. The xterm package is a generic package that doesn’t have as many features as the other two but is popular with Linux distributions designed to run on older hardware, such as LUbuntu.

In the Rocky Linux GNOME desktop you can launch the GNOME Terminal program by selecting the Terminal menu entry from the System application area. In Ubuntu, to start GNOME Terminal you’ll need to use the Dash interface and search for it by name. Once you start Terminal, you can right-click on it and add it to the Launcher on the left-hand side of the desktop for easier access.

FIGURE 6-2 shows the GNOME Terminal program running on an Ubuntu desktop.

FIGURE 6-2 The Terminal program running on an Ubuntu desktop.

Courtesy of Canonical Ltd.

Description

Terminal allows you to run multiple terminal emulation sessions using tabs. You can have multiple tabs open, each one being a separate virtual session. You can right-click in the tab window to see the quick menu. This quick menu provides a few actions for your use in the tab session:

- Copy—Copy highlighted text in the current session tab to the clipboard

- Paste—Paste data in the clipboard into the current session tab at the current cursor location

- Read-Only—Sets the tab so that no input is accepted

- Preferences—Allows you to set features of the terminal, such as color scheme, fonts, and scrolling

- New Window—Starts a new Terminal session in a new window

- New Tab—Starts a new Terminal session in another tab in the same window

- Show Menubar—Toggles on/off the menu bar display

Now that you can get to the shell CLI, you’re ready to get started with some commands. First, let’s take a look at how to enter commands into the CLI and how you can modify commands.

Shell Basics

Now that you’ve seen what the shell is, and how to interact with it, let’s take a look at some of the shell features. This section walks through some of the features available in most Linux shells.

Commands

As mentioned earlier, the Linux shell allows you to perform two types of functions—run a built-in command and launch an external program. The external programs that you can launch must be accessible from the Linux system—either installed directly on a hard drive or removable media device or available on a network shared drive.

If you’re ever in doubt about a program, you can use the type shell built-in program. The type program provides quick information about a command or application, such as whether or not it’s a shell builtin command or an external program:

That’s a handy way to get basic information about a file.

If you launch a text-based application, the virtual terminal from where you launched the program becomes the interface with the program. Output from the program appears on the virtual terminal monitor, and input for the program is taken from the keyboard. These are called the standard output and standard input for the shell. You can run multiple programs from different virtual terminals, each one using the input and output for its respective virtual terminal. Later on you’ll see how to redirect input and output with other sources, which can come in handy when you run programs in background mode.

You can launch a graphics-based application from the CLI, but the results depend on how the CLI was started. When you launch a graphics-based application, it looks for a graphical desktop environment to run in. In a text-mode console environment, no graphical desktop environment is available, so usually the program will terminate and complain. If you’re using a terminal emulation package from inside a graphical desktop, the graphical program you launch will appear in the graphical desktop, just as if you had launched it directly from the desktop.

NOTE

There is a way to redirect the graphical desktop to another virtual terminal, even one running on a separate Linux system on the network! That requires setting the   DISPLAY environment variable, which is covered later in this chapter.

Getting Help

The Linux shell has several layers of help available to help make things easier for you. The first layer is the help command. The help command displays information about the built-in shell commands. You can get a list of the available built-in commands in your shell by typing help itself at the command prompt, as shown in FIGURE 6-3.

FIGURE 6-3 The help command output.

Description

You can get help on a specific built-in command by entering the command name after the help command in the CLI:

The next layer of help is the man program. The man program displays canned documentation provided by the application developers, as long as the documentation is installed on your Linux system. There’s an official format for man pages, which helps you quickly find the information you’re looking for. The information in the man page is divided into separate headings. While there are some standard headings defined, there’s no requirement for each man page to include information in all of the headings. You may see any of these common headings in a man page:

- Name—Provides the programs name, and any aliases that it may have

- Synopsis—Provides a quick review of what the program does

- Description—Provides a longer explanation of how the program works

- Options—Describes any command line options available

- Arguments—Describes any option arguments required

- Files—Lists the files required for the program, including configuration files

- Examples—Shows an example of how to use the program

- See Also—Refers to similar programs

- History—Provides details on when the program was created and the different versions

- Copyright—Lists the copyright status of the program

- Bugs—Lists any known bugs

The man pages are also organized into separate sections, numbered from 1 through 8. Each section stores man pages for different types of programs. The main sections to know are section 1, which stores user-level program pages, section 2 for system calls, section 3 for library functions, and section 8 for administrator-level program pages. To specify a section, just list it in the man command:

A command related to the man command is apropos. This fancy-named command looks up the specified term in all of the man pages and returns the man pages that reference the term.

The third layer of help available is the info program. The info program is the replacement for the man program, and has advanced features, such as linked pages. It displays information in a tree-like structure, allowing you to peruse through separate branches in the information tree. Each article can have links to related info pages for other commands, similar to browsing webpages. Implementation of info pages has been somewhat slow, so you may not find any information in the info pages for some applications. FIGURE 6-4 shows the example of the info page for the Linux grep command.

FIGURE 6-4 The info page for the Linux grep command.

Description

Shell Features

A few features that are built into the shell can help out with your command line operations. One is the history file. The history file keeps track of the commands you enter into the shell.

You can recover, modify, and use commands from the history file using the arrow keys. The Up arrow key retrieves the most recently used command from the history file. Hitting the Up arrow key again retrieves the second-most recently used command. If you continue hitting the Up arrow key, the shell continues retrieving commands from the history file in reverse order from when you entered them. Likewise, you can use the Down arrow to go back up through the history file list.

Once you enter a command or retrieve a previous command in the command line, you can modify the command using several different key combinations. Numerous editing commands are available in bash; TABLE 6-3 shows the more popular ones to remember:

TABLE 6-3    Shell command line editing commands.

COMMAND

DESCRIPTION

Left arrow

Move the cursor to the left in the command text

Right arrow

Move the cursor to the right in the command text

Ctrl+a

Move the cursor to the beginning of the command text

Ctrl+e

Move the cursor to the end of the command text

Delete

Remove the character at the cursor location

Backspace

Remove the character before the cursor location

Ctrl+t

Transpose two characters

Ctrl+k

Remove (kill) the characters from the cursor position to the end of the command text into a buffer

Ctrl+y

Yank the characters from the buffer back into the command text

You can also jump directly to a specific previously entered command if you know what position it has in the history file using the history command. Just specify the command location as a number after the history command. For example, to retrieve the command you ran three commands ago, use:

Finally, command completion is another handy shell feature. It searches for commands that match the text that you’re already typed in the command prompt interface. For example, if you’re not sure about the spelling of a command or program, you can type in a few letters and then just hit the Tab key. The shell searches the matching commands and programs and displays them, allowing you to select the command you want to use.

Running Multiple Commands

One exciting feature of the Linux command line is that you can enter multiple commands on the same command line and Linux will process them all! Just place semicolons between each command you enter:

Description

The Linux shell runs the first command (date) and displays the output, then it runs the second command (who) and displays the output from that command, immediately following the output from the first command. While this may seem trivial, that is the basis of how shell scripts work and can be a very powerful tool to have!

Redirecting Input and Output

There are times when you’d like to save the output from a command instead of just having it displayed on the monitor. The shell provides a few different operators that allow you to redirect the output of a command to an alternative location (such as a file). Redirection can be used for input as well as output, redirecting a file to a command for input. This section describes what you need to use redirection in the CLI.

Output Redirection

The most basic type of redirection is sending output from a command to a file; this is called output redirection. Bash uses the greater-than symbol for this:

Anything that would appear on the monitor from the command instead is stored in the output file specified:

Description

The redirect operator created the file test1 and redirected the output from the date command to the file. If the output file already exists, the redirect operator overwrites the existing file with the new file data:

Description

Now the contents of the test1 file contain the output from the who command.

Sometimes, instead of overwriting the file’s contents, you may need to append output from a command to an existing file, for example if you’re creating a log file to document an action on the system. In this situation, you can use the double greater-than symbol (>>) to append data:

Description

The test2 file still contains the original data from the who command processed earlier, plus now it contains the new output from the date command.

Input Redirection

Input redirection is the opposite of output redirection. Instead of taking the output of a command and redirecting it to a file, input redirection takes the content of a file and redirects it to a command.

The input redirection symbol is the less-than symbol (<):

The easy way to remember this is that the command is always listed first in the command line, and the redirection symbol “points” to the way the data are flowing. The less-than symbol indicates that the data are flowing from the input file to the command.

Here’s an example of using input redirection with the wc command:

The wc command provides a count of text in the data. By default it produces three values:

- The number of lines in the text

- The number of words in the text

- The number of bytes in the text

By redirecting a text file to the wc command, you can get a quick count of the lines, words, and bytes in the file. The example shows that there are 2 lines, 11 words, and 75 bytes in the test2 file.

There’s another method of input redirection, called inline input redirection. This method allows you to specify the data for input redirection on the command line instead of in a file. This may seem somewhat odd at first, but there are a few applications for this process, such as providing interactive scripts.

The inline input redirection symbol is the double less-than symbol (<<). Besides this symbol, you must specify a text marker that delineates the beginning and end of the data used for input. You can use any string value for the text marker, but it must be the same at the beginning of the data and the end of the data:

When using inline input redirection on the command line, the shell will prompt for data using the secondary prompt, defined in the PS2 environment variable. Here’s how this looks when you use it:

Description

The secondary prompt continues to prompt for more data until you enter the text marker. The wc command performs the line, word, and byte counts of the data supplied by the inline input redirection.

Pipes

There are times when you need to send the output of one command to the input of another command. This is possible using redirection, but is somewhat clunky:

Description

The rpm command manages the software packages installed on systems using the Red Hat Package Management system (RPM), such as the Rocky Linux system as shown. When used with the -qa parameters, it produces a list of the existing packages installed, but not necessarily in any specific order. If you’re looking for a specific package, or group of packages, it can be difficult to find it using the output of the rpm command.

Using the standard output redirection, you can redirect the output from the rpm command to a file, called rpm.list. After the command finishes, the rpm.list file contains a list of all the installed software packages on the system. Next, you must use input redirection to send the contents of the rpm.list file to the sort command to sort the package names alphabetically.

That was useful, but again, a somewhat clunky way of producing the information. Instead of redirecting the output of a command to a file, you can redirect the output directly to another command. This process is called piping. The pipe symbol is the bar operator (|):

Piping provides a way to link commands to provide more detailed output. Don’t think of piping as running two commands back to back though. The Linux system actually runs both commands at the same time, linking them together internally in the system. As the first command produces output, it’s sent immediately to the second command. No intermediate files or buffer areas are used to transfer the data.

Now, using piping, you can easily pipe the output of the rpm command directly to the sort command to produce your results:

Description

Description

Unless you’re a (very) quick reader, you probably couldn’t keep up with the output generated by this command. Since the piping feature operates in real time, as soon as the rpm command produces data, the sort command gets busy sorting it. By the time the rpm command finishes outputting data, the sort command already has the data sorted and starts displaying it on the monitor.

There’s no limit to the number of pipes you can use in a command (up to the 255 character limit on the line length). You can continue piping the output of commands to other commands to refine your operation.

In this case, since the output of the sort command zooms by so quickly, we can use one of the text paging commands (such as less or more) to force the output to stop at every screen of data:

This command sequence runs the rpm command, pipes the output to the sort command, then pipes that output to the more command to display the data, stopping after every screen of information. This now lets you pause and read what’s on the display before continuing.

To get even fancier, you can use redirection along with piping, to save your output to a file:

Description

As expected, the data in the rpm.list file is now sorted!

Linux Environment Variables

The shell uses a feature called environment variables to store information about the shell session and the working environment (thus the name environment variables). This feature also allows you to store data in memory that can be easily accessed by any program or script running from the shell. This is a handy way to store persistent data that identifies features of the user account, system, shell, or anything else you need to store during the login session.

There are two types of environment variables in the bash shell:

- Global variables

- Local variables

This section describes each type of environment variable, and shows how to see and use them.

Global Environment Variables

Global environment variables are visible from the shell session and any child processes that the shell spawns. Local variables are only available in the shell that creates them. This makes global environment variables useful in applications that spawn child processes that require information from the parent process.

The Linux system sets several global environment variables when you start your bash session. The system environment variables always use all capital letters to differentiate them from normal user environment variables.

To view the global environment variables, use the printenv command:

Description

Description

As you can see, lots of global environment variables get set in the shell. Most of them are set by the system during the login process.

To display the value of an individual environment variable, use the echo command. When referencing an environment variable, you must place a dollar sign before the environment variable name:

As mentioned, global environment variables are also available to child processes running under the current shell session:

In this example, after starting a new shell using the bash command, the echo command is used to display the current value of the HOME environment variable, which the system sets when I log into the main shell. As seen in the example, the value is also available from the child shell process.

TIP

Perhaps one of the most important environment variables is the   PATH value. The PATH value lists the directories where the shell looks for applications that you specify to launch on the command line.

Local Environment Variables

Local environment variables, as their name implies, can be seen only in the local process in which they are defined. Don’t get confused though about local environment variables, they are just as important as global environment variables. In fact, the Linux system also defines standard local environment variables for you by default.

Trying to see the list of local environment variables is a little tricky. Unfortunately there isn’t a command that displays only local environment variables. The set command displays all of the environment variables set for a specific process, including the global environment variables. This produces a very long list (too long to show here).

When you run the set command, notice that there are several bash-related entries that don’t appear in the global listing produced by the printenv command:

Description

These document different features of the current bash shell, including any command line parameters or arguments that were used when the shell started. These can often come in handy if you need to determine the shell version or features from inside your shell scripts.

Setting Environment Variables

Besides the system-created environment variables, you can also create your own. The shell allows you to create both global and local environment variables for your shell session. This section shows just how to do that.

Setting local environment variables

Once you start a bash shell (or spawn a shell script), you’re allowed to create local variables that are visible within your shell process. You can assign either a numeric or a string value to an environment variable by assigning the variable to a value using the equal sign:

Once you assign the value to the environment variable, you can reference it at any time in the shell session by using the dollar sign: $test.

If you need to assign a string value that contains spaces, you’ll need to use a single quotation mark to delineate the beginning and the end of the string:

Description

Without the single quotation marks, the shell assumes that the next character is another command to process. Notice that for the local environment variable defined, we used lowercase letters, while the system environment variables we’ve seen so far have all used uppercase letters.

This is a standard convention in bash. If you create new environment variables, it is recommended (but not required) that you use lowercase letters. This helps distinguish your personal environment variables from the scores of system environment variables.

WARNING

It’s extremely important that there are no spaces between the environment variable name, the equal sign, and the value. If you put any spaces in the assignment, the bash shell interprets the value as a separate command:

Description

Once you set a local environment variable, it’s available for use anywhere within your shell process. However, if you spawn another shell, it’s not available in the child shell:

This example starts a child shell with the bash command. The test environment variable is not available in the child shell (it contains a blank value). After exiting the child shell and returning to the original shell, the local environment variable was available.

Similarly, if you set a local environment variable in a child process, once you leave the child process the local environment variable is no longer available:

Description

The test environment variable set in the child shell doesn’t exist in the parent shell.

Setting global environment variables

Global environment variables are visible from any child processes created by the process that sets the global environment variable. The method used to create a global environment variable is to create a local environment variable, then export it to the global environment.

This is done by using the export command:

Description

After exporting the local environment variable test, a child shell processed and viewed the value of the test environment variable. This time, the environment variable kept its value, as the export command made it global.

WARNING

When exporting a local environment variable, don’t use the dollar sign to reference the variable’s name.

Removing Environment Variables

Of course, if you can create a new environment variable, it makes sense that you can also remove an existing environment variable. This is done by using the unset command:

When referencing the environment variable in the unset command, remember not to use the dollar sign.

When working with global environment variables, things can get a little tricky. If you’re in a child process and remove a global environment variable, it only applies to the child process. The global environment variable is still available in the parent process:

Description

This example sets a local environment variable called test, and then exports it to make it a global environment variable. It then starts a child shell process and checks to make sure that the global environment variable test is still available. Next, while still in the child shell, it uses the unset command to remove the global environment variable test, then exits the child shell. Now back in the original parent shell, it checks the test environment variable value, and it is still valid.

Writing Shell Scripts

Placing multiple commands on a single line, either by using the semicolon or piping, is a great way to process data, but it can still get rather tedious. Each time you want to run a set of commands, you need to type them all at the command prompt.

However, Linux also allows us to place multiple commands in a text file, then run the text file as a program from the command line. This is called a shell script, because we’re scripting out commands for the Linux shell to run.

Shell script files are plain text files. To create a shell script file, you just need to use any text editor that you’re comfortable with. If you’re working from a KDE-based graphical desktop, you can use the KWrite or Kate programs, or if you’re using a GNOME-based desktop, you can use the Gedit program.

If you’re working directly in a command-line environment, you still have some options. Many Linux distributions include either the pico or nano text editors, which provide a graphical text editing environment using ASCII control characters to create a full-screen window. If your Linux distribution doesn’t include one of these programs, there is still one last resort—the vi editor. The vi editor is a text-based editor that uses simple single-letter commands. It’s the oldest editor in the Linux environment and is not overly user-friendly.

Once you’ve chosen your text editor, you’re ready to create your shell scripts. This section walks through the basics on how to do that.

Getting Started

The first line in a shell script file identifies the file as being a shell script. It tells Linux what shell to use the process the commands contained in the shell script:

The combination of the pound sign and the exclamation symbol (#!) is commonly called the shebang. It signals to the operating system which shell to use to run the shell script. Most Linux distributions support multiple Linux shells, but the most common is the bash shell. You can run shell scripts written for other shells, as long as that shell is installed on the Linux distribution.

After you specify the shell, you’re ready to start listing the commands in your script. You don’t need to enter all of the commands on a single line; Linux allows you to place them on separate lines. Also, the Linux shell assumes each line is a new command in the shell script, so you don’t need to use semicolons to separate the commands. Here’s an example of a simple shell script file.

The script1.sh script file starts out with the shebang line identifying the bash shell, the standard shell in Linux. The second line in the code demonstrates another feature in shell scripts. Lines that start with a pound sign are called comment lines. They allow you to embed comments into the shell script program to help you remember what the code is doing. The shell skips comment lines when processing the shell script. You can place comment lines anywhere in your shell script file, after the opening shebang line.

NOTE

Notice that I used the   .sh file name extension on the shell script file. While this is not required in Linux, it’s become somewhat of a de facto standard among programmers. This helps identify that the text file is a shell script that can be run at the command line.

After you save your new shell script file, you’ll want to run it. However, there’s a step you’ll need to take before you can do that. By default text files aren’t marked as program files, so the shell won’t be able to run them. To fix that you’ll need to use the chmod command:

This command format will make much more sense after you’ve read Chapter 10, “Linux Server Administration,” which walks through the different permissions you can set for a file. Basically, this command adds the execute (run) permission to the file for the owner of the file. Now you can run the command from the command line:

Description

The ./ symbol is required because current directory where the script is located is not included in the PATH environment variable. It tells the shell to look in the current directory for the file.

Displaying Messages

When you string commands together in a shell script file, the output may be somewhat confusing to look at. It would help to be able to customize the output by separating the output and adding our own text between the output from the listed commands.

The echo command allows you to display text messages from the command line. When used at the command line, it’s not too exciting:

But now you have the ability to insert messages anywhere in the output from the shell script file. Just modify the test1.sh shell script program by adding a couple of echo commands:

Description

When you run the script now, you should see the following output:

Description

The shell script you created adds three echo commands to the script1.sh script. Notice that the first echo command doesn’t use any quotes, but the third one does. The reason for that is the text output from the third echo command contains single quotes. The single quote is also a metacharacter in the shell, which will confuse the echo command, so you need to place double quotes around the text. Also notice that the second echo command doesn’t have any text on the line. That outputs a blank line, which is useful when you want to separate output from multiple commands.

Using Variables

Shell scripts can also tap into the global and local environment variables set in the shell. Just remember to place the dollar sign in front of the environment variable name when you reference it in the script:

Description

The $USER, $UID, and $HOME environment variables are commonly used to display information about the logged-in user. When you run the shell script, you should see the information related to the user who runs the script:

Description

The values you see should be related to your user account. This allows you to dynamically retrieve information about the user account running your shell script to customize the output.

You can also set local environment variables inside your shell scripts:

Description

Running the script3.sh script produces the following output:

Once you store the data in a user variable you can reference it anywhere in your shell script!

WARNING

When you run a shell script from the command line, Linux starts a new shell, separate from the command line shell. Any local variables you set inside a shell script will “go away” when the script ends and not be present in the parent command line shell. If you need to retain variable values, use the   export command in your shell script to make the variable a global environment variable.

Command Line Arguments

One of the most versatile features of shell scripts is the ability to pass data into the script when you run it. This allows you to customize the script with new data each time you run it.

One method of passing data into a shell script is to use command line arguments. Command line arguments are data you include on the command line when you run the command. Just start listing them after the command, separating each data value with a space, in this format:

You retrieve the values in your shell script code using special numeric positional variables. Use the variable $1 to retrieve the first command line argument, $2 the second argument, and so on. Here’s an example that shows how to use positional variables in your shell script:

Description

The script4.sh shell script uses two command line arguments. The $1 variable holds the name of the person, and the $2 variable holds the number of days ago they checked in. When you run the scsript4.sh shell script be sure to include both data values in the command line. The shell won’t produce an error message if a positional variable doesn’t exist; you just won’t get the results you expected:

It’s up to you to check if the positional variable exists within your program code.

Command Substitution

Quite possibly one of the most useful features of shell scripts is the ability to store and process data. So far I’ve discussed how to use output redirection to store output from a command to a file and piping to redirect the output of a command to another command. There’s another technique, however, that can give you more flexibility in storing and using data in your scripts.

Command substitution allows you to assign the output of a command to a local variable in the shell script. Once the output is stored in a variable, you can use standard Linux string manipulation commands (such as sort) to manipulate the data before displaying it.

To redirect the output of a command to a variable you need to use one of two command substitution formats:

- Placing backticks (`) around the command

- Using the command within the $() function

Both methods produce the same result—redirecting the output from the command into a user variable. Here’s an example that demonstrates using both methods:

Description

The output from the command substitutions is stored in the appropriate variables. You can then use those variables anywhere in your script program as a standard string value.

WARNING

The backtick character is not the same as a single quote. It’s the character usually found on the same key as the tilde character (~) on U.S. keyboards. Because of the confusion between backticks and single quotes, it’s become more popular in the Linux world to use the $() function format.

Logic Statements

So far all of the shell scripts presented process commands in a linear fashion—one command after another. However, not all programming is linear. There are times when you’d like your program to test for certain conditions, such as if a file exists or if a mathematical expression is 0, and perform different commands based on the results of the test. For that, the bash shell provides logic statements.

Logic statements allow you to test for a specific condition, then branch to different sections of code based on whether the condition evaluates to a True or False logical value. The most basic logic statement is the if-then condition statement. The format for the if-then condition statement is as follows:

If the condition you specify evaluates to a True logical value, the shell runs the commands in the then section of code. If the condition evaluates to a False logical value, the shell script skips the commands in the then section of code.

The condition expression has quite a few different formats in the bash shell programming. There are built-in tests for numerical values, string values, and even files and directories. TABLE 6-4 lists the different built-in tests that are available.

TABLE 6-4    Condition tests.

TEST

TYPE

DESCRIPTION

n1 -eq n2

Numeric

Checks if n1 is equal to n2

n1 -ge n2

Numeric

Checks if n1 is greater than or equal to n2

n1 -gt n2

Numeric

Checks if n1 is greater than n2

n1 -le n2

Numeric

Checks if n1 is less than or equal to n2

n1 -lt n2

Numeric

Checks if n1 is less than n2

n1 -ne n2

Numeric

Checks if n1 is not equal to n2

str1 = str2

String

Checks if str1 is the same as str2

str1 != str2

String

Checks if str1 is not the same as str2

str1 < str2

String

Checks if str1 is less than str2

str1 > str2

String

Checks if str1 is greater than str2

-n str1

String

Checks if str1 has a length greater than zero

-z str1

String

Checks if str1 has a length of zero

-d file

File

Check if file exists and is a directory

-e file

File

Checks if file exists

-f file

File

Checks if file exists and is a file

-r file

File

Checks if file exists and is readable

-s file

File

Checks if file exists and is not empty

-w file

File

Checks if file exists and is writable

-x file

File

Checks if file exists and is executable

-O file

File

Checks if file exists and is owned by the current user

-G file

File

Checks if file exists and the default group is the same as the current user

file1 -nt file2

File

Checks if file1 is newer than file2

file1 -ot file2

File

Checks if file1 is older than file2

Here’s an example of using an if-then statement in a script:

Description

The script compares the first two command line parameters ($1 and $2) and determines which one is larger or if they’re equal. After setting the permissions to run the script, you can test it out:

Description

Only the command from the if-then statement that evaluated to a True logical value is processed by the shell script.

Looping

When you’re writing scripts, you’ll often find yourself in a situation where it would come in handy to repeat the same commands multiple times, such as applying a command against all of the files in a directory. The bash shell provides some basic looping commands to accommodate that.

The for statement iterates through every element in a series, such as files in a directory, or lines in a text document. The format of the for command is:

Description

The variable becomes a placeholder, taking on the value of each element in the series in each iteration. The commands can use the variable just like any other variable that you define in the script. Here’s an example that shows how to use a for loop to iterate through all of the files in a directory.

If you run the script6.sh shell script you should see a listing of the files and directories in your Home directory:

Description

That saves a lot of coding from having to check each file manually in a bunch of if-then or case statements!

Another useful loop statement is the while command. This is its format:

Description

The while loop keeps looping as long as the condition specified evaluates to a True logical value. When the condition evaluates to a False logical value, the looping stops. The condition used in the while loop is the same as that for the if-then statement, so you can test numbers, strings, and files. Here’s an example that demonstrates using the while loop to calculate the factorial of a number:

Description

The shell script retrieves the first parameter passed to the script and uses it in the while loop. The while loop continues looping as long as the value stored in the $number variable is greater than 0. In each loop iteration that value is decreased by 1, so at some point the while condition becomes False. When that occurs the $factorial variable contains the final calculation. When you run the script7.sh program, you should get the following results:

The while loop took all of the hard work of iterating through the series of numbers. Now you can plug any number as the command line parameter and calculate the factorial value!

TIP

You’ll notice in the   script7.sh program that I did some rudimentary mathematical operations using the $[ ] operator. The bash shell only allows you to do integer calculations; it can’t handle floating point numbers directly. If you need to perform complex math in your scripts, check out the Z shell, which provides a whole host of mathematical features and functions.

CHAPTER SUMMARY

The shell provides an interface for users to access the Linux kernel. It does that using the CLI. You can access the CLI from either a text-based virtual terminal or from a terminal emulation program in a graphical desktop environment.

The CLI provides a command prompt for you to enter shell commands and launch applications. The CLI also has features that remember previously entered commands and the ability to complete commands as you type them. The shell has a help command to provide information on built-in shell commands, and the man and info programs provide information on external programs and utilities installed on the system.

The CLI also allows you to redirect both the output of a command and the data that’s input to a command. This enables you to store application output into a file for viewing or redirect input data from the command line or a file. You can also pipe output from one command to the input of another command directly.

Linux environment variables allow you to store configuration data in memory so that other applications and shells can access it. You can set environment variable values as either globally available to all shell child processes, or locally to only the current shell.

The ability to save shell commands in a file and run the file is a lifesaver for system administrators. This shell feature enables you to save a series of commons as a shell script file and either manually run them as a single command or schedule them for the system to run automatically at preset times.

KEY CONCEPTS AND TERMS

- apropos

- command completion

- command line interface (CLI)

- command prompt

- console

- environment variables

- export

- external commands

- GNOME Terminal

- global environment variable

- help

- history file

- info

- inline input redirection

- input redirection

- internal commands

- Konsole

- local environment variable

- man

- output redirection

- piping

- shell

- shell script

- standard input

- standard output

- terminal emulation

- virtual terminal

- xterm

CHAPTER 6 ASSESSMENT

1. Which is the most common shell used in many Linux distributions?

1. dash

2. ash

3. tcsh

4. bash

2. Which file specifies the default shell started by a user?

1. /etc/passwd

2. /etc/bashrc

3. .bashrc

4. /home/user/.passwd

3. Which feature allows you to access a command line interface inside a window on a graphical desktop?

1. Console

2. Terminal emulation

3. Virtual terminal

4. Command prompt

4. The PS1 environment variable sets the default command prompt for a user.

1. True

2. False

5. Which command provides information about shell builtin commands?

1. man

2. info

3. help

4. export

6. You can send the results from a program to a file using ______ ________.

1. output redirection

2. input redirection

3. pipe redirection

4. environment variables

7. Inline input redirection enables you to enter data in the CLI to input to a program.

1. True

2. False

8. What enables you to access a data value in both parent and child shells?

1. Local environment variable

2. Global environment variable

3. Pipe

4. Output redirection

9. The __________ command allows you to remove an environment variable

1. export

2. pipe

3. unset

4. redirect

10. The ________ command allows you to create a global environment variable.

1. export

2. unset

3. pipe

4. redirect

References

GNOME Help, “Terminal,” Retrieved Nov. 27, 2021 from https://help.gnome.org/users/gnome-terminal/stable/.

GNU Operating System, “GNU Bash,” Retrieved Nov. 27, 2021 from https://www.gnu.org/software/bash/.

Ubuntu Documentation, “Environment Variables,” Retrieved Nov. 27, 2021 from https://help.ubuntu.com/community/EnvironmentVariables.

© Picsfive/Shutterstock

CHAPTER 7

File Management

ONE OF THE MOST IMPORTANT FUNCTIONS of working in the Linux command line interface is handling files and directories. Just about every administrative task you perform on your Linux system requires working with some type of file. This chapter dives into the topic of handling files and directories from the Linux command line.

The chapter first discusses how Linux handles files and directories using the virtual directory and some of the rules you’ll need to follow when naming files and directories on your Linux system. After that it shows the command line commands you’ll need to become familiar with to work with files and directories, such as listing, copying, moving, and deleting them.

The chapter next shows how to use the popular commands to find files on Linux systems. There are several different commands that you can use, each one with slightly different features. It finishes by discussing the Linux file and archiving process, which allows you to compress files and directories into a single archive file to make distributing and storing files much easier.

CHAPTER 7 TOPICS

This chapter covers the following topics and concepts:

- Navigating the Linux filesystem

- How Linux handles files

- How to list files and directories from the Linux command line

- How to create and delete directories from the Linux command line

- How to manage files from the Linux command line

- How to use wildcards and quotes with Linux file names

- How to compress and archive files and directories from the Linux command line

CHAPTER 7 GOALS

When you complete this chapter, you will be able to:

- Describe how Linux handles files and directories

- List the different options available to list files and directories

- Submit commands to create and delete directories on the Linux system

- Submit commands to copy, move, and delete files on the Linux system

- Use the standard Linux commands to find files and directories on the Linux system

- Use the standard Linux commands to compress and archive files and directories on the Linux system

Filesystem Navigation

For most Linux distributions, when you start a shell session you are placed in your user home directory. Most often, you will need to break out of your home directory to get to other areas in the Linux system. This section describes how to do that using command line commands. Before that, though, is a short tour of just what the Linux filesystem looks like.

The Linux Filesystem

If you’re new to the Linux system, you may be confused by how it references files and directories, especially if you’re used to the way that the Microsoft Windows operating system does that. Before exploring the Linux system, it helps to have an understanding of how it’s laid out.

The first difference you’ll notice is that Linux does not use drive letters in pathnames. In the Windows world, the physical drives installed on the PC determine the pathname of the file. Windows assigns a letter to each physical disk drive, and each drive contains its own directory structure for accessing files stored on it.

For example, in Windows you may be used to seeing the file paths such as:

This indicates that the file test.doc is located in the directory My Documents, which itself is located in the directory Rich. The Rich directory is contained under the directory Users, which is located on the hard disk partition assigned the letter C (usually the first hard drive on the PC).

The Windows file path tells you exactly which physical disk partition contains the file named test.doc. If you wanted to save a file on a USB memory stick, you would click the icon for the drive assigned to the memory stick, such as E:, which automatically uses the file path e:\test.doc. This path indicates that the file is located at the root of the drive assigned the letter E, which is usually assigned to the first USB storage device plugged into the PC.

This is not the method used by Linux. Linux stores files within a single directory structure, called a virtual directory. The virtual directory contains file paths from all the storage devices installed on the PC, merged into a single directory structure.

The Linux virtual directory structure contains a single base directory, called the root. Directories and files beneath the root directory are listed based on the directory path used to get to them, similar to the way Windows does it.

TIP

You’ll notice that Linux uses a forward slash (/) instead of a backward slash (\) to denote directories in filepaths. The backslash character in Linux denotes an escape character and causes all sorts of problems when you use it in a filepath. This may take some getting used to if you’re coming from a Windows environment.

For example, the Linux file path /home/rich/Documents/test.doc only indicates that the file test.doc is in the directory Documents, under the directory rich, which is contained in the directory home. It doesn’t provide any information as to which physical disk on the PC the file is stored on.

The tricky part about the Linux virtual directory is how it incorporates each storage device. The first hard drive installed in a Linux PC is called the root drive. The root drive contains the core of the virtual directory. Everything else builds from there.

On the root drive, Linux creates special directories called mount points. Mount points are directories in the virtual directory where you assign additional storage devices.

The virtual directory causes files and directories to appear within these mount point directories, even though they are physically stored on a different drive.

Often the system files are physically stored on the root drive, while user files are stored on a different drive, as shown in FIGURE 7-1.

FIGURE 7-1 The Linux file structure.

Description

In Figure 7-1, there are two hard drives on the PC. One hard drive is associated with the root of the virtual directory (indicated by a single forward slash). Other hard drives can be mounted anywhere in the virtual directory structure. In this example, the second hard drive is mounted at the location /home, which is where the user directories are located.

The Linux filesystem structure has evolved from the Unix file structure. Unfortunately, the Unix file structure has been somewhat convoluted over the years by different flavors of Unix. To help remedy this problem in the Linux world, the Linux Foundation has developed the Linux Filesystem Hierarchy Standard (FHS). It defines a standard structure for the virtual directory on a Linux system. While not a requirement, most Linux distributions now follow this structure. TABLE 7-1 lists some of the more common Linux virtual directory names contained in the FHS.

TABLE 7-1    The linux filesystem hierarchy standard.

DIRECTORY

USAGE

/

The root of the virtual directory. Normally, no files are placed here.

/bin

The binary directory, where essential user-level utilities are stored.

/boot

The boot directory, where boot files are stored.

/dev

The device directory, where Linux creates device nodes.

/etc

The system configuration files directory.

/home

The home directory, where Linux creates user directories.

/lib

The library directory, where system and application library files are stored.

/media

The media directory, a common place for mount points used for removable media.

/mnt

The mount directory, another common place for mount points used for temporarily mounted media.

/opt

The optional directory, often used to store optional application software packages.

/proc

The process directory, a virtual filesystem that provides process and kernel information as individual files, generated by the system.

/root

The root user account’s home directory.

/run

The run-time directory contains information about the system since the last boot.

/sbin

The system binary directory, where many admin-level utilities are stored.

/sys

The system directory, contains information files about devices, drivers, and some kernel features.

/tmp

The temporary directory, where temporary work files can be created and destroyed. This directory is usually cleared after each reboot of the system.

/usr

The user-installed software directory, this directory is normally set as read-only to protect the integrity of the installed software.

/var

The variable directory, for files that change frequently, such as log files.

When you start a new shell prompt, your session starts in your home directory, which is a unique directory assigned to your user account. When you create a user account, the system normally assigns a unique directory for the account.

In the Windows world, you’re probably used to moving around the directory structure using a graphical interface. To move around the virtual directory from a command line interface (CLI) prompt, you’ll need to learn to use the cd command.

Traversing Directories

The change directory command (cd) is what you’ll use to move your shell session to another directory in the Linux filesystem. The format of the cd command is pretty simplistic:

The cd command may take a single parameter, destination, which specifies the directory name you want to go to. If you don’t specify a destination on the cd command, it will take you to your home directory.

The destination parameter, though, can be expressed using two different methods:

- An absolute filepath

- A relative filepath

The following sections describe the differences between these two methods.

Absolute Filepaths

You can reference a directory name within the virtual directory using an absolute filepath. The absolute filepath defines exactly where the directory is in the virtual directory structure, starting at the root of the virtual directory, sort of like a full name for a directory.

Thus, to reference the apache directory, that’s contained within the lib directory, which in turn is contained within the usr directory, you would use the absolute filepath:

With the absolute filepath, there’s no doubt as to exactly where you want to go. To move to a specific location in the filesystem using the absolute filepath, you just specify the full pathname in the cd command:

On most Linux distributions the prompt shows the current directory for the shell (the tilde represents your user home directory). You can move to any level within the entire Linux virtual directory structure using the absolute filepath.

However, if you’re just working within your own home directory structure, often using absolute filepaths can get tedious. For example, if you’re already in the directory /home/rich, it seems somewhat cumbersome to have to type the command:

just to get to your Documents directory. Fortunately, there’s a simpler solution.

Relative Filepaths

Relative filepaths allow you to specify a destination directory relative to your current location, without having to start at the root. A relative filepath doesn’t start with a forward slash, indicating the root directory.

Instead, a relative filepath starts with either a directory name (if you’re traversing to a directory under your current directory) or a special character indicating a relative location to your current directory location. Two special characters are used for this:

- The dot (.) to represent the current directory

- The double dot (..) to represent the parent directory

The double dot character is extremely handy when trying to traverse a directory hierarchy. For example, if you are in the Documents directory under your home directory and need to go to your Desktop directory, also under your home directory, you can do this:

The double dot character takes you back up one level to your home directory, then the /Desktop portion takes you back down into the Desktop directory. You can use as many double dot characters as necessary to move around. For example, if you are in your home directory (/home/rich) and want to go to the /etc directory, you could type:

Of course, in a case like this, you actually have to do more typing to use the relative filepath rather than just typing the absolute filepath, /etc!

Linux Files

One of the things that made the Unix operating system unique when it was first created back in the 1970s was that it treats everything on the computer system as a file: hardware devices, data, network connections, everything. That simplified the way programs interact with hardware, and with each other, because no matter where your data comes from, the Unix operating system handles it the same way. While that may seem odd, it’s what revolutionized the computer world and made the Unix operating system so popular.

However, because everything is a file, there are some issues that you’ll run into. One of those issues is trying to identify file types. This section walks through how Linux handles file names and shows some hints on how you can determine file types on a Linux system.

Determining File Types

Linux data files cover a pretty wide range of file types—everything from text data to executable programs. Because Linux files aren’t required to use a file extension, it can sometimes be difficult to tell what files are programs, what files are text data, and what files are binary data. Fortunately there’s a command line utility that can help.

The file command returns the type of the file specified. If the file is a data file, it also attempts to detect just what the file contains:

Description

In this example, the myprog.c file is a C program text file, and the myprog file is a binary executable program.

File Names

The first thing you’ll notice as you peruse through the directories on your Linux system is that Linux has a different file naming standard than Windows. In the Windows world, you’re probably used to seeing a three- or four-character file extension added onto each file (such as .docx for Word documents). Linux doesn’t require file extensions to identify file types on the system (although they’re allowed if you like to use them).

Linux file names can be any length of characters, although 255 is a practical limit for file names (when file names get longer than that some programs have trouble handling them). Linux file names can contain upper and lower case letters, numbers, and most special characters (the only characters not allowed are the forward slash and the NULL character). Linux file names can contain spaces, as well as foreign language characters. However, the file name should always start with a letter or number.

Here’s an example of some valid Linux file names:

WARNING

Unlike Windows, Linux distinguishes between upper- and lowercase letters, so be careful when naming and using files! For example, the file name   Test.doc is different from the file test.doc.

Hidden Files

Another feature of Linux file names that is different from Windows is hidden files. Hidden files don’t appear in normal file listings. In the Windows world, you use file properties to make a file hidden from normal viewing. When a normal user displays the directory listing, the hidden files don’t appear, but when an administrator displays the directory listing, the hidden files magically appear in the output. This feature helps protect important system files from being accidentally deleted or overwritten.

Linux doesn’t use file properties to make a file hidden. Instead, it uses the file name. File names that start with a period are considered hidden files, in that they don’t appear in a normal listing when you use the ls command or displayed when using a graphical file manager tool. You can however use options to display hidden files in the ls command or the file manager tools. FIGURE 7-2 shows setting the Files graphical file manager tool in Ubuntu to display hidden files.

FIGURE 7-2 Displaying hidden files using Files in Ubuntu.Courtesy of Canonical Ltd.

Description

To display hidden files with the ls command, you need to include the –a command line parameter:

Description

In this example, the ls command by itself only shows a few directories in the Home directory. Adding the –a parameter shows all of the hidden files in the directory. Many Linux programs store any settings that you make as a hidden file in each users’ Home directory.

File Inodes

Linux has to keep track of a lot of information for each file on the system. The way it does that is by using index nodes, also called inodes. The Linux operating system creates an inode for each file on the system to store the file properties. The inodes are hidden from view; only the operating system can access them. Each inode is also assigned a number, called the inode number. This is what Linux uses to reference the file, not the file name. The inode numbers are unique on each physical disk partition.

Linux also creates a table on each disk partition, called the inode table. The inode table contains a listing that matches each inode number assigned to each file on the disk partition. As you create and delete files, Linux automatically updates the inode table behind the scenes. However, if the system should abruptly shut down (such as due to a power failure) the inode table can become corrupt. Fortunately for us, there are utilities that can help reorganize the inode table and help prevent data loss. Unfortunately though, if the inode table does become unrepairable, you won’t be able to access the files on the disk partition, even if the actual files are still there!

To view the inode number for files, use the -i option in the ls command. You can combine it with the -l option to produce a long listing to show more details about the file:

Description

The first number displayed in the long listing is the inode number for each file. Notice that the inode number for the myprog.c file is the same as the copy.c file. That means there is a hard link between those two files. The hard link points to the same physical disk location as the original file, so the inode numbers are the same.

File and Directory Listing

The most basic feature of the shell is the ability to see what files are available on the system. The list command (ls) is the tool that helps do that. This section describes the ls command and all of the options available to format the information it can provide.

Basic Listing

The ls command at its most basic form displays the files and directories located in your current directory:

Description

Notice that the ls command produces the listing in alphabetical order (in columns rather than rows). If you’re using a terminal emulator that supports color, the ls command may also show different types of entries in different colors. The LS_COLORS environment variable controls this feature. Different Linux distributions set this environment variable depending on the capabilities of the terminal emulator.

If you don’t have a color terminal emulator, you can use the -F parameter with the ls command to easily distinguish files from directories. Using the -F parameter produces the following output:

Description

The -F parameter now flags the directories with a forward slash, to help identify them in the listing. Similarly, it flags executable files (like the test,sh file above) with an asterisk, to help you find the files that can be run on the system easier.

The -R parameter is another command ls parameter to use. It shows files that are contained within directories in the current directory. If you have lots of directories, this can be quite a long listing. Here’s a simple example of what the -R parameter produces:

Description

Notice that first, the -R parameter shows the contents of the current directory, which is a file (file1) and two directories (test1 and test2). Following that, it traverses each of the two directories, showing if any files are contained within each directory. The test1 directory shows two files (myprog1 and myprog2), while the test2 directory doesn’t contain any files. If there had been further subdirectories within the test1 or test2 directories, the -R parameter would have continued to traverse those as well. As you can see, for large directory structures this can become quite a large output listing.

Modifying Listing Information

As you can see in the basic listings, the ls command doesn’t produce a whole lot of information about each file. For listing additional information, another popular parameter is -l. The -l parameter produces a long listing format, providing more information about each file in the directory:

Description

The long listing format lists each file and directory contained in the directory on a single line. Besides the file name, it shows additional useful information. The first line in the output shows the total number of blocks contained within the directory. Following that, each line contains the following information about each file (or directory):

- The file type (such as directory (d), file (-), character device (c), or block device (b)

- The permissions string for the file, indicting permissions for the user, group, and other users

- The number of hard links to the file

- The username of the owner of the file

- The group name of the group the file belongs to

- The size of the file in bytes

- The time the file was modified last

- The file or directory name

The -l parameter is a powerful tool to have. Armed with this information you can see just about any information you need to for any file or directory on the system.

The Complete Parameter List

There are lots of parameters for the ls command that can come in handy as you do file management. If you use the man command for ls, you’ll see several pages of available parameters for you to use to modify the output of the ls command.

The ls command uses two types of command line parameters:

- Single-letter parameters

- Full-word (long) parameters

The single-letter parameters are always preceded by a single dash. Full-word parameters are more descriptive and are preceded by a double dash. Many parameters have both a single-letter and full-word version, while some have only one type. TABLE 7-2 lists some of the more popular parameters that’ll help you out with using the bash ls command.

TABLE 7-2    Some popular ls command parameters.

Single Letter

Full Word

Description

-a

--all

Don’t ignore entries starting with a period.

-A

--almost-all

Don’t list the . and .. files.

--author

Print the author of each file.

-b

--escape

Print octal values for nonprintable characters.

--block-size=size

Calculate the block sizes using size-byte blocks.

-B

~

Don’t list entries with the tilde (~) symbol (used to denote backup copies).

-c

Sort by time of last modification.

-C

List entries by columns.

--color=when

When to use colors (always, never, or auto).

-d

--directory

List directory entries instead of contents and don’t dereference symbolic links.

-F

--classify

Append file-type indicator to entries.

--file-type

Only append file-type indicators to some file types (not executable files).

--format=word

Format output as either across, commas, horizontal, long, single-column, verbose, or vertical.

-g

List full file information except for the file’s owner.

--group-directories-first

List all directories before files.

-G

--no-group

In long listing don’t display group names.

-h

--human-readable

Print sizes using K for kilobytes, M for megabytes, and G for gigabytes.

--si

Same as -h, but use powers of 1000 instead of 1024.

-i

--inode

Display the index number (inode) of each file.

-l

Display the long listing format.

-L

--dereference

Show information for the original file for a linked file.

-n

--numeric-uid-gid

Show numeric userid and groupid instead of names.

-o

In long listing don’t display owner names.

-r

--reverse

Reverse the sorting order when displaying files and directories.

-R

--recursive

List subdirectory contents recursively.

-s

--size

Print the block size of each file.

-S

--sort=size

Sort the output by file size.

-t

--sort=time

Sort the output by file modification time.

-u

Display file last access time instead of last modification time.

-U

--sort=none

Don’t sort the output listing.

-v

--sort=version

Sort the output by file version.

-x

List entries by line instead of columns.

-X

--sort=extension

Sort the output by file extension.

You can use more than one parameter at a time if you want to. The double dash parameters must be listed separately, but the single dash parameters can be combined together into a string behind the dash. A common combination to use is the -a parameter to list all files, the -i parameter to list the inode for each file, the -l parameter to produce a long listing, and the -s parameter to list the block size of the files. The inode of a file or directory is a unique identification number the kernel assigns to each object in the filesystem. Combining all of these parameters creates the easy-to-remember -sail parameter:

Description

Besides the normal -l parameter output information, you’ll see two additional numbers added to each line. The first number in the listing is the file or directory inode number. The second number is the block size of the file.

Directory Handling

In Linux there are a few commands that work for both files and directories and some that only work for directories. This section discusses the commands that can only work with directories.

Creating Directories

There’s not much to creating a new directory in Linux; just use the mkdir command:

Description

Description

The system creates a new directory and assigns it a new inode number.

Deleting Directories

Removing directories can be tricky, but there’s a reason for that. There are lots of opportunities for bad things to happen when you start deleting directories. Bash tries to protect us from accidental catastrophes as much as possible. The basic command for removing a directory is rmdir:

By default, the rmdir command only works for removing empty directories. Since there is a file in the dir1 directory, the rmdir command refuses to remove it. You can remove nonempty directories using the --ignore-fail-on-non-empty parameter.

You can also use the rm command when handling directories.

If you try using it without parameters, as with files, you’ll be somewhat disappointed:

However, if you really want to remove a directory, you can use the -r parameter to recursively remove the files in the directory, then the directory itself:

Description

While this works, it’s somewhat awkward. Notice that you still must verify every file that gets removed. For a directory with lots of files and subdirectories, this can become tedious.

The ultimate solution for throwing caution to the wind and removing an entire directory, contents and all, is the rm command with both the -r and -f parameters:

That’s it. No warnings, no fanfare, just another shell prompt. This, of course, is an extremely dangerous tool to have, especially if you’re logged in as the root user account. Use it sparingly and only after triple checking to make sure that you’re doing exactly what you want to do.

File Handling

Bash provides lots of commands for manipulating files on the Linux filesystem. This section walks through the basic commands you will need to work with files from the CLI for all your file-handling needs.

Creating Files

Every once in a while you will run into a situation where you need to create an empty file. Sometimes applications expect a log file to be present before they can write to it. In these situations, you can use the touch command to easily create an empty file:

Description

The touch command creates the new file you specify and assigns your username as the file owner.

Notice that the file size is zero, since the touch command just created an empty file. The touch command can also be used to change the access and modification times on an existing file without changing the file contents:

Description

The modification time of test1 is now updated from the original time. If you want to change only the access time, use the -a parameter. To change only the modification time, use the -m parameter.

By default, touch uses the current time. You can specify the time by using the -t parameter with a specific timestamp value:

Description

Now the modification time for the file is set to a date in the future from the current time.

Copying Files

Copying files and directories from one location in the filesystem to another is a common practice for system administrators. The cp command provides this feature.

In its most basic form, the cp command uses two parameters: the source object and the destination object:

When both the source and destination parameters are filenames, the cp command copies the source file to a new file with the filename specified as the destination. The new file acts like a brand new file, with an updated file creation and last modified times:

Description

The new file test2 shows a different inode number, indicating that it’s a completely new file. You’ll also notice that the modification time for the test2 file shows the time that it was created. If the destination file already exists, the cp command will prompt you to answer whether or not you want to overwrite it:

If you don’t answer y, the file copy will not proceed. You can also copy a file to an existing directory:

Description

The new file is now under the dir1 directory, using the same filename as the original. These examples all used relative pathnames, but you can just as easily use the absolute pathname for both the source and destination objects.

To copy a file to the current directory you’re in, you can use the dot symbol:

As with most commands, the cp command has a few command line parameters to help you out. These are shown in TABLE 7-3.

TABLE 7-3    The cp command parameters.

Parameter

Description

-a

Archive files by preserving their attributes.

-b

Create a backup of each existing destination file instead of overwriting it.

-d

Preserve.

-f

Force the overwriting of existing destination files without prompting.

-i

Prompt before overwriting destination files.

-l

Create a file link instead of copying the files.

-p

Preserve file attributes if possible.

-r

Copy files recursively.

-R

Copy directories recursively.

-s

Create a symbolic link instead of copying the file.

-S

Override the backup feature.

-u

Copy the source file only if it has a newer date and time than the destination (update).

-v

Verbose mode, explaining what’s happening.

-x

Restrict the copy to the current filesystem.

Use the -p parameter to preserve the file access or modification times of the original file for the copied file.

Description

Description

Now, even though the test3 file is a completely new file, it has the same timestamps as the original test1 file.

The -R parameter is extremely powerful. It allows you to recursively copy the contents of an entire directory in one command:

Description

Now dir2 is a complete copy of dir1.

You can also use wildcard characters in your cp commands:

Description

This command copied all of the files that started with test to dir2. The -f parameter forces the overwrite of the test1 file that was already in the directory without asking.

Linking Files

You may have noticed a couple of the parameters for the cp command referred to linking files. This is a pretty cool option available in the Linux filesystems. If you need to maintain two (or more) copies of the same file on the system, instead of having separate physical copies, you can use one physical copy and multiple virtual copies, called links. A link is a placeholder in a directory that points to the real location of the file. There are two different types of file links in Linux:

- A symbolic link or soft link

- A hard link

The hard link creates a separate file, but it points to the same inode number as the original file, so no physical file is created in the filesystem. The hard link file contains information about the original file just like a normal file. When you reference the hard link file, it’s just as if you’re referencing the original file:

Description

The -l parameter created a hard link for the test1 file called test4. The file listing shows that the inode numbers of both the test1 and test4 files are the same, indicating that, in reality, they are both the same file. Also notice that the link count (the third item in the listing) now shows that both files have two links.

NOTE

You can only create a hard link between files on the same physical medium. You can’t create a hard link between files under separate mount points. In that case, you’ll have to use a soft link.

On the other hand, the -s parameter creates a symbolic, or soft, link:

Description

There are a couple of things to notice in the file listing. First, you’ll notice that the new test5 file has a different inode number than the test1 file, indicating that the Linux system treats it as a separate file. Second, the file size is different. A linked file needs to store only information about the source file, not the actual data in the file. The filename area of the listing shows the relationship between the two files.

TIP

Instead of using the   cp command to link files, you can also use the ln command. By default the ln command creates hard links. If you want to create a soft link, you’ll still need to use the -s parameter.

Be careful when copying linked files. If you use the cp command to copy a file that’s linked to another source file, all you’re doing is making another copy of the source file. This can quickly get confusing.

Instead of copying the linked file, you can create another link to the original file. You can have many links to the same file with no problems. However, you also don’t want to create soft links to other soft-linked files. This creates a chain of links that can not only be confusing but also be easily broken, causing all sorts of problems.

Renaming Files

In the Linux world, renaming files is called moving. The mv command is available to move both files and directories to another location:

Description

Notice that moving the file changed the filename but kept the same inode number and the timestamp value. Moving a file with soft links is a problem:

Description

Description

The test4 file that uses a hard link still uses the same inode number, which is perfectly fine. However, the test5 file now points to an invalid file, and it is no longer a valid link. If your terminal uses colors to identify file types, the test5 file will appear in red, indicating that it’s an invalid file. If you move the file back to the test1 file name (or create another file using the test1 file name) the test5 file link will become valid.

You can also use the mv command to move directories:

The entire contents of the directory are unchanged. The only thing that changes is the name of the directory.

Deleting Files

Most likely at some point in your Linux career you’ll want to be able to delete existing files. Whether it’s to clean up a filesystem or to remove a software package, there’s always opportunities to delete files.

In the Linux world, deleting is called removing. The command to remove files in Bash is rm. The basic format of the rm command is pretty simple:

Description

Notice that the command prompts you to make sure that you’re serious about removing the file. There’s no trashcan in the CLI like there often is in the graphical desktop environment. Once you remove a file, it’s gone forever.

Now, here’s an interesting tidbit about deleting a file that has links to it:

Description

Description

In this example the test1 file was removed, which had both a hard link with the test4 file and a soft link with the test5 file. Noticed what happened. Both of the linked files still appear, even though the test1 file is now gone (although on my color terminal the test5 filename now appears in red). If you look at the contents of the test4 file that was a hard link, it still shows the contents of the file. If you try to look at the contents of the test5 file that was a soft link, Bash indicates that it doesn’t exist anymore.

Remember that the hard link file uses the same inode number as the original file. The hard link file maintains that inode number until you remove the last linked file, preserving the data! All the soft link file knows is that the underlying file is now gone, so it has nothing to point to. This is an important feature to remember when working with linked files.

One other feature of the rm command, if you’re removing lots of files and don’t want to be bothered with the prompt, is to use the -f parameter to force the removal. Just be careful!

TIP

As with copying files, you can use wildcard characters with the   rm command. Again, use caution when doing this, as anything your remove, even by accident, is gone forever!

File Features

A few features are unique to Linux and you’ll need to be aware of them when working with files. This section walks through these features.

Using Wildcards

The ls, cp, mv, and rm commands are handy, but specifying single file or directory names in the commands makes them somewhat clunky to work with on the Linux command line. If you want to work with more than one file or directory, you need to use a technique the Linux world calls globbing.

Globbing is basically the use of wildcard characters to represent one or more characters in a file or directory name. That feature allows us to specify a pattern for Linux to match multiple files or directories against. There are two basic globbing characters that you can use:

- The question mark—represents a single character

- The asterisk—represents zero or more characters

The question mark is a stand-in character to represent any single character to match in the filename. For example, you can specify the filename file?.txt in a rm command to remove any file that starts with “file”, then has one character, then ends in “.txt”. Here’s an example:

Description

Description

The rm command uses the glob “file?.txt” as the parameter. Linux looks for any file in the directory that matches the pattern to remove. Two files, file1.txt and file2.txt, match the pattern. However, the file10.txt file doesn’t match the pattern because there are two characters between the “file” and “.txt” parts of the filename, and the file.txt file doesn’t match the pattern because there aren’t any characters between the “file” and “.txt” parts of the filename.

You use the asterisk glob character to match zero or more characters in the filename:

Description

By using the asterisk, Linux matched all of the files that started with “file” and ended with “.txt”, even the file.txt file! You can use the asterisk in any list, copy, move, or delete operation in the command line.

Quoting

Another issue you may run into with Linux is files or directories that contain spaces in their names. This is perfectly legal in Linux but can cause headaches when working from the command line.

If you try to reference a file or directory that contains a space in the filename, you’ll get an error message:

Description

Description

The problem is that by default, the rm command uses a space to indicate the end of a filename, so it thinks you’re trying to remove three separate files – “long”, “file”, and “name.txt”!

There are two ways to get around that. One way is to use quoting, which places quotes around any filenames that contain spaces:

You can use either single or double quotes around the filename, as long as you use the same type on both ends of the filename.

The other method is to use escaping, which places a backslash character in front of the character you want the Linux shell to interpret as a data character and not a shell character:

Either method works just fine when working with spaces in file names.

Case Sensitivity

One last thing to watch out for when using the Linux file handling command line commands is the case of any file or directory names that you’re working with. Linux is a case-sensitive operating system, so files and directories can have both upper and lower case letters in the names. Likewise, as you’re working with the files, make sure you reference the correct format of the files or directory names:

Description

This is a good example of when using filename globbing can come in handy. If you’re not sure of the case of a character, you can use the question mark to represent any character of any case:

This command will remove both the file1.txt and File1.txt files.

Finding Files

With so many files stored on the Linux system, it can often become difficult to find the files you’re looking for. Fortunately, Linux provides a few different file-searching features for us to help out. This chapter takes a look at the ones you’ll most likely use and run into on the Linux Essentials exam.

The which Command

You can use the which command to find where programs and utilities are stored. This can come in handy if you have two versions of a program installed on your system, or if you’re not sure if a command is built into the Linux shell, or supplied as a separate utility. The format for using the which command is pretty simple:

The output of the which command shows the full path to where the command is stored on the system. If you have two versions of a program on the system, the which command shows which one will run when you type it at the command line. If you need to use a different version, you have to use the full path to the program file.

The locate Command

Most Linux distributions contain the locate command by default. The locate command uses a database that keeps track of the location of files on the system. When you use the locate command, it searches the database to find the requested file. This process is often quicker than trying to search through all of the files on the filesystem.

The key to the locate command is the information in the database. It can only find files that have been indexed into the database. The information in the database is updated by the appropriately named updatedb program. The Linux system runs the updatedb program in background mode on a regular basis to update the file database with any new files stored on the system.

WARNING

For Linux systems that don’t run continually, like workstations, the   updatedb program may not always run; it’s usually scheduled to run at night. In those situations you can manually run the updatedb program. This is especially helpful after you’ve installed new applications so you can find the files associated with the application.

Be careful when using the locate command though; you may get more than you bargained for! Here’s an example:

Description

The locate command returns any file that contains the word “touch” in the filename! You’ll need to filter through the results to find the file that you’re looking for.

Another downside to the locate command is that it can’t find any newly added files until the next running of the updatedb program. Some Linux systems run the updatedb program on a regular basis, every few minutes, while others only schedule it to run only once or twice a day. How often you need to run it depends on how often you get new files on your Linux system and how quickly you’d need to find them.

NOTE

Not all Linux distributions install the locate package by default; you may need to find the package (called mlocate in Ubuntu) and manually install it.

The whereis Command

The whereis command is similar to the which command, in that it looks for a specific occurrence of the file you’re searching for. However, it only looks in binary file directories, library directories, and documentation directories, so that helps speed up the search process some. This is great for finding not only commands, but the documentation files that go along with them.

In this example, the whereis command retuned the location of the touch program file, and the location of the manual page associated with the touch program.

The find Command

The last resort to finding files on your Linux system is the find command. It does a physical search through the virtual directory tree looking for the specified file. As you can imagine, the wider the search area, the longer it will take for the find command to return an answer. You specify the search area as the first parameter on the find command line:

This example restricts the find command to looking in the /home/rblum directory structure for the file named hello. The -name option specifies the filename to look for, and the -print command tells the find command to display the results.

What makes the find command so versatile is that it can find files based on lots of different criteria besides just the file name, such as the creation time, the file owner, the file size, or even file permissions. For example, you can use the find command to look for all files over 1MB on your filesystem. TABLE 7-4 shows some of the options you can use in the find command.

TABLE 7-4    Useful find command options.

Option

Description

-amin n

File was last accessed n minutes ago.

-atime n

File was last accessed n days ago.

-ctime n

File was last changed n minutes ago.

-inum n

Match the file inode number to the number specified.

-name

Match the file name to the pattern specified.

-perm

Match the file permissions to the pattern specified.

-size n

Match the file size to the amount specified.

-user

Match the file owner to the name specified.

You can also use special modifiers on the find options, such as a plus sign for “greater than” or a minus sign for “less than.” For example, to list all of the files larger than 5000 characters, you’d use:

The +5000c parameter tells the find command to look for files in the current directory that are more than 5,000 characters in size.

Archiving Files

Storing data can get ugly. The more data you need to store, the more disk space it requires. While disk sizes are getting larger these days, there is still a limit to how much space you have. To help with that, you can use some Linux file archiving tools to help compress data files for storage and sharing. This section takes a look at how Linux handles compressing and archiving both files and directories.

Compressing Files

If you’ve done any work in the Microsoft Windows world, no doubt you’ve used zip files. The PKZip compression utility became the de facto way to compress data and executable files in Windows, so much so that Microsoft eventually incorporated it into the Windows operating system starting with XP as the compressed directories feature. Compressed directories allow you to easily compress large files or a large group of files into smaller file that takes up less space and is easier to copy to another location.

Linux provides a few different tools you can use to compress files to save space. While this may sound great, it can sometimes lead to confusion and chaos when trying to download and extract Linux files from the Internet. TABLE 7-5 lists the different file compression utilities available in Linux.

TABLE 7-5    Linux file compression utilities.

Utility

File extension

Description

bzip2

.bz2

Uses the Burrows-Wheeler block sorting text compression algorithm and Human coding

compress

.Z

Original Unix file compression utility, but starting to fade away into obscurity

gzip

.gz

The GNU Project’s compression utility, uses the open source Lempel-Ziv coding

zip

.zip

The Unix version of the PKZip program for Windows

The compress utility can work with files compressed on standard Unix systems but is not often installed by default on Linux systems. If you download a file with a .Z extension you can usually install the compress package from the distribution software repository. The zip utility creates compressed directories that can be extracted on Windows systems but is not the best compression algorithm to use if you’re keeping the files on a Linux system.

The gzip utility is the most popular compression tool used in Linux. It is a creation of the GNU Project, in their attempt to create a free version of the original Unix compress utility. This package includes three main files:

- gzip for compressing files

- gzcat for displaying the contents of compressed text files

- gunzip for uncompressing files

The gzip command compresses the file you specify on the command line. You can also specify more than one filename, or even use wildcard characters to compress multiple files at once:

This gzip command compresses every file in the directory that starts with “my”.

Creating Archive Files

Although the gzip command can not only compresses data, but also archive the data into a single file, it’s not the standard utility used for archiving large amounts of data in the Unix and Linux worlds. By far the most popular archiving tool used in Unix and Linux is the tar command.

The tar command was originally used to backup files to a tape device for archiving. However, it can also write the output to a file, which has become a popular way to bundle data for distribution in Linux. You can also then apply compression to the archive file, making it a compact way to store large quantities of files. It’s very common to see source code files bundled into a tar archive file (affectionately called a tarball) for distribution.

The following is the format of the tar command:

The function parameter defines what the tar command should do, as shown in TABLE 7-6.

TABLE 7-6    The tar command functions.

Function

Description

-a

Appends an existing tar archive file to another tar archive file

-c

Creates a new tar archive file

-d

Checks the differences between a tar archive file and the filesystem files

-r

Appends files to an existing tar archive file

-t

Lists the contents of an existing tar archive file

-u

Appends files to an existing tar archive file that are newer than a file with the same in the archive

-x

Extract files from an existing tar archive file

Each function uses one or more options to define a specific behavior for the tar archive file. TABLE 7-7 shows the options that you can use with the tar command:

TABLE 7-7    The tar command options.

Option

Description

-C dir

Changes to the specified directory

-f file

Outputs results to the file (or device) specified.

-j

Redirects output to the bzip2 command for compression

-P

Preserves all file permissions

-v

Lists files as they are processed

-z

Redirects the output to the gzip command for compressions

While the combination of several functions along with several options seems like an impossible task to remember, in reality you’ll find yourself just using a handful of combinations to do common tasks. The following section takes a look at the more common archiving scenarios that you’ll run into.

Archiving Scenarios

Normally there are just three basic things you’ll need to do with the tar command:

- Archive files to create a tarball

- List the files contained in a tarball

- Extract the files from a tarball

This helps narrow down the function and option features that you need to remember for the tar command.

To start off, you can create a new archive file using this command:

This command creates an archive file called test.tar containing the contents of both the test directory and the test2 directory. The -v option is a nice feature, in that it displays the files as they’re added to the archive file.

Next, to display the contents of a tarball file, you just use this command:

The -t function lists the contents of the tarball to the standard output by default, which is your monitor. The files aren’t extracted, just listed out.

Finally, to extract the files contained in a tarball, you’ll use this command:

It extracts the contents of the tar file test.tar into the current directory. If the tar file was created from a directory structure, the entire directory structure is recreated starting at the current directory.

As you can see, using the tar command is a simple way to create archive files of entire directory structures. That’s why this has become a common method for distributing source code files for open source applications in the Linux world!

CHAPTER SUMMARY

File management is an important part of the Linux system, and it helps to know the basics of how to manage files from the CLI. This chapter first showed you how to use both absolute and relative filepaths in commands to reference files and directories. Next, it showed the standard Linux file naming conventions used by Linux distributions, along with how Linux uses inodes to handle files. Following that the chapter went through a detailed discussion of how to use the ls command to list the contents of directories. While there are lots of parameters associated with the ls command, you’ll soon find yourself using just a handful of them to view the information that you need.

After that the chapter showed how to use the Linux CLI to create, move, and remove both directories and files. The chapter also went through how to use globbing to specify file and directory ranges instead of single files in the commands, as well as how to use quoting to work with file and directory names that incorporate spaces.

The chapter finished by walking through the most common Linux commands used to help find files on the Linux system, as well as how to handle file archives. The   which, locate, and whereis commands can be useful for general searches, but the find command allows you to customize your search by specifying specific file or directory properties to look for. For archiving files, you can use the gzip family of commands, along with the tar command to archive files and directories.

KEY CONCEPTS AND TERMS

- Absolute filepath

- Asterisk

- cd

- Compressed directory

- cp

- Escaping

- File

- find

- Full-word parameters

- Globbing

- gzip

- Hard link

- Hidden files

- Inode

- Inode number

- Inode table

- Links

- locate

- ls

- mkdir

- Mount points

- mv

- Question mark

- Quoting

- Relative filepath

- rm

- rmdir

- Root

- Root drive

- Single-letter parameter

- Symbolic link

- tar

- touch

- updatedb

- Virtual directory

- whereis

- which

CHAPTER 7 ASSESSMENT

1. Additional storage devices are mounted in the virtual directory using _____ ______.

1. root directory

2. mount points

3. /home folder

4. absolute filepaths

2. Which directory in Linux is commonly used to store system configuration files?

1. /home

2. /dev

3. /etc

4. /

3. The /var directory is commonly used in Linux to store log files.

1. True

2. False

4. Which type of filepath specifies a file location using a complete path from the root directory?

1. Absolute filepath

2. Relative filepath

3. Mount point

4. Root folder

5. The “..” symbol tells Linux to go up one directory level in a relative filepath.

1. True

2. False

6. Linux file names cannot start with a number.

1. True

2. False

7. Linux file names can contain spaces

1. True

2. False

8. Which command should you use to rename a file in Linux?

1. cp

2. rm

3. ln

4. mv

9. What parameter can you add to the rm command to remove a directory that contains files?

1. -f

2. -r

3. -a

4. -e

10. Which archiving utility is commonly used in Linux?

1. tar

2. gzip

3. compress

4. pkzip

Resources

Linux Documentation Project, “The Linux Filesystem Hierarchy,” Accessed on Oct. 17, 2015, from http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/.

Resources

Linux Documentation Project, “The Linux Filesystem Hierarchy,” Accessed on Oct. 17, 2015, from http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/.

© Picsfive/Shutterstock

CHAPTER 8

Networking Concepts

THESE DAYS IT’S ALMOST A NECESSITY to have your Linux system connected to some type of network. Whether it’s because of the need to share files and printers on a local network or the need to connect to the Internet to download updates and security patches, most Linux systems have some type of network connection.

This chapter looks at how to configure your Linux system to connect to a network as well as how to troubleshoot network connections if things go wrong. There are a few different methods for configuring network settings in Linux. First, the chapter covers the common locations for the configuration files in Linux distributions. Next, it examines the different tools you have at your disposal that help make configuring the network settings easier. After that, the chapter shows some simple network troubleshooting techniques you can use to help find the problem if anything goes wrong.

CHAPTER 8 TOPICS

This chapter covers the following topics and concepts:

- What configuration files Linux systems use to set network settings

- How to use the Network Manager graphical tool to configure network settings

- How to use the Network Manager command-line tools to configure network settings

- Using other command-line tools to configure network settings

- Using Linux command-line utilities to troubleshoot network issues

CHAPTER 8 GOALS

When you complete this chapter, you will be able to:

- Describe how Linux stores network configurations

- List the different ways to configure network settings

- Use the Network Manager graphical and command-line tools to connect a Linux system to the network

- Use other popular Linux command-line tools to connect a Linux system to the network

- Troubleshoot common network problems using Linux command-line utilities

Configuring Network Features

You need five main pieces of information to configure your Linux system to interact on a network:

- The host address

- The network subnet address

- The default router (sometimes called gateway)

- The system hostname

- A Domain Name System (DNS) server address for resolving hostnames

There are three different ways to configure this information in Linux systems:

- Manually editing network configuration files

- Using a graphical tool included with your Linux distribution

- Using command-line tools

The following sections walk through each of these methods.

Network Configuration Files

Every Linux distribution uses network configuration files to define the network settings required to communicate on the network. Unfortunately, there’s not a single standard configuration file that all distributions use.

Instead, different distributions use different configuration files to define the network settings. Table 8-1 shows the most common network configuration files that you’ll run into.

TABLE 8-1    Linux network configuration files.

Distribution

Network Configuration Location

Debian based

/etc/network/interfaces file

Red Hat based

/etc/sysconfig/network-scripts directory

openSUSE

/etc/sysconfig/network file

While each of the Linux distributions uses a different method of defining the network settings, they all have similar features. Most configuration files define each of the required network settings as separate values in the configuration file.   LISTING 8-1   shows an example from a Debian-based Linux system.

LISTING 8-1 Sample Debian network static configuration settings.

Description

The example shown in   Listing 8-1   assigns both an IP and an IPv6 address to the wired network interface designated as eth0.

LISTING 8-2   shows how to define the IP network settings automatically using a DHCP server on the network.

LISTING 8-2 Sample Debian network DHCP configuration settings.

If you just want to assign an IPv6 link local address, which uniquely identifies the device on the local network, but not retrieve an IPv6 address from a DHCP server, replace the inet6 line with this:

The auto attribute tells Linux to assign the link local address, which allows the Linux system to communicate with any other IPv6 device on the local network but not a global address.

NOTE

Since version 17.04, the Ubuntu distribution has deviated from the standard Debian method and utilizes the Netplan tool to manage network settings. Netplan uses simple YAML text files in the   /etc/netplan folder to define the network settings for each network interface installed on the system. By default, Netplan just passes the network settings off to the NetworkManager tool, so you don’t need to worry about how the Netplan configuration files are set.

For Red Hat–based systems, you’ll need to define the network settings in multiple files, one for each network interface. The format of each file is:

where interface is the device name for the network adapter, such as ifcfg-enp0s3.   Listing 8-3   shows an example from a Rocky Linux system.

LISTING 8-3 Sample Rocky network interface configuration settings.

Description

This configuration indicates that the workstation is using the DHCP process to automatically retrieve network information from a network server. For static IP addresses, you can set the IP address, default gateway, and subnet mask in the configuration file.

Most Linux distributions use the /etc/hostname file to store the local hostname of the system, however, some use /etc/HOSTNAME instead. You will also need to define a DNS server so that the system can resolve DNS hostnames. Fortunately, this is a standard that all Linux systems follow and is handled in the /etc/resolv.conf configuration file:

The domain entry defines the domain name assigned to the network. By default the system will append this domain name to any hostnames you specify. The search entry defines any additional domains used to search for hostnames. The nameserver entry is where you specify the DNS server assigned to your network. Some networks can have more than one DNS server; just add multiple nameserver entries in the file.

NOTE

For systems using the systemd startup method, you can use the hostnamectl command to view or change the hostname information. Also, to help speed up connections to commonly used hosts, you can manually enter their hostnames and IP addresses into the   /etc/hosts file on your Linux system. The /etc/nsswitch.conf file defines whether the Linux system checks this file before or after using DNS to look up the hostname.

Using Graphical Tools

The Network Manager tool is a popular program used by many Linux distributions to provide a graphical interface for defining network connections. The Network Manager tool starts automatically at boot time and appears in the system tray area of the desktop as an icon.

If your system detects a wired network connection, the icon appears as a mini-network with blocks connected together. If your system detects a wireless network connection, the icon appears as an empty radio signal. When you click the icon, you’ll see a list of the available wireless networks detected by the network card (as shown in FIGURE 8-1).

FIGURE 8-1 Network Manager showing a wireless network connection.Courtesy of Linux Foundation.

Courtesy of Linux Foundation.

Description

Click your access point to select it from the list. If your access point is encrypted, you’ll be prompted to enter the password to gain access to the network.

Once your system is connected to a wireless access point, the icon appears as a radio signal. Click the icon, and then select Edit Connections to edit the network connection settings for the system, shown in FIGURE 8-2.

FIGURE 8-2 The Network Connections window.Courtesy of Linux Foundation.

Courtesy of Linux Foundation.

Description

You can select the network connection to configure (either wireless or wired) and then click the Edit button to change the current configuration.

The Network Manager tool allows you to specify all four of the network configuration values by using the manual configuration option or to set the configuration to use DHCP to determine the settings. The Network Manager tool automatically updates the appropriate network configuration files with the updated settings.

Using Command-Line Tools

If you’re not working with a graphical desktop client environment, you’ll need to use the Linux command-line tools to set the network configuration information. Quite a few command-line tools are at your disposal. The following sections cover the ones you’re most likely to run into.

Network Manager Command-Line Tools

The Network Manager tool also provides two different types of command-line tools:

- nmtui provides a simple text-based menu tool.

- nmcli provides a text-only command-line tool.

Both tools help guide you through the process of setting the required network information for your Linux system. The nmtui tool displays a stripped-down version of the graphical tool where you can select a network interface and assign network properties to it, as shown in FIGURE 8-3.

FIGURE 8-3 The Network Manager nmtui command-line tool.Courtesy of nmtui.

Courtesy of nmtui.

Description

The nmcli tool doesn’t attempt to use any type of graphics capabilities; it just provides a command-line interface where you can view and change the network settings. By default, the command displays the current network devices and their settings, as shown in   LISTING 8-4  .

LISTING 8-4 The default output of the nmcli command.

Description

The nmcli command uses command-line options to allow you to set the network settings:

Description

This allows you to set all of the necessary network configuration features in a single nmcli command.

The iproute2 Utilities

The iproute2 package is a newer open-source project that contains a set of command-line utilities for managing network connections. While the package contains several different programs, the ip program is the most used.

The ip command is the Swiss army knife of network programs and is becoming the more popular method for defining network settings from the command line. It uses several command options to display the current network settings or define new network settings. Table 8-2 shows these commands.

TABLE 8-2    The ip utility command options.

Parameter

Description

address

Display or set the IPv4 or IPv6 address on the device.

addrlabel

Define configuration labels.

l2tp

Tunnel Ethernet over IP.

link

Define a network device.

maddress

Define a multicast address for the system to listen to.

monitor

Watch for netlink messages.

mroute

Define an entry in the multicast routing cache.

mrule

Define a rule in the multicast routing policy database.

neighbor

Manage ARP or NDISC cache entries.

netns

Manage network namespaces.

ntable

Manage the neighbor cache operation.

route

Manage the routing table.

rule

Manage entries in the routing policy database.

tcpmetrics

Mange TCP metrics on the interface.

token

Manage tokenized interface identifiers.

tunnel

Tunnel over IP.

tuntap

Manage TUN/TAP devices.

xfrm

Manage IPSec policies for secure connections.

Each command option utilizes parameters to define what to do, such as display network settings or modify existing network settings.   LISTING 8-5   demonstrates how to display the current network settings using the show parameter.

LISTING 8-5 The ip address output.

Description

NOTE

You can also use shortened commands as long as they make the command unique. For example, you can use   ip a instead of ip address.

This example shows two network interfaces on the Linux system:

- lo is the local loopback interface.

- enp0s3 is a wired network interface.

The local loopback interface is a special virtual network interface. Any local program can use it to communicate with other programs on the system just as if they were across a network. That can simplify transferring data between programs.

The enp0s3 network interface is the wired network connection for the Linux system. The ip command shows the IP address assigned to the interface (there’s both an IP and an IPv6 link local address assigned), the netmask value, and some basic statistics about the packets on the interface.

If the output doesn’t show a network address assigned to the interface, you can use the ip command to specify the host address and netmask values for the interface:

Then use the ip command with the route option to set the default router for the network interface:

Then finally, make the network interface active by using the link option:

With the single ip command you can manage just about everything you need for your network connections.

The net-tools Legacy Tool

If you need to work on an older Linux distribution, the net-tools package may be all you have to work with. The net-tools package was the original method in Linux for managing individual aspects of the network configuration. You need to use four main command-line tools:

- ethtool displays Ethernet settings for a network interface.

- ifconfig displays or sets the IP address and netmask values for a network interface.

- iwconfig sets the SSID and encryption key for a wireless interface.

- route sets the default router address.

The ethtool command allows you to peek inside the network interface card Ethernet settings and change any properties that you may need to communicate with a network device, such as a switch.

By default, the ethtool command displays the current configuration settings for the network interface, as shown in   LISTING 8-6  .

LISTING 8-6 Output from the ethtool command.

Description

You can change features such as speed, duplex, and whether or not the network interface attempts to auto-negotiate features with the switch.

The ifconfig command is a legacy command that allows you to set the network address and subnet mask for a network interface:

You can also use the ifconfig command to view the current statistics for a network interface, as shown in   LISTING 8-7  .

LISTING 8-7 The network interface stats from the ifconfig command.

Description

Using the ifconfig command you can see the link status of a network interface, whether it is receiving or transmitting packets and whether there were any dropped packets or collisions. This can be a handy network troubleshooting tool.

With the net-tools package you must set the default router using the separate route command:

You can also use the route command by itself to view the current default router configured for the system.

Description

Description

The default router defined for the Linux system is 192.168.1.254 and is available from the enp0s3 network interface. The output also shows that to get to the 192.168.1.0 network, you don’t need a gateway because that’s the local network the Linux system is connected to.

If your network is connected to multiple networks via multiple routers, you can manually create the routing table in the system by using the add or del command-line option for the route command. The format for that is

where target is the target host or network and gateway is the router address.

If you’re working with a wireless network card, you must assign the wireless SSID and encryption key values using the iwconfig command:

The essid parameter specifies the access point SSID name, and the key parameter specifies the encryption key required to connect to it. Notice that the encryption key is preceded by an s:. That allows you to specify the encryption key in ASCII text characters; otherwise you’ll need to specify the key using hexadecimal values.

If you don’t know the name of a local wireless connection, you can use the iwlist command to display all of the wireless signals your wireless card detects. Just specify the name of the wireless device and use the scan option:

Once you’ve set the wireless network card configuration, you can proceed to assign it an IP address and default route the same as you would a wired network card.

NOTE

You can fine-tune networking parameters for a network interface using the   /etc/sysctl.conf configuration file. This file defines kernel parameters that the Linux system uses when interacting with the network interface. This has become a popular method to use for setting advanced security features, such as to disable responding to ICMP messages by setting the icmp_echo_ignore_ broadcasts value to 1, or if your system has multiple network interface cards, to disable packet forwarding by setting the ip_ forward value to 0.

Additional Network Features

If your network uses Dynamic Host Configuration Protocol (DHCP), you’ll need to ensure that a proper DHCP client program is running on your Linux system. The DHCP client program communicates with the network DHCP server in the background and assigns the necessary Internet Protocol (IP) address settings as directed by the DHCP server. Three common DHCP programs are available for Linux systems:

- dhcpcd

- dhclient

- pump

The dhcpcd program is becoming the most popular of the three, but you’ll still see the other two used in some Linux distributions.

When you use your Linux system’s software package manager utility to install the DHCP client program, it sets the program to automatically launch at boot time and handle the IP address configuration needed to interact on the network.

NOTE

If you’re working with a Linux server that acts as a DHCP server, the /etc/dhcpd.conf file contains the IP address settings that the server offers to DHCP clients. The file contains a section for each subnet the DHCP server services:

Description

Basic Network Troubleshooting

Once you have a Linux kernel installed, you can do a few things to check to make sure things are operating properly. The following sections walk through the commands you should know to monitor the network activity, including watching what processes are listening on the network and what connections are active from your system.

Sending Test Packets

One way to test network connectivity is to send test packets to known hosts. Linux provides the ping and ping6 commands to do that. The ping and ping6 commands send Internet Control Message Protocol (ICMP) packets to remote hosts using either the IP (ping) or IPv6 (ping6) protocol. ICMP packets work behind the scenes to track connectivity and provide control messages between systems. If the remote host supports ICMP, it will send a reply packet back when it receives a ping packet.

The basic format for the ping command is to specify the IP address of the remote host:

Description

Description

The ping command continues sending packets until you press Ctrl+C. You can also use the -c command-line option to specify a set number of packets to send and then stop.

For the ping6 command, things get a little more complicated. If you’re using an IPv6 link local address, you also need to tell the command which interface to send the packets out on:

Description

The %enp0s3 part tells the system to send the ping packets out the enp0s3 network interface for the link local address.

Yet another useful tool is the traceroute command. The traceroute command utilizes a feature of ICMP packets that restrict the number of network routers packets can traverse (called “hops”) before reaching their destination. By manipulating that value in the packet, the traceroute command allows you to see the network routers used to get the packets from the client to the server.

WARNING

Unfortunately, these days many host and network firewalls block ICMP packets because they can be used to create a denial of service (DoS) attack against the host. Don’t be surprised if you try to ping a remote host and don’t get any responses.

Finally, the mtr program is a package that utilizes data retrieved from ping and traceroute commands to document network availability and latency in a real-time chart. FIGURE 8-4 shows the output of the mtr command tracing the connectivity to the linux.org server.

FIGURE 8-4 Using mtr to monitor network connectivity to a server.Courtesy of BitWizard.

Courtesy of BitWizard.

Description

Finding Host Information

Sometimes the problem isn’t with network connectivity but with the DNS hostname system. You can test a hostname using the host command:

Description

The host command queries the DNS server to determine the IP addresses assigned to the specified hostname. By default it returns all IP addresses associated with the hostname. Some hosts are supported by multiple servers in a load balancing configuration. The host command will show all of the IP addresses associated with those servers:

Description

You can also specify an IP address for the host command, and it will attempt to find the hostname associated with it:

Description

Notice, though, that often an IP address will resolve to a generic server hostname that hosts the website and not the website alias, as is the case here with the www.linux.org IP address.

Another great tool to use is the dig command. The dig command displays all the DNS data records associated with a specific host or network. For example, you can look up the information for a specific hostname:

Description

Or you can look up DNS data records associated with a specific network service, such as a mail server:

Description

Description

If you need to look up DNS information for multiple servers or domains, the nslookup command provides an interactive interface where you can enter commands:

Description

You can also dynamically specify the address of another DNS server to use for the name lookups, which is a handy way to determine if your default DNS server is at fault if a name resolution fails.

One final tool that can be useful is the whois command. The whois command attempts to connect to the centralized Internet domain registry at whois.networksolutions.com and retrieve information about who registered the requested domain name.   LISTING 8-8   shows a partial output from the whois command.

LISTING 8-8 Partial output from the whois command.

Description

Theoretically the registry contains complete contact information for the owner of the domain, but these days, due to privacy concerns, that information is usually blocked. There is usually though a contact email address for the domain in case you need to report suspected abuse from the domain.

Advanced Network Troubleshooting

Besides the simple network tests shown in the previous section, Linux has some more advanced programs that can provide more detailed information about the network environment. Sometimes it helps to be able to see just what network connections are active on a Linux system. There are two ways to troubleshoot that issue: the netstat command and the ss command.

The netstat Command

The netstat command is part of the net-tools package and can provide a wealth of network information for you. By default, it lists all the open network connections on the system:

Description

Description

The netstat command produces lots of output because there are normally lots of programs that use network services on Linux systems. You can limit the output to just TCP or UDP connections by using the –t command-line option for TCP connections or –u for UDP connections:

Description

You can also get a list of what applications are listening on which network ports by using the –l option:

Description

Description

As you can see, just a standard Linux workstation still has lots of things happening in the background, waiting for connections.

Yet another great feature of the netstat command is that the –s option displays statistics for the different types of packets the system has used on the network:

Description

Description

The netstat statistics output can give you a rough idea of how busy your Linux system is on the network or if there’s a specific issue with one of the protocols installed.

Examining Sockets

The netstat tool provides a wealth of network information, but it can often be hard to determine just which program is listening on which open port. The ss command can come to your rescue for that.

A program connection to a port is called a socket. The ss command can link which system processes are using which network sockets that are active:

Description

The -anpt option displays both listening and established Transmission Control Protocol (TCP) connections and the process they’re associated with. This output shows that the SSH port (port 22) has an established connection and is controlled by process ID 15176, the ssh program.

CHAPTER SUMMARY

Connecting Linux systems to networks can be painless if you have the correct tools. To connect the Linux system, you’ll need an IP address, a netmask address, a default router, a hostname, and a DNS server. If you don’t care what IP address is assigned to your Linux system, you can obtain those values automatically using DHCP. However, if you are running a Linux server that requires a static IP address, you may need to configure these values manually.

Linux stores network connection information in configuration files. You can either manually modify the files to store the appropriate network information or use a graphical or command-line tool to do that. The Network Manager tool is the most popular graphical tool used by Linux distributions. It allows you to configure both wired and wireless network settings from a graphical window. The Network Manager icon in the system tray area shows network connectivity as well as basic wireless information for wireless network cards.

If you must configure your network settings from the command line, you’ll need a few different tools. For wireless connections, use the iwconfig command to set the wireless access point and SSID key. For both wireless and wired connections, use the ifconfig or ip command to set the IP address and netmask values for the interface. You may also need to use the route command to define the default router for the local network.

To use hostnames instead of IP addresses, you must define a DNS server for your network. You do that in the /etc/resolv.conf configuration file. You will also need to define the hostname for your Linux system in either the /etc/hostname or /etc/HOSTNAME file.

Once your network configuration is complete, you may have to do some additional troubleshooting for network problems. The ping and ping6 commands allow you to send ICMP packets to remote hosts to test basic connectivity. If you suspect issues with hostnames, you can use the host and dig commands to query the DNS server for hostnames.

For more advanced network troubleshooting, you can use the   netstat and ss commands to display what applications are using which network ports on the system.

KEY CONCEPTS AND TERMS

- dig

- ethtool

- Host

- ifconfig

- Internet Control Message Protocol (ICMP)

- ip (command)

- iproute2

- Link local address

- Local loopback interface

- Netstat

- Net-tools

- Network Manager

- nmcli

- nmtui

- ping

- ping6

- ss

- whois

CHAPTER 8 ASSESSMENT

1. Which command displays the duplex settings for an Ethernet card?

1. ethtool

2. netstat

3. iwconfig

4. iwlist

5. route

2. Which command displays what processes are using which ports on a Linux systems?

1. iwconfig

2. ip

3. ping

4. nmtui

5. ss

3. What network setting defines the network device that routes packets intended for hosts on remote networks?

1. default router

2. netmask

3. host name

4. IP address

5. DNS server

4. What device setting defines a host that maps a host name to an IP address?

1. default router

2. netmask

3. host name

4. IP address

5. DNS server

5. What is used to automatically assign an IP address to a client?

1. default router

2. DHCP

3. arp table

4. netmask

5. ifconfig

6. What type of address is used so local applications can use network protocols to communicate with each other?

1. dynamic address

2. loopback address

3. static address

4. host name

5. MAC address

7. Which command would you use to find the mail server for a domain?

1. dig

2. netstat

3. ping6

4. host

5. ss

8. What command would you use to find out what application was using a specific TCP port on the system?

1. ip

2. ss

3. host

4. dig

5. ifconfig

9. What command can you use to both display and set the IP address, netmask, and default router values?

1. ifconfig

2. iwconfig

3. router

4. ifup

5. ip

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

1. netstat

2. ifconfig

3. ping

4. iwconfig

5. ss

Resources

Linux Kernel Project, “Linux Networking Documentation,” Accessed on Dec. 22, 2021, from https://www.kernel.org/doc/html/v5.8/networking/index.xhtml.

Resources

Linux Kernel Project, “Linux Networking Documentation,” Accessed on Dec. 22, 2021, from https://www.kernel.org/doc/html/v5.8/networking/index.xhtml.

© Picsfive/Shutterstock

CHAPTER 9

Managing Processes

LINUX SERVERS HAVE to keep track of lots of different applications running on the system. Your goal as the Linux administrator is to make sure everything runs smoothly and at the correct time! This chapter shows just how Linux keeps track of all the active programs and how you can manage that information.

CHAPTER 9 TOPICS

This chapter covers the following topics and concepts:

- What Linux processes are

- How to manage processes on the system

- How to run programs in background mode from the command line

- Using Linux command-line utilities to stop, restart, or delete jobs

- Using Linux command-line utilities to schedule jobs to run at a later time, or on a recurring schedule

CHAPTER 9 GOALS

When you complete this chapter, you will be able to:

- Describe how Linux manages programs running on the system

- List the different ways to view programs running on the system

- Use command-line utilities to manage processes

- Control jobs using command-line utilities

- Schedule jobs to run in the future or on a recurrent basis using command-line utilities

Looking at Processes

At any given time lots of active programs are running on the Linux system. Linux calls each running program a process. A process can run in the foreground, displaying output on a console display or graphical desktop window, or it can run in background, working on data behind the scenes. The Linux system assigns each process a process id (or PID) and manages how the process uses memory and CPU time based on that PID.

When a Linux system first boots, it starts a special process called the init process. The init process is the core of the Linux system; it runs scripts that start all of the other processes running on the system, including the processes that start any text consoles or graphical windows you use to log in.

You can watch just which processes are currently running on your Linux system by using the ps command. The default output of the ps command looks like this:

Description

By default the ps command only shows the processes that are running in the current user shell. In this example, I only had the command prompt shell running (bash), and of course, the ps command itself.

The basic output of the ps command shows the PID assigned to each process, the terminal (TTY) that they were started from, and the CPU time that the process has used.

The tricky feature of the ps command (and what makes it so complicated) is that at one time there were two versions of it in Linux. Each version had its own set of command-line parameters controlling the information it displayed. That made switching between systems somewhat complicated.

The GNU developers decided to merge the two versions into a single ps program and, of course, added some additional parameters of their own. Thus, the current ps program used in Linux supports three different styles of command-line parameters:

- Unix style parameters, which are preceded by a dash

- BSD style parameters, which are not preceded by a dash

- GNU long parameters, which are preceded by a double dash

This makes for lots of possible parameters and options to use with the ps command. You can consult the ps manual page to see all of the possible parameters that are available. Most Linux administrators have their own set of commonly used parameters that they remember for extracting pertinent information. For example, if you need to see every process running on the system, use the Unix-style -ef parameter combination, like this:

Description

This format provides some useful information about the processes running:

- UID—The user responsible for running the process

- PID—The process ID of the process

- PPID—The process ID of the parent process (if the process was started by another process)

- C—The processor utilization over the lifetime of the process

- STIME—The system time when the process was started

- TTY—The terminal device from which the process was started

- TIME—The cumulative CPU time required to run the process

- CMD—The name of the program that was started in the process

Also notice in the -ef output that some process command names are shown in brackets. By default the ps output will show the complete command line used to start the program, including any command-line parameters. If it can’t determine the command-line parameters, it places brackets around the main program name.

Processes that are swapped into virtual memory are called sleeping. Often the Linux kernel places a process into sleep mode while the process is waiting for an event. When the event triggers, the kernel sends the process a signal. If the process is in interruptible sleep mode, it will receive the signal immediately and wake up. If the process is in uninterruptible sleep mode, it only wakes up based on an external event, such as hardware becoming available. It will accumulate any other signals sent while it was sleeping and act on them once it wakes up.

NOTE

If a process has ended, but its parent process hasn’t acknowledged the termination signal because it’s sleeping, the process is considered a zombie. It’s stuck in a limbo state between running and terminating until the parent process acknowledges the termination signal.

Monitoring Processes in Real Time

The ps command is a great way to get a snapshot of the processes running on the system, but sometimes you need to see more information to get an idea of just what’s going on in your Linux system. If you’re trying to find trends about processes that are frequently swapped in and out of memory, it’s hard to do that with the ps command.

Instead, the top command can solve this problem. The top command displays process information similar to the ps command, but it does it in real-time mode. FIGURE 9-1 shows a snapshot of the top command in action.

FIGURE 9-1 The output of the top command.Courtesy of Linux Foundation.

Courtesy of Linux Foundation.

Description

The first section of the top output shows general system information. The first line shows the current time, how long the system has been up, the number of users logged in, and the load average on the system.

The load average appears as three numbers: the 1-minute, 5-minute, and 15-minute load averages. The higher the values, the more load the system is experiencing. It’s not uncommon for the 1-minute load value to be high for short bursts of activity. If the 15-minute load value is high, your system may be in trouble.

The second line shows general process information (called tasks in top): how many processes are running, sleeping, stopped, or in a zombie state.

The next line shows general CPU information. The top display breaks down the CPU utilization into several categories depending on the owner of the process (user versus system processes) and the state of the processes (running, idle, or waiting).

Following that are two lines that detail the status of the system memory. The first line shows the status of the physical memory in the system, how much total memory there is, how much is currently being used, and how much is free. The second memory line shows the status of the swap memory area in the system (if any is installed), with the same information.

Finally, the next section shows a detailed list of the currently running processes, with some information columns that should look familiar from the ps command output:

- PID—The process ID of the process

- USER—The user name of the owner of the process

- PR—The priority of the process

- NI—The nice value of the process

- VIRT—The total amount of virtual memory used by the process

- RES—The amount of physical memory the process is using

- SHR—The amount of memory the process is sharing with other processes

- S—The process status (D = interruptible sleep, R = running, S = sleeping, T = traced or stopped, or Z = zombie)

- %CPU—The share of CPU time that the process is using

- %MEM—The share of available physical memory the process is using

- TIME+—The total CPU time the process has used since starting

- COMMAND—The command line name of the process (program started)

By default, when you start top, it sorts the processes based on the %CPU value. You can change the sort order by using one of several interactive commands while top is running. Each interactive command is a single character you can press while top is running and changes the behavior of the program. These commands are shown in TABLE 9-1.

TABLE 9-1    The top interactive commands.

Command

Description

1

Toggle the single CPU and Symmetric Multiprocessor (SMP) state.

b

Toggle the bolding of important numbers in the tables.

I

Toggle Irix/Solaris mode.

z

Configure color for the table.

l

Toggle the displaying of the load average information line.

t

Toggle the displaying of the CPU information line.

m

Toggle the displaying of the MEM and SWAP information lines.

f

Add or remove different information columns.

o

Change the display order of information columns.

F or O

Select a field on which to sort the processes (%CPU by default).

< or >

Move the sort field one column left (<) or right (>).

r

Toggle the normal or reverse sort order.

h

Toggle the showing of threads.

c

Toggle the showing of the command name or the full command line (including parameters) of processes.

i

Toggle the showing of idle processes.

S

Toggle the showing of the cumulative CPU time or relative CPU time.

x

Toggle highlighting of the sort field.

y

Toggle highlighting of running tasks.

z

Toggle color and mono mode.

u

Show processes for a specific user.

n or #

Set the number of processes to display.

k

Kill a specific process (only if process owner or if root user).

r

Change the priority (renice) of a specific process (only if process owner or if root user).

d or s

Change the update interval (default three seconds).

W

Write current settings to a configuration file.

q

Exit the top command.

You have lots of control over the output of the top command. Use the F or O command to toggle which field the sort order is based on. You can also use the r interactive command to reverse the current sorting. Using this tool, you can often find offending processes that have taken over your system.

Managing Processes

One of the jobs of a Linux system administrator is to be on the watch for runaway processes that can take down the Linux system. You’ve already seen how to use the ps and top commands (or the System Monitor graphical tool) to monitor how processes are doing on the system, the next step is to see how to stop a runaway process.

Setting Priorities

By default, all processes running on the Linux system are created equal, that is, they all have the same priority to obtain CPU time and memory resources. However, you may run some applications that either don’t need to have the same level of priority or that may need a higher level of priority.

The nice and renice commands allow you to set and change the priority level assigned to an application process. The nice command allows you to start an application with a non-default priority setting. The format looks like this:

The value parameter is a numeric value from –20 to 19. The lower the number, the higher priority the process receives. The default priority is zero. The command parameter specifies the program to start at the specified priority.

To change the priority of a process that’s already running, use the renice command:

The renice command allows you to change the priority of multiple processes based on a list of PID values, all of the processes started by one or more users, or all of the processes started by one or more groups. Only the root user account can set a priority value less than 0 or decrease the priority value (increase the priority) of a running process.

Stopping Processes

Sometimes a process gets hung up and just needs a gentle nudge to either get going again or stop. Other times, a process runs away with the CPU and refuses to give it up. In both cases, you need a command that will allow you to control a process. To do that, Linux follows the Unix method of inter-process communication.

In Linux, processes communicate with each other using process signals. A process signal is a predefined message that processes recognize and may choose to ignore or act on. The developers program how a process handles signals. Most well-written applications have the ability to receive and act on the standard Unix process signals. These signals are shown in TABLE 9-2.

TABLE 9-2    Linux process signals.

Number

Name

Description

1

HUP

Hang up.

2

INT

Interrupt.

3

QUIT

Stop running.

9

KILL

Unconditionally terminate.

11

SEGV

Segment violation.

15

TERM

Terminate if possible.

17

STOP

Stop unconditionally, but don’t terminate.

18

TSTP

Stop or pause, but continue to run in background.

19

CONT

Resume execution after STOP or TSTP.

While a process can send a signal to another process, two commands are available in Linux that allow you to send process signals to running processes.

The kill Command

The kill command allows you to send signals to processes based on their process ID (PID). By default, the kill command sends a TERM signal to all the PIDs listed on the command line. Unfortunately, you can only use the process PID instead of its command name, making the kill command difficult to use sometimes.

To send a process signal, you must either be the owner of the process or be logged in as the root user.

The TERM signal only asks the process to kindly stop running. Unfortunately, if you have a runaway process, most likely it will ignore the request. When you need to get forceful, the ‐s parameter allows you to specify other signals (either using their name or signal number).

The generally accepted procedure is to first try the TERM signal. If the process ignores that, try the INT or HUP signals. If the program recognizes these signals, it will try to gracefully stop doing what it was doing before shutting down. The most forceful signal is the KILL signal. When a process receives this signal, it immediately stops running. Use this as a last resort, as it can lead to corrupt files.

One of the scary things about the kill command is that there’s no output from it:

To see if the command was effective, you’ll have to perform another ps or top command to see if the offending process stopped.

NOTE

The   kill command has a few different formats to choose from. You don’t need the -s parameter, you can just use -HUP (kill -HUP 3940). Also, you can specify the signal by number instead of name (kill -9 3940).

WARNING

Be careful of killing processes that may have open files. Files can be damaged and unrepairable if the process is abruptly stopped. It’s usually a good idea to run the   lsof command first to see a list of the open files and their processes before issuing a KILL signal to a process.

The pkill Command

The pkill command is a powerful way to stop processes by using their names rather than the PID numbers. The pkill command allows you to use wildcard characters as well, making it a very useful tool when you’ve got a system that’s gone awry:

This example will kill all of the processes that start with http, such as the httpd services for the Apache web server. Be careful with the search capability of the pkill command. It’s usually a good idea to check the search term against the currently running processes to make sure you don’t accidentally kill any other processes that match the search. The pgrep command allows you to display all processes that match the search term.

NOTE

If you start a program or shell script from the command line, you have two key combinations available to control the program process. Hitting the Ctrl+Z key combination sends a TSTP signal to the process, pausing it. This will take you to a command prompt but keep the program paused in background. The next section discusses how to manage programs paused in background mode. Hitting the Ctrl+C key combination sends an INT signal, killing the process and returning you to the command prompt.

Running Programs in Background Mode

There are times when running a program directly from the command-line interface is inconvenient. Some programs can take a long time to process, and you may not want to tie up the command-line interface waiting. While the program is running, you can’t do anything else in your terminal session. Fortunately, there’s a simple solution to that problem.

When you use the ps command, you see a whole bunch of different processes running on the Linux system. Obviously, all of these processes are not running on your terminal monitor. This is called running processes in the background. In background mode, a process runs without being associated with a terminal session.

You can exploit this feature with your programs as well, allowing them to run behind the scenes and not lock up your terminal session. The following sections describe how to run programs in background mode on your Linux system.

Running in the Background

Running a program or script in background mode is a fairly easy thing to do. To run something in background mode from the command-line interface, just place an ampersand symbol after the command:

Description

When you place the ampersand symbol after a command, it separates the command from the Bash shell and runs it as a separate background process on the system. The first thing that displays is the line:

The number in the square brackets is the job number assigned to the background process by the shell. The next number is the PID assigned to the process.

As soon as the system displays these items, a new command-line interface prompt appears. You are returned back to the shell, and the command you executed runs safely in background mode.

At this point, you can enter new commands at the prompt (as shown in the example). However, while the background process is still running, it still uses your terminal monitor for messages. You’ll notice from the example that the output from the test1.sh script appears in the output intermixed with any other commands that are run from the shell.

When the background process finishes, it displays a message on the terminal:

This shows the job number and the status of the job (Done), along with the command used to start the job.

Running Multiple Background Jobs

You can start any number of background jobs at the same time from the command-line prompt:

Description

Each time you start a new job, the Linux system assigns it a new job number and PID. You can see that all of the scripts are running using the ps command:

Description

Description

Each of the background processes you start appears in the ps command output listing of running processes. If all of the processes display output in your terminal session, things can get pretty messy pretty quickly. The next section walks through a solution.

Running Programs Without a Console

There will be times when you want to start a shell script from a terminal session and then let the script run in background mode until it finishes, even if you exit the terminal session. You can do this by using the nohup command.

The nohup command runs another command blocking any SIGHUP signals that are sent to the process. This prevents the process from exiting when you exit your terminal session.

The format used for the nohup command is as follows:

Description

As with a normal background process, the shell assigns the command a job number, and the Linux system assigns a PID number. The difference is that when you use the nohup command, the script ignores any SIGHUP signals sent by the terminal session if you close the session.

Because the nohup command disassociates the process from the terminal, the process loses the output links to the terminal. To accommodate any output generated by the command, the nohup command automatically redirects any output messages to a file, called nohup.out.

The nohup.out file contains all of the output that would normally be sent to the terminal monitor. After the process finishes running, you can view the nohup.out file for the output results:

Description

Description

The output appears in the nohup.out file just as if the process ran on the command line! Be careful though; if you run multiple programs using nohup, they all send their output to the same nohup.out file.

Job Control

The function of starting, stopping, killing, and resuming jobs is called job control. With job control, you have full control over how processes run in your shell environment. This section describes the commands to use to view and control jobs running in your shell.

Viewing Jobs

The key command for job control is the jobs command. The jobs command allows you to view the current jobs being handled by the shell:

Description

Description

The script uses the $$ variable to display the PID that the Linux system assigns to the script; then it goes into a loop, sleeping for 10 seconds at a time for each iteration. In the example, the first script is started from the command-line interface and then paused using the Ctrl+Z key combination. Next, another job is started as a background process, using the ampersand symbol. To make life a little easier, the output of that script is redirected to a file so that it doesn’t appear on the screen.

After the two jobs were started, use the jobs command to view the jobs assigned to the shell. The jobs command shows both the stopped and the running jobs, along with their job numbers and the commands used in the jobs.

The jobs command uses a few different command line parameters, as shown in TABLE 9-3.

TABLE 9-3    The jobs command parameters.

Parameter

Description

-l

List the PID of the process along with the job number.

-n

List only jobs that have changed their status since the last notification from the shell.

-p

List only the PIDs of the jobs.

-r

List only the running jobs.

-s

List only stopped jobs.

You probably noticed the plus and minus signs in the jobs command output. The job with the plus sign is considered the default job. It would be the job referenced by any job control commands if a job number isn’t specified in the command line. The job with the minus sign is the job that would become the default job when the current default job finishes processing. There will only be one job with the plus sign and one job with the minus sign at any time, no matter how many jobs are running in the shell.

The following is an example showing how the next job in line takes over the default status, when the default job is removed:

Description

Description

In this example, three separate scripts were started and then stopped. The jobs command listing shows the three processes and their status. Note that the default process (the one listed with the plus sign) is the last process started.

Then the kill command was issued to send a SIGHUP signal to the default process. In the next jobs listing, the job that previously had the minus sign is now the default job.

Restarting Stopped Jobs

You can restart any stopped job as either a background process or a foreground process. A foreground process takes over control of the terminal you’re working on, so be careful about using that feature.

To restart a job in background mode, use the bg command, along with the job number:

Description

Description

Because the job was restarted in background mode, the command-line interface prompt appears, allowing other commands to be entered. The output from the jobs command now shows that the job is indeed running (as you can tell from the output now appearing on the monitor).

To restart a job in foreground mode, use the fg command, along with the job number:

Description

Since the job is running in foreground mode, the command-line interface prompt does not appear until the job finishes.

Scheduling Jobs

There will be situations in which you will want to run a program or script at a preset time, usually at a time when you’re not there. The Linux system provides a couple of ways to run a script at a preselected time: the at command and the cron table. Each method uses a different technique for scheduling when and how often to run scripts. The following sections describe each of these methods.

Scheduling a Job Using the at Command

The at command allows you to specify a time when the Linux system will run a script. The at command submits a job to a queue with directions on when the shell should run the job. The at daemon, atd, runs in the background and checks the job queue for jobs to run. Most Linux distributions start this daemon automatically at boot time.

The atd daemon checks a special directory on the system (usually /var/spool/at) for jobs submitted using the at command. By default, the atd daemon checks this directory every 60 seconds. When a job is present, the atd daemon checks the time the job is set to be run. If the time matches the current time, the atd daemon runs the job.

The following sections describe how to use the at command to submit jobs to run and how to manage jobs.

The at Command Format

The basic at command format is pretty simple:

By default, the at command submits input from the terminal to the queue. You can specify a file name used to read commands from using the -f parameter.

The time parameter specifies when you want the Linux system to run the job. You can get pretty creative with how you specify the time. The at command recognizes lots of different time formats:

- A standard hour and minute, such as 10:15

- An ~AM/~PM indicator, such as 10:15~PM

- A specific named time, such as now, noon, midnight, or teatime (4~PM)

If you specify a time that has already past, the at command runs the job at that time on the next day.

In addition to specifying the time to run the job, you can also include a specific date, using a few different date formats:

- A standard date format, such as MMDDYY, MM/DD/YY, or DD.MM.YY

- A text date, such as Jul 4 or Dec 25, with or without the year

- You can also specify a time increment:

- Now + 25 minutes

- 10:15~PM tomorrow

- 10:15 + 7 days

When you use the at command, the job is submitted into a job queue. The job queue holds the jobs submitted by the at command for processing. There are 26 different job queues available for different priority levels. Job queues are referenced using lowercase letters, a through z.

The higher alphabetically the job queue, the lower the priority (higher nice value) the job will run under. By default, at jobs are submitted to the a job queue. If you want to run a job at a higher priority, you can specify a different queue letter using the -q parameter.

Retrieving Job Output

When the job runs on the Linux system, there’s no monitor associated with the job. Instead, the Linux system uses the email address of the user who submitted the job for any output messages. Any output destined to the terminal is mailed to the user via the mail system.

Here’s a simple example of using the at command to schedule a job to run:

Description

Description

The at command produces a warning message, indicating what shell the system uses to run the script, /bin/sh, along with the job number assigned to the job and the time the job is scheduled to run.

When the job completes, nothing appears on the monitor, but the system generates an email message. The email message shows the output generated by the script. If the script doesn’t produce any output, it won’t generate an email message, by default. You can change that by using the -m option in the at command. This generates an email message, indicating the job completed, even if the script doesn’t generate any output.

Listing Pending Jobs

The atq command allows you to view what jobs are pending on the system:

Description

Description

The job listing shows the job number, the date and time the system will run the job, and the job queue the job is stored in.

Removing Jobs

Once you know the information about what jobs are pending in the job queues, you can use the atrm command to remove a pending job:

Description

Just specify the job number you want to remove. You can only remove jobs that you submit for execution. You can’t remove jobs submitted by others.

Scheduling Recurring Programs

Using the at command to schedule a program or script to run at a preset time is great, but what if you need it to run at the same time every day, or once a week, or once a month? Instead of having to continually submit at jobs, you can use another feature of the Linux system.

The Linux system uses the cron program to allow you to schedule jobs that need to run on a regular basis. The cron program runs in the background and checks special tables, called cron tables, for jobs that are scheduled to run.

NOTE

Systems that support the Systemd initialization method have another option for scheduling recurring programs called Timers. However, most Linux systems still support the   cron method shown here.

The cron Table

Each individual user account has a separate cron table for scheduling programs. The user cron table uses a special format for allowing you to specify when a job should be run. The format for the cron table is:

The cron table allows you to specify entries as specific values, ranges of values (such as 1–5) or as a wildcard character (the asterisk). For example, if you want to run a command at 10:15 on every day, you would use the cron table entry of:

The wildcard character used in the dayofmonth, month, and dayofweek fields indicates that cron will execute the command every day of every month at 10:15. To specify a command to run at 4:15 PM every Monday, you would use the following:

You can specify the dayofweek entry as either a three-character text value (mon, tue, wed, thu, fri, sat, sun) or as a numeric value, with 0 being Sunday and 6 being Saturday.

Here’s another example: to execute a command at 12 noon on the first day of every month, you would use the following format:

The dayofmonth entry specifies a date value (1–31) for the month.

The command list must specify the full pathname of the command to run. You can add any command line parameters or redirection symbols you like, as a regular command line:

The cron program runs the script using the user account that submitted the job. Thus, you must have the proper permissions to access the command and output files specified in the command listing.

NOTE

Besides the individual user cron tables, the system has a cron table file located at   /etc/crontab. The administrator can schedule jobs in this file using the same format; however, the userid for the job must be included as the first parameter after the day and time values.

Building the cron Table

Each system user can have their own cron table (including the root user) for running scheduled jobs. Linux provides the crontab command for handling the cron table. To list an existing cron table, use the -l parameter:

By default, each user’s cron table file doesn’t exist. To add entries to your cron table, use the -e parameter. When you do that, the crontab command starts a text editor with the existing cron table (or an empty file if it doesn’t yet exist).

cron Directories

When you create a script that has less precise execution time needs, it is easier to use one of the preconfigured cron script directories. There are four basic directories: hourly, daily, monthly, and weekly.

Description

Thus, if you have a script that needs to be run one time per day, just copy the script to the daily directory and cron executes it each day.

CHAPTER SUMMARY

You can view the running applications and the resources they consume by using the ps command. There are many different ways to view process information using the ps command, allowing you to customize the display exactly how you like. For real-time monitoring of applications, use the top command. With the top command you can view a real-time display of applications, their system state, and the resources they consume, plus it allows you to sort the display based on many different features.

The nice command allows you to start an application at a different priority level than the applications that are already running. This allows users to run applications in background at a lower priority, or allow the system administrator to start applications with a higher priority. With the renice command you can change the priority of an application that’s already running. If an application causes problems and needs to be stopped, you can use the kill command, but you need to know the process ID assigned to the application by the system. The pkill command is customized for stopping applications by their name instead of process ID.

Linux provides a couple of different ways for you to schedule programs to start at a future time or even date. The   at command lets you schedule in individual program to run at a specific time/date. If you need to schedule a program to start on a regular schedule, use the crontab command to add the program to the system cron table. You must specify the schedule format to tell Linux when to start the program.

KEY CONCEPTS AND TERMS

- atq

- atrm

- bg

- cron

- fg

- jobs

- kill

- pkill

- nice

- nohup

- process

- ps

- renice

- top

CHAPTER 9 ASSESSMENT

1. What command should you use to run a large number-crunching application in background mode on a console session?

1. >

2. &

3. |

4. >>

5. nohup

2. What command do you use to disconnect a shell script from the current console so that it can continue to run after the console exits?

1. >

2. &

3. |

4. >>

5. nohup

3. When you run a shell script you notice that it takes up all of the memory on your Linux system and need to stop it, how can you do that from the same console?

1. Start it with the nohup command.

2. Start it with the ampersand (&) command.

3. Press Ctrl+C while the script is running.

4. Redirect the output using the pipe symbol.

5. Use the kill command to stop it.

4. How can you temporarily pause a shell script from running in foreground mode in a console session?

1. Press the Ctrl+Z key combination.

2. Press the Ctrl+C key combination.

3. Start the command with the nohup command.

4. Start the command with the ampersand (&) command.

5. Start the command with the fg command.

5. How do you determine the default job running in a console session?

1. By the PID number

2. By the job number

3. By a plus sign next to the job number in the jobs output

4. By a minus sign next to the job number in the jobs output

5. Using the ps command

6. If you have an application running in background mode in a console session and need to bring it to foreground mode, what command should you use to do that?

1. bg

2. fg

3. nohup

4. &

5. at

7. What command allows you to run a shell script at a specific time?

1. nohup

2. &

3. at

4. |

5. >

8. You’ve been asked to run a report at midnight every day on your Linux system. How should you do that?

1. Use the at command to schedule the job.

2. Run the job using the nohup command.

3. Run the job using the ampersand (&) symbol.

4. Schedule the job using cron.

5. Run the job using the atq command.

9. When will the cron table entry 10 5 * * * myscript run the specified shell script?

1. At 10:05 a.m. every day

2. On May 10 every year

3. On October 5 every year

4. At 5:10 p.m. every day

5. At 5:10 a.m. every day

10. What command should you use to list the cron table entries for your user account?

1. cron

2. at

3. crontab

4. jobs

5. nohup

Resources

Linux Documentation Project, “Chapter 4: Processes,” Accessed on January 4, 2022, from https://tldp.org/LDP/tlk/kernel/processes.xhtml.

Resources

Linux Documentation Project, “Chapter 4: Processes,” Accessed on January 4, 2022, from https://tldp.org/LDP/tlk/kernel/processes.xhtml.

© Picsfive/Shutterstock

CHAPTER 10

Advanced Administration

MANAGING A LINUX SERVER in a multi-user environment can be somewhat different from a personal graphical desktop. There are lots of new things you need to worry about, such as protecting user files, creating shared folder areas, and providing network services such as email and remote login. This chapter discusses some of the advanced administration tools required to manage a Linux server in a multi-user environment.

The chapter starts out by walking through user account management. With multiple users, you’ll need to ensure each user has his or her own user account and can be assured that their files are safe from other users. This chapter also describes how to manage file permissions for shared folder environments in such a way that multiple users can share the same files.

Next, the chapter discusses some of the odds-and-ends of managing a multi-user Linux server and multiple servers. First, methods for managing the date and time on the server, and ensuring multiple servers in an environment are all synchronized with the proper date and time. Following that, the chapter provides information on how to devise a printer strategy in your Linux environment. Printing from the command line is a little different from the graphical desktop world, so you’ll need to be aware of the commands available.

After discussing printers, the chapter walks through how Linux handles email. There are a few different email server packages available in the Linux world, and knowing how each one works will help with your decision on which one to use.

The chapter finishes up with sections on remote connecting to Linux servers using a secure shell and how to manage the system log files generated on the Linux system. Both of these topics are crucial to running a Linux server in a multi-user environment.

CHAPTER 10 TOPICS

This chapter covers the following topics and concepts:

- How to manage Linux user accounts

- Using Linux file and folder permissions

- Setting the date, time, and time zone on a Linux system

- Printer management in Linux

- How to implement email servers and clients

- How to set up a secure login environment

- Using and configuring event logging in Linux

CHAPTER 10 GOALS

When you complete this chapter, you will be able to:

- Create, modify, and delete user and group accounts

- Assign and modify permissions on files and folders

- Synchronize the time on multiple Linux servers

- Add and manage local and network printers

- Create a multi-user email server

- Use secure network sessions to log into Linux remotely

- Customize your Linux system to send event logs to multiple locations

User Management

The Linux operating system was designed to be a multi-user operating system. That means it can support multiple users logged into the system at the same time, all doing different things. The problem with having multiple users though is that you need to keep track of who’s doing what and who’s allowed to do what!

This is where user accounts come into play. Linux uses user accounts to uniquely identify individual users and control their access to the devices, files, and folders on the system. Linux also uses the user accounts as identifiers when logging activity on the system. That way you can track just who deleted that important file! As the system administrator, you can control what all of the Linux users are allowed to do and then monitor what they’re doing from the system log files.

This section discussed the types of user account used in Linux, how to use them, and how to manage them.

Examining User Accounts

There are three types of user accounts available on Linux systems:

- Normal user accounts

- Service accounts (sometimes called pseudo users)

- Administration user accounts

Normal user accounts are assigned to each person who uses the Linux system. By default, normal user accounts don’t have any special privileges on the Linux system. Normal users only have access to run applications and access files and folders contained in their own home folder. Typically, one user account won’t have access to files and folders owned by another user account (although as you’ll see in a bit, you can change to enable groups of users to share files and folders).

Service accounts are used by applications that must run continually in the background, such as email servers, database servers, and web servers. This type of account is often referred to as a pseudo user account because these applications must run continually, require access to files and folders on the system, and it’s not possible to have a normal user account logged in to run the programs.

For security reasons, service accounts can’t log into an interactive desktop or command-line prompt, they can only run in background on the system. It’s common to assign a unique system account to each application, and that account would only have access to the files and folders required for that specific application. In this way the application is isolated so that if one application is compromised by an attacker (such as if someone breaks into the web server application), the attacker can’t get to other parts of the Linux system, only the files related to that application.

Administration user accounts are used by system administrators who need complete control of the system. These accounts have access to all files and folders on the Linux system and can modify permissions on any file and folder. In Linux, the main administration user account is assigned the special name root.

WARNING

You may have noticed that Linux likes to use the word “root” a lot. The root administrator account isn’t related to the root filesystem, or the root folder of the virtual directory (the / directory). However, the home directory for the root user account is named /root.

Since the root user account has full permissions to all files, folders, and devices on the Linux system, you must use the root user account when performing most system-related work, such as adding new devices, partitioning new filesystems, or creating new user accounts.

Because of the complete power that the root user account possesses, logging in as the root user account is a very dangerous thing. A small typo in the wrong place in a command can result in a completely unusable Linux system! Usually, Linux system administrators only log in as the root user account when absolutely necessary. They will use a normal user account to do their normal activities such as checking email and browsing the web.

Accessing Administrator Privileges

Because of the importance of the administration user account, there are three ways for a Linux system administrator to become the root user account:

- Log in as the root user account directly from a login prompt

- Use the su command as a normal user account

- Use the sudo command as a normal user account

In the previous section you learned about the dangers of logging in directly as the root user account. It’s generally not a good idea to log in directly as the root user account unless you absolutely must. In fact, some Linux distributions even prevent you from logging in directly as the root user account.

The su Linux command is a great alternative. It allows us to change the user account that we’re logged in as to any other user account on the system, including the root user account. To switch to another user account, you specify that user name on the su command line. For example, if I’m currently logged in with my user account rich and want to switch to the user account barbara, you’d enter the command:

The su command prompts you for the password for the user account you’re trying to switch to. The dash in the command tells Bash to emulate an actual login, running any login shell scripts created for the user account, including changing the home directory. If you don’t use the dash, you’ll be logged in as the user account but still be accessing your own user account’s shell environment.

When you type the su command by itself, Linux will assume you want to switch to be the root user account. When you enter the su command, the Linux system will prompt you for the root user account’s password, ensuring that you have authorization to act as the root user account.

Knowing the capabilities of the root user account, you may be wondering how you will remember which account you are logged in as. Most Linux systems use the command prompt to indicate your permission level. When you’re logged in as a normal user account, the command prompt is a dollar sign ($); when you use the su command to gain root privileges, the command prompt changes to a pound sign (#), as in this example:

After you enter the password for the root user account, the command prompt changes to the pound sign, indicating that you’re now the root user account. While at the pound sign command prompt, any command you enter has root privileges. When you’ve completed your administrator tasks, just use the exit command to exit the root user account and switch back to your normal user account (and the dollar sign prompt).

The sudo command gives you yet another alternative to logging in as the root user account. Instead of gaining access to the root user account directly to enter multiple commands, the sudo command allows you to run individual commands as the root user account, essentially granting you temporary user of the accounts privileges. Just enter the command you need to run as the parameter of the sudo command:

Description

Notice that the command prompt didn’t change at all. The example began as a normal user account, submitted the sudo command with a system command, then when that command completed, it reverted back to the normal user account dollar sign prompt.

Also notice that the sudo command prompted me for my password, not the password of the root user account. This is not a mistake; it’s a security feature. Only specific user accounts are allowed to use the sudo command. You must validate who you are to be able to use the command. The system will maintain your authentication for a period of time, so any subsequent use of the sudo command within that timespan (which you can configure) won’t require the password.

The /etc/sudoers file lists the user accounts that have privileges to run the sudo command, along with restricting just what commands they can run with root privileges. You must use the visudo program (a special version of the vi editor program) to edit the /etc/sudoers file.

Working with Groups

Often in a multi-user environment you’ll run into a situation where you want multiple user accounts to have access to the same files and folders (such as a sales team working on the same project). In a Linux environment, file permissions set to individual user accounts won’t work when trying to share files.

To solve that problem, Linux supports groups. A group is a collection of user accounts that are treated as a single account for permissions. You can assign file and folder permissions to a group, granting all of the user accounts in that group access to the shared files and folders.

Linux stores information about the group accounts in the /etc/groups file. Each group is defined on a separate line in the file, which includes the group name, a unique group ID value, and the list of user accounts that are members of the group. To add a new group, use the groupadd command.

By default, when you create a new user account in Linux, the system assigns that user to a default user group. Most Linux distributions create separate user groups for each user account, that way you can’t unintentionally create shared files or folders

Managing User Accounts

You’ll use five basic commands to manage user accounts in Linux:

- useradd—Create a new user account

- userdel—Delete an existing user account

- usermod—Modify the settings of an existing user account

- passwd—Change the password of an existing user account

- chage—Change the password aging properties of an existing user account

The useradd command has lots of parameters that you can use to customize just how Linux creates the new user account. These are shown in TABLE 10-1.

TABLE 10-1    The useradd command parameters.

Parameter

Description

-c comment

The user account comment field value

-d home

The location of the user’s Home folder (the default is /home/username)

-e date

The date the account will expire automatically

-g group

The default group for the user account

-m

Create a Home folder and copy the contents of the /etc/skel folder into it

-s shell

The shell for the user account

-u UID

Use a specific UID value instead of allowing Linux to assign one

For example, to create a new user account named test1, and give it a home folder for the account, use this command:

After you create the user account, use the passwd command to assign a default password for the account:

Description

Now you can log into either the command line or the desktop environment using the test1 user account and password you just created!

You can use the usermod command to change any of these settings for an existing user account. For example, to change the comment field for the user account, just use:

When you want to remove a user account, just use the userdel command:

WARNING

If a user owns files on the system, you must decide whether or not to keep the files after you delete the user account. Use the   –r option to remove the user account’s home folder when you delete the user account. If you choose to keep the files, they become what are called orphan files—files owned by an invalid user account on the system. Orphan files may be inaccessible by other users.

Linux File and Directory Permissions

The core security feature of Linux is file and directory permissions. Linux accomplishes that by assigning each file and directory an owner and allowing that owner to set the basic security settings to control access to the file or directory. The following sections walk through how Linux handles ownership of files and directories as well as the basic permissions settings that you can assign to any file or directory on your Linux system.

Understanding Ownership

Linux uses a three-tiered approach to protecting files and directories:

- Owner—Within the Linux system, each file and directory is assigned to a single owner. The Linux system administrator can assign the owner specific privileges to the file or directory.

- Group—The Linux system also assigns each file and directory to a single group of users. The administrator can then assign that group privileges that are specific to the file or directory and that differ from the owner privileges.

- Others—This category of permissions is assigned to any user account that is not the owner nor in the assigned user group.

You can view the assigned owner and group for a file or directory by adding the -l option to the ls command, as shown in   LISTING 10-1  .

LISTING 10-1 Displaying file ownership.

Description

The first column, -rw-rw-r--, defines the access permissions assigned to the owner, group, and others. That will be discussed later in the chapter in the section “Controlling Access Permissions.” The third column, the rich or barbara value, shows the user account assigned as the owner of the file. The fourth column, sales, shows the group assigned to the file.

When a user creates a file or directory, by default the Linux system automatically assigns that user as the owner and uses the primary group the user belongs to as the group for the file or directory. You can change the default owner and group assigned to files and directories using Linux commands. The following sections show how to do that.

WARNING

Many Linux distributions (such as both Ubuntu and Rocky Linux) assign each user account to a separate group with the same name as the user account. This helps prevent accidental sharing of files. However, this can also make things a little confusing when you’re working with owner and group permissions and you see the same name appear in both columns. Be careful when working in this type of environment.

Changing File or Directory Ownership

The root user account can change the owner assigned to a file or directory by using the chown command. The chown command format looks like this:

The newowner parameter is the user name of the new owner to assign to the file or directory, and filenames is the name of the file or directory to change. You can specify more than one file or directory by placing a space between each file or directory name:

Description

There are a few command-line options available for the chown command, but they are mostly obscure and not used much. One that may be helpful for you is the -R option, which recursively changes the owner of all files and directories under the specified directory.

Changing the File or Directory Group

The file or directory owner, or the root user account, can change the group assigned to the file or directory by using the chgrp command. The chgrp command uses this format:

The newgroup parameter is the name of the new user group assigned to the file or directory, and the filenames parameter is the name of the file or directory to change. If you’re the owner of the file, you can only change the group to a group that you belong to. The root user account can change the group to any group on the system:

Description

The chown command allows you to change both the owner and group assigned to a file or directory at the same time using this format:

This is often preferred over using the separate chgrp command.

Controlling Access Permissions

After you’ve established the file or directory owner and group, you can assign specific permissions to each. Linux uses three types of permission controls:

- Read—The ability to access the data stored within the file or directory

- Write—The ability to modify the data stored within the file or directory

- Execute—The ability to run the file on the system, or the ability to list the files contained in the directory

You can assign each tier of protection (owner, group, and other) different read, write, and execute permissions. This creates a set of nine different permissions that are assigned to each file and directory on the Linux system. The nine permissions appear in the ls output as the first column of information when you use the -l option as shown in   LISTING 10-1  . FIGURE 10-1 shows the order in which the permissions are displayed in the ls output.

FIGURE 10-1 File and directory permissions as displayed in the ls output.

Description

In Figure 10-1, the first character denotes the object type. A dash indicates a file, while a d indicates a directory.

The next three characters denote the owner permissions in the order of read, write, and execute. A dash indicates the permission is not set, while the r, w, or x indicate the read, write, or execute permission is set. In the example in   LISTING 10-1  , all three files use rw- for the owner permissions, which means the owner has permission to read and write to the file but cannot execute, or run, the file. This is common with data files.

The second set of three characters denotes the group permissions for the file or directory. Again, this uses the read, write, and execute order, with a dash indicating the permission is not set. After making the change to the customers.txt file for the marketing group, the sales group can only write to the research.txt and salesdata.txt files, and the marketing group can only write to the customers.txt file.

Finally, the third set of three characters denotes the permissions assigned to user accounts that are not the owner or a member of the group assigned to the file or directory. The same order of read, write, and execute is used. In the   Listing 10-1   examples, other user accounts on the system can read the files but not write or execute them.

Either the root user account or the owner of the file or directory can change the assigned permissions by using the chmod command.

The format of the chmod command can be somewhat confusing. It uses two different modes for denoting the read, write, and execute permission settings for the owner, group, and other. Both modes allow you to define the same sets of permissions, so there’s no reason to use one mode over the other.

In symbolic mode, you denote permissions by using a letter code for the owner (u), group (g), others (o), or all (a) and another letter code for the read (r), write (w), or execute (x) permission. The two codes are separated with a plus sign (+) if you want to add the permission, a minus sign (-) to remove the permission, or an equal sign (=) to set the permission as the only permission.   LISTING 10-2   shows an example of this.

LISTING 10-2 Changing the file permissions owner.

Description

In   Listing 10-2  , the g-w code in the chmod command indicates to remove the write permission for the group from the customers.txt file. Now members of the marketing group can only read the file.

You can combine letter codes for both to make multiple changes in a single chmod command, as shown in   LISTING 10-3  .

LISTING 10-3 Combining permission changes.

Description

The ug code assigns the change to both the owner and the group, while the rwx code assigns the read, write, and execute permissions. The equal sign indicates to set those permissions.

The second mode available in chmod is called octal mode. With octal mode, the nine permission bits are represented as three octal numbers, one each for the owner, group, and other permissions. TABLE 10-2 shows how the octal number matches the three symbolic mode permissions.

TABLE 10-2    Octal mode permissions.

Octal Value

Permission

Meaning

0

---

No permissions

1

--x

Execute only

2

-w-

Write only

3

-wx

Write and execute

4

r--

Read only

5

r-x

Read and execute

6

rw-

Read and write

7

rwx

Read, write, and execute

You must specify the three octal values in the owner, group, and other in the correct order, as shown in   LISTING 10-4  .

LISTING 10-4 Using octal mode to assign permissions.

Description

The 664 octal mode set the owner and group permissions to read and write (6) but the others permission to read only (4). You can see the results from the ls output. This is a handy way to set all of the permissions for a file or directory in a single command.

Exploring Special Permissions

Linux uses three special permission bits for controlling the advanced behavior of files and directories.

The Set User ID (SUID) bit is used with executable files. It tells the Linux kernel to run the program with the permissions of the file owner and not the user account actually running the file. This feature is most commonly used in server applications that must run as the root user account to have access to all files on the system, even if the user launching the process is a standard user.

The SUID bit is indicated by an s in place of the execute permission letter for the file owner: rwsr-xr-x. The execute permission is assumed for the system to run the file. If the SUID bit is set on a file that doesn’t have execute permission for the owner, it’s indicated by an uppercase S.

To set the SUID bit for a file, in symbolic mode add s to the owner permissions, or in octal mode include a 4 at the start of the octal mode setting:

The Set Group ID (SGID, also called GUID) bit works differently in files and directories. For files, it tells Linux to run the program file with the file’s group permissions. It’s indicated by an s in the group execute position: rwxrwsr--.

For directories, the SGID bit helps us create an environment where multiple users can share files. When a directory has the SGID bit set, any files users create in the directory are assigned the group of the directory and not that of the user. That way all users in that group can have the same permissions as all of the files in the shared directory.

To set the SGID bit, in symbolic mode add s to the group permissions, or in octal mode include a 2 at the start of the octal mode setting:

Finally, the sticky bit is used to protect a file from being deleted by those who don’t own it, even if they belong to the group that has write permissions to the file. The sticky bit is denoted by a t in the execute bit position for others: rwxrw-r-t.

The sticky bit is often used on directories shared by groups. The group members have read and write access to the data files contained in the directory, but only the file owners can remove files from the shared directory.

To set the sticky bit, in symbolic mode add t to the owner permissions, or in octal mode include a 1 at the start of the octal mode setting:

Managing Default Permissions

When a user creates a new file or directory, the Linux system assigns it a default owner, group, and permissions. The default owner, as expected, is the user who created the file. The default group is the owner’s primary group.

The user mask feature defines the default permissions Linux assigns to the file or directory. The user mask is an octal value that represents the bits to be removed from the octal mode 666 permissions for files or the octal mode 777 permissions for directories.

The user mask value is set with the umask command. You can view your current umask setting by simply entering the command by itself on the command line:

The output of the umask command shows four octal values. The first octal value represents the mask for the SUID (4), GUID (2), and sticky (1) bits assigned to files and directories you create. The next three octal values mask the owner, group, and other permission settings.

The mask is a bitwise mask applied to the permission bits on the file or directory. Any bit that’s set in the mask is removed from the permissions for the file or directory. If a bit isn’t set, the mask doesn’t change the setting. TABLE 10-3 demonstrates how the umask values work in practice when creating files and directories on your Linux system.

TABLE 10-3    Results from common umask values for files and directories.

Umask

Created Files

Created Directories

000

666 (rw-rw-rw-)

777 (rwxrwxrwx)

002

664 (rw-rw-r--)

775 (rwxrwxr-x)

022

644 (rw-r--r--)

755 (rwxr-xr-x)

027

640 (rw-r-----)

750 (rwxr-x---)

077

600 (rw-------)

700 (rwx------)

277

400 (r--------)

500 (r-x------)

You can test this by creating a new file and directory on your Linux system:

Description

The umask value of 0022 created the default file permissions of rw-r--r-- , or octal 644, on the test2 file, and rwx-r-xr-x, or octal 755, on the test1 directory, as expected (note that the directory entry starts with a d in the permissions list).

You can change the default umask setting for your current shell session by using the umask command from the command line:

Description

NOTE

The   umask value is normally set in a script that the Linux system runs at login time, such as in the /etc/profile file. If you override the setting from the command line, that will only apply for the duration of your session. You can override the system default umask setting by adding it to the .bash_profile file in your $HOME directory.

The default permissions for the new file have changed to match the umask setting.

Advanced Access Control Lists

The basic Linux method of permissions has one drawback in that it’s somewhat limited. You can only assign permissions for a file or directory to a single group or user account. In a complex business environment with different groups of people needing different permissions to files and directories, that doesn’t work.

Linux developers have devised a more advanced method of file and directory security called an access control list (ACL). The ACL allows you to specify a list of multiple users or groups and the permissions that are assigned to them. Just like the basic security method, ACL permissions use the same read, write, and execute permission bits, but now they can be assigned to multiple users and groups.

To use the ACL feature in Linux, you use the setfacl and getfacl commands. The getfacl command allows you to view the ACLs assigned to a file or directory, as shown in   LISTING 10-5  .

LISTING 10-5 Viewing ACLs for a file.

Description

If you’ve only assigned basic security permissions to the file, those still appear in the getfacl output, as shown in   Listing 10-5  .

To assign permissions for additional users or groups, you use the setfacl command:

The setfacl command allows you to modify the permissions assigned to a file or directory using the -m option or remove specific permissions using the -x option. You define the rule with three formats:

To assign permissions for additional user accounts, use the user format; for additional groups, use the group format; and for others, use the other format. For the uid or gid values, you can use either the numerical user identification number or group identification number or the names. Here’s an example:

Description

This example adds read and write permissions for the sales group to the test file. Notice that there’s no output from the setfacl command. When you list the file, only the standard owner, group, and other permissions are shown, but a plus sign (+) is added to the permissions list. This indicates that the file has additional ACLs applied to it. To view the additional ACLs, use the getfacl command again:

Description

The getfacl output now shows that there are permissions assigned to two groups. The default file group (rich) is assigned read permissions, but now the sales group has read and write permissions to the file. To remove the permissions, use the -x option:

Description

Linux also allows you to set a default ACL on a directory that is automatically inherited by any file created in the directory. This feature is called inheritance.

To create a default ACL on a directory, start the rule with a d: followed by the normal rule definition. That looks like this:

This example assigns the read and write permissions to the sales group for the /shared/sales directory. Now all files created in that folder will automatically be assigned read and write permissions for the sales group.

Managing the Date and Time

In our global society, it’s common to have systems located around the world that need to interact with one another. It’s important that files and folders created and accessed on these systems use proper date and time stamps to indicate file times. There are two commands that you can use to view the current system date and time:

- date

- time

The date command also allows you to customize the output using format operators. There are lots of customized formats available for the date command. Use the main date command to view the different formats available for the date command. For example, to view the year, month, and date as YYYYMMDD, use the format:

There are two ways to set the date and time on Linux systems:

- Manual settings

- Automatic settings

This section shows how to use each of these methods to change the time and date on your Linux system.

Setting the Date and Time Manually

The date command not only allows you to view the current system date and time, it also allows administrators to set them. You set the date and time by specifying it in the date command line using the following format:

If you just need to set the date, you can omit the time values. However, if you need to set the time, you must also specify the date. Only the root user account (or an account that has sudo access) can change the date and time on the system.

Synching the Time Automatically

Trying to manually set the time for dozens or hundreds of Linux systems can be quite a challenge. To avoid this scenario, you can use the Network Time Protocol (NTP). NTP allows you to point all Linux systems on the network to a single time source and always synchronize the system date and time with the time source.

There are several NTP programs available in Linux, but currently the two most popular are the ntpd and the system-timesyncd programs.

The ntpd program runs in the background, communicating with a remote time source and continually synchronizing the system date and time to the time source. You set one or more remote time sources in the /etc/ntp.conf configuration file. Just specify each time source on a separate line in the configuration file:

The systemd-timesyncd program is part of the Systemd family of utilities. You can check if that’s running on your Linux system by using the systemctl command, as shown in   LISTING 10-6  :

LISTING 10-6 Checking for the systemd-timesyncd program.

Description

The output in   Listing 10-6   shows that the system is using the systemd-timesyncd program to synchronize time. You define NTP servers in the /etc/systemd/timesyncd.conf configuration file.

Many networks utilize a local time source to which all systems are synchronized. However, there are also public time sources on the Internet that you can use if you wish. For example, the special address pool.ntp.org provides a cluster of time source servers that are available 24/7.

Setting the Time Zone

Along with the date and time, another important time feature for Linux systems is the time zone. Most Linux distributions use the /etc/localtime file to define the time zone for the server; however, some older Linux distributions use the /etc/timezone file.

The localtime and timezone files themselves are somewhat cryptic, but fortunately for us, we don’t need to mess directly with them. Instead, Linux distributions store time zone template files (one for each time zone in the world) in the /usr/share/zoneinfo folder. The time zone files are divided into folders representing geographical locations, making it easier to find the time zone file for your area. All you need to do is use the ln command to link the appropriate time zone template file for your area to the actual time zone file location for your system:

This sets the system time zone to the Eastern time zone in the United States.

Printer Administration

For years, printing had been the bane of Linux systems. In the Windows world, printer manufacturers just create customized printer drivers for each printer model they produce, making connecting to just about any printer a breeze, but it’s not that easy in the Linux world.

Linux uses two different systems for managing printers:

- Berkeley Software Distribution (BSD) Line Printer Daemon (LPD)

- Common Unix Print System (CUPS)

The Line Printer Daemon (LPD) print method is the older of the two, as it had its origins in the BSD Unix world. With LPD, each printer is defined in a /etc/printcap configuration file, specifying the connection port, rules for how the printer handles text and special characters, and rules that define the print queue (usually stored in the /var/spool/lpd directory structure). The LPD printing system is somewhat complicated and is anything but plug and play.

Because of this complexity, Unix developers created the Common Unix Printing System (CUPS). CUPS is a simplified way of handling printers for Unix (and Linux) systems. It includes a webbased interface to define printers and manage print jobs. Because of its ease, it has become the de facto printing method for all Linux distributions. This section focuses on the details on how to implement CUPS in your Linux system.

Configuring CUPS

The CUPS setup consists of a program that runs in background mode (called cupsd) and two configuration files that define the system parameters and printers. These printers are normally defined using the CUPS web interface, so you never even need to touch the configuration files, but it’s important to understand how they are used.

The /etc/cups/cupsd.conf file defines the system parameters that control the overall operations of the CUPS server. Individual printers are defined in the /etc/cups/printers.conf configuration file. CUPS also utilizes the Internet Printing Protocol (IPP), which allows network printers to advertise on the network, so CUPS servers can automatically detect them.

To set up a new printer using the CUPS web interface, open a browser and navigate to the URL: http://localhost:631. The main CUPS web interface is shown in FIGURE 10-2.

FIGURE 10-2 The CUPS main web interface.Screen shot reprinted with permission from Apple Inc. © 2009 Apple Inc. All rights reserved.

Screen shot reprinted with permission from Apple Inc. © 2009 Apple Inc. All rights reserved.

Description

The CUPS web interface listens for both clients as well as other CUPS servers on TCP Port 631, the basic CUPS web interface.

Click the Administration tab to define a new printer. You’ll first be prompted to enter an administrator user account and password, then you can go through a simple wizard to select the printer to add. Once you add a printer using CUPS, that printer will be available in all of the graphical desktop applications running on the system. If you need to use the printer from the command-line prompt, there are programs to help with that.

Using LPD Commands

To support command-line print methods, CUPS also contains programs that emulate the standard programs used in the LPD system. TABLE 10-4 shows the available print commands.

TABLE 10-4    CUPS command-line commands.

COMMAND

DESCRIPTION

lpc

Start, stop, or reorder a print job.

lpr

Send a jobs to the print queue.

lprm

Remove a jobs from the print queue.

lpq

Display the print queue.

Each command uses the –P parameter to specify the printer used:

While CUPS helps make installing and managing printers easy, there’s still one more problem: How to send data to the printer that it can understand and print. That’s where the Linux PPD files come into play.

Using Linux Printer Drivers

The original Unix solution for handling printing was to devise a standard printer protocol that was used to format text and graphics sent to a printer. The Postscript protocol is the result of that work. The Postscript protocol defines a formatting language that controls how the printer displays the text and graphics.

Unfortunately, though, not many lower cost consumer printers support the Postscript protocol, as it is somewhat complicated to implement. That set Linux users back to relying on individual printer manufacturers to create Linux drivers for their specific printers.

That problem has been solved with the development of the Ghostscript program. Ghostscript converts Postscript data into the commands recognized by specific printers. It uses a Postscript Printer Definition (PPD) file to define the rules that filter the Postscript commands and convert them into commands recognized by the printer. Each printer just needs a single PPD file for the Ghostscript program to convert the Postscript data for printing on the printer.

This has opened the door for both printer manufacturers and Linux user groups to generate PPD files for a myriad of common printers. The CUPS package itself includes PPD files for thousands of different printers, plus there are entire websites devoted to Linux users sharing their own custom PPD files. Now, the Linux world finally has a reasonable printing solution.

Email Administration

In this day of instantaneous communication, email servers have become a necessity not only in the business world, but also for personal computer systems. Most Linux systems install some type of mail system by default, either a desktop client program that allows users to connect to a remote email server or an internal email server for handling email onsite.

This section describes how Linux handles email and the different options available to you for working with email in a Linux environment.

Describing Linux Email Architecture

In the early days of email, it was standard to create a single monolithic program that handled all aspects of email:

- Sending messages to users on remote systems

- Receiving messages from remote systems

- Allowing clients to read their messages

- Allowing clients to send messages

The idea behind the Unix operating system was to modularize as many functions as possible, and email was no different. Unix developers devised a modular approach to handling email functions. Instead of having a single monolithic email program, Unix systems split the email functions into three subsystems:

- Mail Transport Agent (MTA)—Send messages to remote servers and receive messages from remote servers.

- Mail Delivery Agent (MDA)—Receive incoming mail messages from an MTA and ensure they go to the correct local user mailbox.

- Mail User Agent (MUA)—Provide an interface for users to read their messages and send new messages.

By modularizing each function, Unix developers could create more advanced programs that specialized in each feature of the mail process. FIGURE 10-3 demonstrates how these modules fit together to receive and deliver a message between users on separate systems.

FIGURE 10-3 The Linux modular email programs.

Description

Linux developers continued with this process and have developed several new modular programs for implementing email systems. This section walks through the programs now available for both client and server functions.

Identifying Linux Email Servers

Email servers require both MTA and MDA programs to accept and deliver mail to users on the system. A few different MTA programs are available for the Linux environment, and TABLE 10-5 describes the most popular ones.

TABLE 10-5    Popular Linux email server programs.

Server

Description

Sendmail

The original Unix email server program, Sendmail is very versatile but extremely complicated to configure.

Exim

Created as a monolithic email program, Exim is easy to configure.

Postfix

Postfix was created as a set of modular programs to simplify handling incoming and outgoing mail.

qMail

qMail is a modular set of programs that focus on guaranteed mail delivery.

The Postfix email server program has become the very popular in Linux environments. Most Linux distributions install it by default. However, many experienced email administrators prefer the robustness and reliability of the qMail package.

Email servers use the Simple Mail Transfer Protocol (SMTP) to send messages to each other. Each email server can both send messages to remote servers as well as accept incoming messages for local email users.

One popular MDA program in the Linux world is Procmail. The Procmail program allows the mail administrator to customize mail delivery to users. Not only can you send mail to a specific user account, but Procmail allows users to direct mail to specific folders based on filtering commands.

Using Linux Email Clients

The Linux environment includes a multitude of email client packages. For the graphical desktop environment, the Thunderbird and Evolution packages are the most common. The Thunderbird email client is shown in the FIGURE 10-4.

FIGURE 10-4 The Thunderbird email client.Courtesy of Mozilla Foundation.

Courtesy of Mozilla Foundation.

Description

Graphical email client packages provide configuration options for both receiving email from your local user account and from remote email servers. This makes them a complete MUA package.

You can also configure both Thunderbird and Evolution to send outbound mail messages to an email servers. The email server accepts email messages from both clients and servers, and if they aren’t addressed to a local user account on the host, forwards them as necessary. It uses SMTP to forward the message to the appropriate destination email server. This feature is referred to as a Mail Submission Agent (MSA) and is usually part of the MTA software on an email server.

There are also email client programs available for the Linux command line. The mailx program is the most popular and is often installed by default in Linux distributions. The mailx program allows you to both send email messages as well as check your local user account mailbox using the simple mail command line command:

Description

The question mark prompt allows you to submit commands to read, delete, store, and respond to messages.

You can also send mail using the mail command:

To end the message text hit the Ctrl+D key combination.

Redirecting Email

There are two common methods for redirecting mail delivery within the Linux email systems:

- Forwarding

- Aliases

Forwarding allows each individual user to forward messages to an alternative location. You just create a .forward file in your home folder (since the file name starts with a period, Linux considers it a hidden file) and define the locations where you want all of your mail forwarded to. These locations can be alternative email addresses, files, or even programs.

The email system administrator can also set up aliases to redirect email messages. The /etc/aliases file allows you to create a list of aliases using the format:

The alias name acts like a local user account; the email server will accept incoming mail messages destined to the alias name. However, instead of delivering it to the alias name, it redirects the message to one or more alternative addresses specified.

After defining the aliases in the /etc/aliases file, the administrator must run the newaliases command, which converts the aliases file into a separate binary file used by the MTA software.

Secure Login

In a multiserver Linux environment, there’s a good chance that you won’t be physically located near any of the Linux servers. To access the servers, you need to utilize some type of remote access software.

In years past, the Telnet protocol provided the simplest way to interact with the server using a command prompt across the network. Unfortunately, this protocol sends data as plain, unencrypted text, making it easy for an attacker to snoop on your connection and gain valuable information.

These days, all systems support the Secure Shell (SSH) login for remote access. The SSH login uses encryption keys to encrypt the network session traffic between the client and the server, making it more difficult for attackers to snoop.

The most popular software package for SSH is OpenSSH, an open source implementation of the SSH protocol.

The OpenSSH package provides both client and server software in the same package, so you only need to install one package to have both. The OpenSSH package contains programs that support:

- Interactive command prompt sessions

- Remote file copying

- Tunneling of any type of data between two servers

Tunneling provides an encrypted connection between two servers that any application can use to send data. This creates an easy way to encrypt data from just about any application, even if it doesn’t directly support encrypted connections.

This section walks through the basics of using OpenSSH in a Linux environment to provide secure communication between servers and clients.

Using OpenSSH

The OpenSSH package consists of four main programs:

- sshd—The secure server

- ssh—The secure client

- scp—A secure copy command

- sftp—A fullfeatured secure file transfer program

The OpenSSH sshd server program listens for network connections on TCP port 22, and launches either the interactive shell or a file transfer application depending on the client request. It utilizes the /etc/ssh/sshd_config configuration file that allows you to customize its behavior. There are four main configuration settings that you’ll most likely need to look at:

- Protocol—Set to either 1 (for version 1) or 2 (for version 2) encryption protocol. Version 1 is not considered secure anymore, so use version 2 whenever possible.

- PermitRootLogin—When set to yes, it allows the root user account to log in from an interactive SSH connection.

- AllowTcpForwarding—When set to yes, it allows you to create encrypted tunnel connections between two servers that any application can use to send and receive data.

- X11Forwarding—When set to yes, it allows you to send the X Window desktop session to a remote server using an encrypted tunnel.

The ssh client program allows you to connect to a remote server using the SSH protocol. It uses the /etc/ssh/ssh_config configuration file to define application settings. For normal use, you shouldn’t have to define any of these settings.

The SSH protocol uses the asymmetric encryption (also called public key encryption) method. This method generates two encryption keys:

- A public key that you keep in your home folder on the remote server in the file ~/.ssh/authorized_keys.

- A private key that only you have access to on your local server or workstation, usually stored in the ~/.ssh/id_rsa file.

The SSH session uses your private key to both validate your login against the public key stored on the server and encrypt the data you send in the connection. The following section walks through how to generate the public and private keys used.

Using SSH Keys

The OpenSSH package includes the ssh-keygen program that can generate both public and private encryption keys. It can be used to create encryption keys to identify both servers and clients.

Servers maintain an encryption key pair so that clients can ensure they’re communicating with the real server and not an imposter created to intercept data. The server maintains the private key, and the client places the server’s public key in their key folder.

While this is often done automatically when installing a server, you can also manually generate the server encryption key pair using the commands:

Description

These commands generate the three most common types of encryption keys: RSA version 1, RSA version 2, and DSA. The private keys are stored in the /etc/ssh folder as ssh_host_rsa1_key, ssh_host_rsa_key, ssh_host_dsa_key. The public keys use the same filenames, but with the .pub file extension.

Using SSH for Logins

When you use the ssh program to log into a remote host, there are two modes that you can use:

- Password mode —Enter your normal user account password.

- Key mode—Enter a private key to authenticate your connection.

In password mode, the ssh program prompts you for the user account password:

Description

The first time you connect to a server you’ll be prompted to accept the public key for the server. Subsequent connections to the server compare the stored public key against the server’s private key. If they don’t match, the ssh program will warn you of the change.

After you successfully connect, the prompt results in the command-line prompt for the remote server. It is helpful to customize the PS1 shell prompt to display the hostname in the prompt so that you can keep track of just which system shell prompt you’re working from.

WARNING

If you store your private keys in your user account home directory, anyone with access to your user account can then obtain access to your remote accounts the keys are used for. You can prevent this by assigning a password to the keys.

Instead of using your user account password, you can configure SSH to use your private key to log you into the remote system. To do that, you must first generate a public and private keypair:

Description

Then you must copy the public key from file ~/.ssh/id_rsa_pub to the authorized_keys file in the ~/.ssh folder for your user account on the remote server. You can either manually do this or use the ssh-copy-id command.

Encrypting Files

Sometimes you may need a little more security than just encrypting the network connection. If you work with sensitive files, you may want to encrypt the actual file before sending it to a remote location. Unfortunately, the OpenSSH package can only be used for encrypted network sessions and can’t encrypt individual files. Instead, you can use the GNU Privacy Guard (GPG) package.

The GPG package provides a way for you to both encrypt a file to protect the data and digitally sign a file to verify that it came from you. It does this all using the gpg program.

The gpg program maintains a keychain that contains the public keys of individuals you exchange files with. To use GPG, you’ll first need to create your own public/private keypair to add to your keychain:

To export your public key into a file that you can send to others, use the export parameter:

You must specify a unique name for yourself that identifies your public key in the gpg keychain. You can then email the public key file to anyone who you exchange encrypted files with.

Likewise, you must also import the public keys for others to read the encrypted files they send to you. You do that using the ‐‐import parameter:

If you’d like to list the public keys contained in your keychain, use the ‐‐list‐keys parameter, or use the ‐‐gen‐ revoke parameter to remove individual keys from your keychain.

Once you have the recipient’s key in your keychain you can encrypt a file to send to them using the command:

You must specify the user name that matches the public key user name in your keychain. By default, GPG generates a binary encrypted file. If you prefer to email the encrypted file as a text message, add the ‐‐armor parameter.

To decrypt an encrypted file sent to you, use the command:

Besides encrypting files, GPG also allows you to digitally sign a file to validate it came from you. To do that, use the command:

To validate a file digitally signed by another person, use:

By combining both GPG and OpenSSH, you can help increase the security of your files as they are transmitted between hosts.

Log Files

In a multiuser Linux system, it’s important to keep track of what users as well as background programs are doing. You can accomplish that by utilizing the system log files. Just about all Linux systems store system log files in the /var/log directory structure.

There are two common logging systems used in Linux. For Linux systems that use the SysVinit startup script method, the syslogd program (or its cousin rsyslogd) is the most common logging program. For systems that use the Systemd startup script method, the systemd‐journald program is used.

The following sections describe each of these methods in more detail.

Using syslogd

The syslogd program uses the /etc/syslog.conf configuration file (or /etc/rsyslog.conf for the rsyslogd program) to control what system events are logged and how they get logged. The configuration files define three items: the facility that logs the event (such as mail system or the kernel), the priority of the event (such as a critical issue or just a warning), and the action to take when the event occurs. The format of the log entry is:

TABLE 10-6 shows the facility types available.

TABLE 10-6    The syslogd facility types.

Facility

Description

authpriv

Use for security and authorization messages.

cron

Use for cron daemon messages.

daemon

Use for various system daemon messages.

kern

Use for kernel messages.

lpr

Use for printing system messages.

mail

Use for mail system messages.

news

Use for news daemon messages.

syslog

Use for internally generated syslog messages.

user

Use for user-level messages.

uucp

Use for Unix-to-Unix copy program (uucp) daemon messages.

local0 through local7

Use for locally defined application messages.

The priorities are shown in TABLE 10-7 from the most import priority to the least important.

TABLE 10-7    The syslogd priority values.

Priority

Description

emerg

A panic message, indicating the system is unusable.

alert

Indicates an urgent failure/error message concerning primary systems.

crit

Indicates an urgent failure/error message concerning secondary systems.

err

Indicates a non-urgent failure/error message.

warning

This message indicates an error will occur if action is not taken.

notice

Identifies an abnormal messages that is not a concern.

info

Identifies messages about normal operation.

debug

Identifies debugging-level messages for application development.

For the action parameter, you can specify one or more filenames to log the message to, one or more user accounts, or even a remote host logging system. You can also use the asterisk wildcard character to cover all facilities, priorities, or user accounts for actions.

For example, to send all mailrelated messages to the /var/log/mail log file, use the entry:

To send all emergency messages to all users on the system, use:

Finally, to send all critical priority messages to a remote server, use:

You can also manually log messages to the syslogd system using the logger program:

Description

Finally, the logrotate program is used to split (or rotate) log files so that they don’t get too large. You can start a new log file based on file size or date. The /etc/logrotate.conf configuration file sets how each logging type is rotated.

Using Systemd‐journald

The systemdjournald logging system uses the /etc/system/journald.conf configuration file to define how events are logged. The configuration file includes all of the possible settings commented out. To change a setting from its default, just remove the comment character, and change the value to what you require. For most systems the default values work just fine.

Viewing the log files generated by systemdjournald is somewhat tricky. Unfortunately, the journald program logs event messages in a binary log file instead of a text log file. Because of that you can’t just view the log files generated by journald using text tools. Instead, you must use the journalctl program.

The journalctl program by itself displays the journald log file entries, starting from the first entry. You can use some command-line parameters to alter its behavior:

- ‐a—Display all data fields.

- ‐e—Jump to the end of the file and use the pager program to display it.

- ‐l—Display only printable data fields.

- ‐n number—Show the most recent journal data and limit it to a specific number of lines (10 if no number value specified).

- ‐r—Reverse the output of the journal data so that the newest entries show first.

There are many more features of the journalctl program that you can use to filter just what log messages you view. Refer to the journalctl man page to see all of them.

CHAPTER SUMMARY

This chapter discusses the topics you need to know to maintain Linux in either a multiuser or multiserver environment. To support multiple users you must be able to create, modify, and delete user accounts using Linux command line programs. The useradd, usermod, userdel, and chage programs provide all the tools you need to manage user accounts on your Linux system. The su and sudo commands allow you to gain access as an administrator user account to perform administrator functions on the system.

The chapter next discussed how file permissions are an important part of a multiuser system and showed how to easily modify them using both basic and advanced Linux methods. The chmod command allows you to set the basic Linux permissions, while the setfacl command allows you to set more advanced access control permissions for files and directories.

Following that, the chapter showed how to use the date command to view and set the system date and time, or the ntpd or systemd-timesyncd programs to set the time automatically using a remote time source.

Printers can be a vital part of any Linux environment, so knowing how to create and manage them is crucial. The chapter shows how to work with both the LPD and CUPS printer standards in Linux. After that, the chapter explored how to set up an email server and run an email client package in Linux.

The chapter concluded by discussing the OpenSSH program, and how to use it to securely log into a server from a remote location, and the system logging applications   syslogd and systemdjournald. Both provide ways for both the system and applications to send event messages directly to log files either locally or remotely.

KEY CONCEPTS AND TERMS

- Administration user account

- Aliases

- Asymmetric encryption

- chage

- Common Unix Print System (CUPS)

- date

- Execute

- Forwarding

- Ghostscript

- GNU Privacy Guard (GPG)

- Group

- Group permissions

- journalctl

- Key mode

- Line Printer Daemon (LPD)

- Mail Delivery Agent (MDA)

- Mail Submission Agent (MSA)

- Mail Transport Agent (MTA)

- Mail User Agent (MUA)

- Multi-user operating system

- Network Time Protocol (NTP)

- Normal user account

- OpenSSH

- Orphan file

- Other permissions

- Owner permissions

- passwd

- Password mode

- Postfix

- Postscript Printer Definition (PPD)

- Postscript protocol

- Private key

- Procmail

- Public key

- root

- Read

- scp

- Secure Shell (SSH)

- sftp

- Simple Mail Transport Protocol (SMTP)

- su

- sudo

- Symbolic mode

- syslogd

- Service account

- systemd-journald

- Telnet

- Tunneling

- User accounts

- useradd

- userdel

- usermod

- Write

CHAPTER 10 ASSESSMENT

1. Which command allows you to change your current session user account to the root user account?

1. sudo

2. usermod

3. su

4. passwd

2. Which command allows you to modify the properties of an existing user account?

1. usermod

2. useradd

3. userdel

4. su

3. Which octal value represents only read and write permissions?

1. 7

2. 11

3. rw

4. 6

4. Which program should be running in background mode to keep the system time synchronized with the time on a remote server?

1. ssh

2. ntpd

3. date

4. time

5. Which command allows you to print a file from the command line?

1. lpr

2. lprm

3. cupsd

4. lpq

6. Which Linux modular program sends email to a destination server?

1. MTA

2. MDA

3. MSA

4. MUA

7. The .forward file can be set by an individual user to redirect their own mail.

1. True

2. False

8. The ________ encryption key can be shared with others.

1. private

2. public

9. The gpg program allows you to encrypt a network session to an email server to send encrypted mail.

1. True

2. False

10. The /var/log folder contains log files generated by the sylogd program.

1. True

2. False

Resources

Red Hat Documentation, “Managing Users Vias Command-Line Tools,” Accessed on Jan. 15, 2022, from https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-users-cl-tools.

Ubuntu Documentation “CUPS—Print Server,” Accessed on Jan. 15, 2022, from https://ubuntu.com/server/docs/service-cups.

OpenSSH, “OpenSSH,” Accessed on Jan. 15, 2022, from https://openssh.com.

Resources

Red Hat Documentation, “Managing Users Vias Command-Line Tools,” Accessed on Jan. 15, 2022, from https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-users-cl-tools.

Ubuntu Documentation “CUPS—Print Server,” Accessed on Jan. 15, 2022, from https://ubuntu.com/server/docs/service-cups.

OpenSSH, “OpenSSH,” Accessed on Jan. 15, 2022, from https://openssh.com.

© Picsfive/Shutterstock

CHAPTER 11

Linux Security

THESE DAYS IT’S A MUST to know how to run a secure Linux system. Fortunately, several tools are available in the Linux world to help make that job easier. This chapter discusses some of the security features of Linux that you may need to use depending on your specific environment.

The chapter starts out by discussing the importance of keeping track of the administrative account in Linux. The root user account has access to change everything on the Linux system. Controlling who can use that account, how they use it, and logging when they use it is the first step in Linux security. The section discusses some Linux tools and common techniques for controlling and monitoring root access on your system.

Next the chapter discusses implementing advanced security permissions in Linux. While Linux provides basic file protection, it lacks the ability to manage security of processes. There are, however, two common packages utilized to provide context-based security permissions to other Linux objects, such as processes. SELinux and AppArmor are two popular packages that provide advanced security in the Linux world.

The chapter then moves on to talk about encrypting partitions. Linux has a few different ways to encrypt files stored on the system. The chapter discusses the cryptsetup utility, which allows you to encrypt an entire partition so
you don’t need to encrypt individual files. The chapter then finishes up with
a brief introduction to using firewalls in Linux by exploring the popular firewalld utility.

CHAPTER 11 TOPICS

This chapter covers the following topics and concepts:

- How Linux allows root permissions

- How to control who can use root permissions

- Using the SELinux advanced security settings in Linux

- Using the AppArmor advanced security settings in Linux

- How to create an encrypted partition using the cryptsetup utility

- How to block unwanted network traffic using the firewalld utility

CHAPTER 11 GOALS

When you complete this chapter, you will be able to:

- Manage access to the root user account

- Log access to the root user account

- Provide advanced security in Red Hat-based distributions with the SELinux tool

- Provide advanced security in Ubuntu with the AppArmor tool

- Encrypt a storage partition so that all files are automatically encrypted
when created

- Create zones, policies, and rules for blocking unwanted network traffic while allowing wanted network traffic

Working with Root Access

Linux systems control access to files, directories, and applications by using user accounts. Linux has three types of user accounts:

- Root—the administrator account with full privileges to all files, directories, and services

- Standard—normal user accounts

- Service—application accounts

Because of its power, the root user account can be somewhat dangerous to have active on your Linux system. By default, the Ubuntu distribution blocks the ability to log in or change to the root user account to help manage the security environment. However, that’s not the case in Red Hat-based distributions.

If you check in a Red Hat environment, the root user account exists:

and should have been assigned a password at the time of installation:

Description

Because the root user account is active in the Red Hat system, you should be careful about a few things when using a Red Hat desktop or server. This section walks through a few security practices related to the root user account you should consider when working on a Red Hat system.

Gaining Super User Privileges

The easiest way to gain super user privileges on a Linux system is to log in as the root user account. However, that can be a dangerous practice because it’s difficult to track just who is logging in as the root user account. To help avoid that issue, many Linux distributions (such as Ubuntu) are configured by default to prevent you from logging in directly as the root user account. Instead, you must use one of two command-line commands to gain super user privileges when logged in as a normal user account:

- su starts a new command-line shell as another user account. If no user account is specified, it defaults to the root user account.

- sudo runs a single command with root user privileges.

When you use these commands, the Linux system logs exactly what user account gained super user privileges and when they did it (called nonrepudiation).

The sudo command is short for “substitute user do,” though many still refer to its older name, “super user do,” because of its ability to provide super user privilege access. It lets a standard user account run any preauthorized command as another preauthorized user account, including the root user account. The use of the sudo command provides the following benefits and features:

- When used, sudo prompts users for their own password to validate who they are.

- Once validated to use sudo, accounts do not have to re-enter their password until after a time period of not using the sudo command.

- Actions taken with the sudo command are logged.

- Groups of users can be configured to use sudo instead of listing individual account authorized access.

- Properly configured, sudo provides a least privilege and nonrepudiation environment contributing to a system’s security.

The /etc/sudoers configuration file defines what users are allowed to run the sudo command along with what they have access to do. The sudoers file may contain a list of user accounts, aliases, and/or groups whose users are allowed to escalate privileges. By default, the sudoers file on an Ubuntu system looks like this:

Description

Linux distributions create a separate user account to designate who can access full super user privileges. Ubuntu uses the group sudo, while Red Hat-based distributions use wheel. Usually the initial account created at installation time is assigned to this group. You can determine if your account is a member of one of those groups through the groups command:

If you’d like to modify the sudo configuration, you’ll need to use the visudo command. It’s a special script that prevents multiple admins from making changes at the same time, causing file corruption, and checks for proper syntax.

However, instead of directly adding your configuration in the /etc/sudoers file, it’s a good idea to create your sudo command configuration file(s) in the /etc/sudoers.d/ directory. If you do this, be sure to uncomment the includedir operation located at the bottom of the sudoers file to load your configuration.

NOTE

On systems that allow administrators to log into the root account, you’ll find that the su command (short for “substitute user”) is used to escalate privileges. It allows a standard user account to run commands as another user account, including the root user account.

However, to run the su command, the standard user must provide the password for the substitute user account password, because they are temporarily logging into that account. While this solves the problem of knowing who is performing an administrator task, it doesn't solve the problem of multiple people knowing the other account’s password.

If you stick with the default Ubuntu configuration that blocks logging into the root account, using the   su command to escalate privileges isn’t even an option. This is the best practice for a secure system.

There is another nice command that provides privilege escalation. The sudoedit command allows a standard user to open a file in a text editor with privileges of another preauthorized user account, including the root user account. Similar to the sudo command, sudoedit also prompts the user for their own password to validate who they are.

Determining Your Privilege Elevation Status

On Ubuntu the common method for escalating privileges is to use the sudo command. However, you must either belong to a group listed for accessing higher privileges in the /etc/sudoers file or have a record authorizing the privileges within the file.

To determine your privilege elevation status, you’ll need to determine if your user id is either directly in the /etc/sudoers file or a member of a group that is. First, validate your account name by using the whoami command:

Next, determine the groups to which this account belongs by using the groups command:

Typically, Ubuntu Linux allows those users who belong to the group sudo to access full super user privileges. To check that on your system, display the /etc/sudoers file using the cat command (you’ll need to have root privilege to display it):

Description

Description

You should see one of the group names your account belongs to in the /etc/sudoers file. In this example, my username is in the sudo group, which is listed in the sudoers file, allowing me to have administrative privileges on the system.

Keeping Track of Root Logins

If the root user account is active on your Linux server, it’s always a good idea to monitor the times it’s used on your server. You can do that using the aulast command. The aulast command displays a list of users who have logged into the system as found in the system audit logs. A sample output is shown in   LISTING 11-1  .

LISTING 11-1 The aulast command output.

Description

The second column in the aulast output shows the terminal the root user account logged in from. If the terminal was a remote terminal (such as an SSH connection), the third column shows the IP address of the remote device. It’s a good idea to monitor this on a regular basis to watch for unknown login activity.

Disabling Root Access from SSH

The openSSH software package includes an SSH server, which allows connections from remote clients using the secure SSH protocol. The /etc/ssh/sshd_config file controls the behavior of the SSH server. By default, the configuration used in Red Hat servers allows the root user account to login from a remote device. To prevent the root user account from logging from a remote device using the SSH protocol, you’ll need to modify the configuration file.

The line in the configuration file that allows this feature is:

To block access for the root user account, edit the line to:

Then restart the openSSH service for the change to take effect:

After restarting openSSH you should now be denied access as the root user account in a remote SSH connection:

Now the root user account can only login from a console device on the server.

Enabling Automatic Logout

If you allow administrators on the Linux server to login using the root user account, it’s a good idea to set a timeout for the Bash shell. An unattended Bash shell prompt with the root login is a huge security risk for your Linux server environment.

The timeout feature in the Bash shell is controlled by the TMOUT environment variable. To implement a shell timeout you just need to set the TMOUT environment variable to the number of seconds you want an idle session to terminate.

For the setting to apply to all logins, you should enable it in the /etc/profile script, which the Bash shell runs at each login. However, to make adding login scripts easier, Red Hat systems also look for scripts in the /etc/profile.d directory. You can create a file in the /etc/profile.d directory that sets the TMOUT environment variable, and it will run each time a user account logs into the system and opens a Bash shell. It’s also a good idea to make the TMOUT environment variable read-only so users can’t override that feature. You do that with the readonly command.

So to implement this feature, all you need to do is create the file
/etc/profile.d/timeout.sh and include these two lines:

In this example we set the timeout to 300 seconds (5 minutes). Now if any user account session on the server sits idle for 5 minutes (300 seconds) the server will terminate the session.

Blocking Root Access

If you prefer for your Red Hat server to block all access to the root user account similar to what Ubuntu does, you can do that as well. There are a couple of ways to do that:

- Similar to the Ubuntu method, you can use an asterisk as the password value for the root user account.

- You can assign the root user account the special no-login shell.

While Ubuntu’s method of using the asterisk as a password is perfectly valid, it’s not typically the preferred way of blocking access from a user account. The /sbin/nologin file is a special program that displays a message to the user, then exits. To activate it, just set it as the default shell for the root user account in the /etc/passwd file:

Then when you try to login using the root user account, you’ll see the default warning message and be disconnected:

Description

You can customize the message that appears by creating the /etc/nologin.txt file and entering the text message:

Now when you attempt to login using the root user account, you’ll see the custom message:

Description

WARNING

Be extremely careful when restricting the root user account on your Linux system. It’s best to make sure you have a standard user account that has access to the   sudo command (is a member of the sudo group) so that you can still gain administrator privileges if something should go wrong and completely lock out the root user account!

Context-Based Permissions

Both the original Linux permissions method and the advanced ACL method of assigning permissions to files and directories are called discretionary access control (DAC) methods. The permission is set at the discretion of the file or directory owner. There’s nothing an administrator can do to prevent users from granting full permission to others on all the files in their directories.

To provide complete protection of your Linux system, it helps to utilize some type of mandatory access control (MAC) method. MAC methods allow the system administrator to define security based on the context of an object in the Linux system to override permissions set by file and directory owners. MAC methods provide rules for administrators to restrict access to files and directories not only to users, but also to applications running on the system.

NOTE

You may also see the term role-based access control (RBAC) used in security literature. The RBAC method is a system for basing security permissions on the roles users and processes play in the Linux system.

There are currently two popular MAC implementations in Linux:

- SELinux for Red Hat–based systems

- AppArmor for the Ubuntu system

The following sections provide more detail on using SELinux and AppArmor in your Linux environment.

Using SELinux

The Security-Enhanced Linux (SELinux) application is a project of the U.S. National Security Agency (NSA) and has been integrated into the Linux kernel since version 2.6.x. It is now a standard part of Red Hat–based Linux distributions, such as Fedora, Rocky, and CentOS, and an optional install for Debian-based distributions.

SELinux implements MAC security by allowing you to set policy rules for controlling access between various types of objects on the Linux system, including users, files, directories, memory, network ports, and processes. Each time a user or process attempts to access an object on the Linux system, SELinux intercepts the attempt and evaluates it against the defined policy rules.

Enabling SELinux

The /etc/selinux/config file controls the basic operation of SELinux. You need to set two primary settings:

- SELINUX determines the operation of SELinux. Set this to enforcing to enable the policy rules on the system and block any unauthorized access. When you set this to permissive, SELinux monitors policy rules and logs any policy violations but doesn’t enforce them. The disabled setting value completely disables SELinux from monitoring actions on the system.

- SELINUXTYPE determines which policy rules are enforced. The targeted setting is the default and only enforces network daemon policy rules. The minimum setting only enforces policy rules on specified processes. The mls setting uses multilayer security, providing advanced policies following the Bell-LaPadula model of security control, which is mandated by most U.S. government and military environments that require high security. It uses security classifications such as top secret, unclassified, and public. The strict setting enforces policy rules for all daemons but is not recommended for use anymore.

To change the state of SELinux, you can also use the setenforce utility from the command line. However, you can only use the utility to change SELinux between enforcing and permissive modes. To disable SELinux, you must make the change in the SELinux configuration file. To see the current mode of SELinux, use the getenforce utility:

For a more detailed listing of the SELinux status, use the sestatus utility:

Description

After you’ve enabled SELinux, it starts enforcing access rules on the objects defined in a set of policies. The next sections explain how SELinux policies work.

Understanding Security Context

SELinux labels each object on the system with a security context. The security context defines what policies SELinux applies to the object. The security content format is as follows:

The user and role attributes are used only in the multi-layer security mode and can get quite complex. Systems running in the default targeted security mode only use the type attribute to set the object security type and control access based on that. The level attribute sets the security sensitivity level and clearance level. It is optional under the targeted security mode and is mostly used in highly secure environments.

To view the security context assigned to objects, add the -Z option to common Linux commands such as id, ls, ps, and netstat. For example, to view your user security context, use the following command:

Description

The unconfined_u user security context means the user account is not assigned to a specific security policy; likewise is unconfined_r for the role and the unconfined_t for the type. The level security context of s0-s0:c0.c1023 means the security and clearance levels for the object are also not set.

To view the security context for a file use, use this:

Description

Again, the user and role attributes are unconfined, but now the type attribute is set to user_home_t. You can use this attribute in a security policy to set the access for files in each user account’s $HOME directory.

To examine the security context assigned to a process, use the following command:

Description

The process required for the sshd application is set to the system_u user security context and system_r role security context. These indicate the process is system related. The type security context for the process is different, which means it can each be controlled with separate policies.

NOTE

You’ll often see the security context referred to as a label in SELinux documentation and literature. SELinux must assign the label to each object on the system when it’s first enabled, which can be a long process.

The semanage utility allows you to view and set the security context for user accounts on the system. For files and directories, the Linux system sets their security context when they are created, based on the security context of the parent directory. You can change the default security context assigned to a file by using the chcon or restorecon utilities.

The chcon format is as follows:

The newuser, newrole, and newtype values define the new user, role, and type security contexts you want assigned to the specified file.

The restorecon utility restores the security context of a file or directory back to the default settings as defined in the policies. You can use the -R option to recursively restore the security context on all files under a specified directory.

WARNING

The   runcon utility allows you to start an application with a specified security context, but be careful. If an application starts without having access to any required configuration or logging files, strange things can, and usually will, happen.

Using Policies

SELinux controls access to system objects based on policies. In the targeted security mode, each policy defines what objects within a specific type security context can access objects within another type security context. This is called type enforcement.

For example, an application labeled with the type security context sshd_t is only allowed to access files labeled with the type security context sshd_t. This restricts access from the application to only certain files on the system.

SELinux maintains policies as text files within the /etc/selinux directory structure. For example, all policies for the targeted security mode are under the /etc/selinux/targeted directory.

Creating your own policies can be somewhat complicated. Fortunately, SELinux includes policy groups, called modules, that you can install as standard RPM packages. Use the semodule utility to list, install, and remove policy modules in your system.

To make things even easier, SELinux uses a method of enabling and disabling individual policies without having to modify a policy file. A Boolean is a switch that allows you to enable or disable a policy rule from the command line based on its policy name. To view the current setting of a policy, use the getsebool command:

Description

To view all of the policies for the system, include the -a option, as shown in   LISTING 11-2  .

LISTING 11-2 Using the -a option with the getsebool command.

Description

Listing 11-2   just shows a partial output from the getsebool command; lots of different policies are installed by default in most Red Hat Linux environments.

To change the Boolean setting, use the setsebool command:

Description

This setting only applies to your current session. To make the change permanent, you must add the -P option to the command. This gives you full control over the policy settings defined for SELinux.

NOTE

Each time SELinux denies an event due to a security policy, it logs the action in the   /var/log/audit/audit.log file. You can view this file to see what events security policies are blocking on your system. The audit2allow utility is a handy tool that can read an audit log entry and generate a policy rule that would allow the denied event. However, be careful with this tool because there may have been a valid reason why the event was denied.

Using AppArmor

Debian-based Linux distributions commonly use the AppArmor MAC system. AppArmor isn’t as complex or versatile as SELinux; it only controls the files and network ports applications have access to.

WARNING

As of Ubuntu 18.04LTS, AppArmor is installed by default, but the utilities and profile packages aren’t. Use   apt to install the apparmor-utils and apparmor-profiles packages.

AppArmor also defines access based on policies but calls them profiles. Profiles are defined for each application in the /etc/apparmor.d directory structure. Normally, each application package installs its own profiles.

Each profile is a text file that defines the files and network ports the application is allowed to communicate with and the access permissions allowed for each. The name of the profile usually references the path to the application executable file, replacing the slashes with periods. For example, the profile name for the mysqld application program is called usr.sbin.mysqld.

To determine the status of AppArmor on your Linux system, use the aa-status command, as shown in   LISTING 11-3  .

LISTING 11-3 The aa-status command output.

Description

NOTE

AppArmor profiles can use variables, called tunables, within the profile definition. The variables are then defined in files contained in the   /etc/apparmor.d/tunables directory. This allows you to easily make changes to the variables to alter the behavior of a profile without having to modify the
profile itself.

The output from the aa-status command in   Listing 11-3   shows all of the profiles in enforce, complain, or disabled status. You can view a listing of active network ports on your system that don’t have a profile defined by using the aa-unconfined command:

Description

Description

To turn off a specific profile, use the aa-complain command, which places the profile in complain mode:

In complain mode, any violations of the profile will be logged but not blocked. If you want to completely disable an individual profile, use the aa-disable command:

To turn a profile back on, use the aa-enforce command:

Description

While not quite as versatile as SELinux, the AppArmor system provides a basic level of security protection against compromised applications on your Linux system.

Encrypting Partitions

These days data security is a must in most business environments. With the popularity of portable laptops and external storage devices, often sensitive corporate (and sometimes personal) data are easily available for thieves to steal.

One line of defense to help protect data is encryption. Linux provides utilities to encrypt individual files, but that can get tedious. A better solution is to encrypt the entire partition where the data are stored. A popular tool for that is the Linux Unified Key Setup (LUKS). The LUKS system was created in 2004 by Clemens Fruhwirth specifically for encrypting Linux partitions.

The core utility in LUKS is the cryptsetup utility. It allows you to create encrypted partitions, then open them to make them available for formatting and mounting in the Linux virtual directory.

The first step is to format a partition to use for encryption, using the luksFormat option:

Description

Description

In this step you must specify the passphrase required to open the encrypted partition.

After you create the encrypted partition, you can make it available for use by using the luksOpen option:

Description

The luksOpen option requires that you know the passphrase used to encrypt the partition. The first parameter after the luksOpen option specifies the physical partition, and the second parameter defines a name used to map the opened partition to a virtual device in the /dev/mapper directory:

Description

The /dev/mapper/safedata device file now references the opened encrypted partition and can be handled as a normal Linux partition:

Description

After you create the filesystem and mount the partition, you can create, modify, and delete files and directories in the /mnt/mydata directory just as you would any other Linux filesystem.

To close an encrypted partition so that it can’t be accessed, use the luksClose command option:

Description

When you close the encrypted partition, Linux removes it from the /dev/mapper directory, making it inaccessible. To mount the partition again you would need to use the luksOpen option in the cryptsetup command and provide the passphrase.

Network Security Using Firewalls

Firewall software helps protect your Linux server from unwanted network access. They use access control lists (ACLs) to define what network connections can be allowed and which ones should be blocked.

The core system of creating and maintaining firewall ACLs in Linux is iptables. With iptables you define chains of rules that the kernel follows to determine if an inbound or outbound packet should be allowed or denied. However, defining rules in iptables can get a bit complicated, as it uses a somewhat arcane method of defining hosts and ports. To make life easier for administrators, a few different Linux firewall programs use easy-to-read commands to create the rules needed for the kernel to allow or deny packets. The two most popular seem to be the following:

- firewalld—Installed by default on Red Hat-based distributions

- ufw—Installed but not activated on Ubuntu distributions

Firewall protection is especially important when running Linux servers. You need the ability to block unwanted intruders from accessing the server applications while allowing your customers to access them freely. This section describes the firewalld program and shows how you can use it to help protect your Red Hat server on different types of networks.

Red Hat Firewall Concepts

The firewalld software uses the concept of zones to define protection for the network interfaces on your Red Hat server. A zone defines the type of network the interface is connected to and what type of network traffic should be allowed or blocked. Different types of network connections require different levels of protection. For example, take the network shown in FIGURE 11-1.

FIGURE 11-1 A Linux server connected to two networks.

In Figure 11-1, the Linux server has two network interfaces. Network card A is connected to a home network, which includes other network devices that need to connect to the Linux system. Network card B in the server is connected to the Internet. You most likely will want to define different ACL rules for each network interface, Network card A should allow the local clients to connect to server resources, such as shared files, printers, and possibly even establish SSH connections to login.

However, Network card B needs extra security protections so that unknown attackers lurking on the Internet can’t gain access to your server. With a myriad of different network applications and protocols, you can see how it would quickly become difficult to keep things straight on the system.

The solution is to implement zone-based ACL rules. The firewalld program allows you to define multiple zones and assign each zone a different set of rules to control network access. Typically, each network interface on the server is assigned to a specific zone, based on the network requirements. The firewalld program applies the zone rules to the network interface.

By default, the Red Hat server defines ten zones. You can list the currently defined zones using the firewall-cmd command:

TABLE 11-1 provides a basic description of what each these default zones are used for.

TABLE 11-1    The default firewalld zones.

ZONE

DESCRIPTION

block

Rejects all incoming network connections and sends an ICMP prohibited message. Only outgoing network connections are allowed

dmz

Only selected incoming connections are accepted.

drop

Rejects all incoming network connections with no reply message. Only outgoing network connections are allowed.

external

Enables masquerading feature to hide the server’s true IP address. Only specified incoming connections are accepted.

home

Allows only specified incoming connections, but all outgoing connects are allowed.

internal

Allows only specified incoming connections are accepted.

nm-shared

Special zone defined for sharing on the network.

public

For use on untrusted networks, only select incoming connections are accepted.

trusted

All network connections are accepted.

work

For use on mostly trusted networks, only select incoming connections are accepted.

Each zone has a different set of default rules assigned to it, controlling what network traffic can come in or go out from network interfaces assigned to that zone. To manage the access on a network interface you just assign it to a specific zone.

Besides zones, firewalld uses ACL rules. The ACL rules define what network connections should be allowed or blocked. With firewalld you can define the rules using two different methods:

- Defining the service name

- Defining the protocol port

By using service names, you can allow or block connections by application, such as FTP, SSH, or HTTP. By using ports you can allow or block connections based on TCP or UDP port numbers.

The following sections show how to use firewalld in your Red Hat server environment.

Checking the Firewall Status

While the firewalld program uses standard text configuration files, you can use the firewall-cmd command-line command for most of the things you need to do. To check if firewalld is running, just use the --state option:

You can check what zone a specific interface is currently in by using the --get-zone-of-interface option:

Or if you have multiple network interface cards you can use the --get-active-zones option to list all zones that are currently active on network interfaces:

Description

You can see the current configuration for a zone by using the --list-all option and specifying the zone name using the --zone option:

Description

The output shows the features and what items are allowed through the firewall for that zone. The target feature defines the action for the zone:

- default—Rejects all packets not matching the zone rules, but sends an ICMP packet to the client indicating why

- ACCEPT—Accepts packets not matching the zone rules

- DROP—Drop packets not matching the zone rules

- %%REJECT%%—Rejects all packets not matching the zone rules

The sources, services, ports, and protocols features define the rule items that are either allowed or blocked, based on the target setting. In this example, the Red Hat web cockpit service, the DHCPv6 client service, and the openSSH service are all allowed. Likewise, traffic on TCP port 631 (the CUPS application, used for printing) is allowed.

Working with Zones

Besides the default zones you can create your own zones to help customize your server’s network environment. The --new-zone option of the firewall-cmd command defines the zone name:

The --permanent option is required to make the change permanent in the configuration files. Before you can use the zone, you must tell firewalld to reload the configuration file so it knows about the new zone:

Then you can list the zones to see if the new zone exists:

Description

Once you’ve created the zone you can move a network interface to the zone using the --add-interface option:

Be careful though, as the new zone doesn’t have any ACL rules applied to it:

Description

If you add the network interface that you’re currently connected to the server through, this will cause your connection to drop, and possibly be a problem! The next section shows how you can add rules to the zones.

Working with Firewall Rules

ACL rules are the core of the firewall. They define what type of network traffic is allowed or blocked by the network interface. Mistakes when adding or removing rules can be costly, especially if you’re remotely connected to the server!

The firewalld program is very robust in how it allows you to define rules. You can define rules to allow or block access based on a well-known application service name by using the --add-service option:

Description

Notice again that you should add the --permanent option to ensure the new rule applies when the system reloads.

You can also specify rules as TCP or UDP port values:

Description

Description

The firewalld program also uses what it calls rich rules, which allow you to customize a rule to specify a specific object, such as a single IP address and a port or service:

Description

This rich rule example accepts SSH packets (port 22) coming from a specific source address, 192.168.1.70. The command applies this rich rule to the mytest zone. You can then check if the rule was applied:

Description

With the firewalld program you can lock down your Red Hat server as tight as you need, only opening it up to specific network clients.

CHAPTER SUMMARY

This chapter touched on some of the security features you should be aware of, especially when running a Linux server in a multi-user environment. It’s always a good idea to control who has access to the root user account privileges on the system. You can do that by disabling the root user account and relying on the su and sudo commands for gaining root privileges. To use the sudo command, your user account must be included in the /etc/sudoers file. If you do decide to keep the root user account enabled, it’s wise to check the logs for when the root user account is used. You do that with the aulast command.

The chapter next discussed how to implement context-based permissions using the SELinux and AppArmor packages. The SELinux package is mostly used in Red Hat-based distributions and allows you to set a security context for users (using the semanage command), files (using the chcon command), and processes (using the runcon command). Adding the -Z option to the id, ls, and ps commands allows you to view the security context settings for users, files, and processes. Permissions are set using policies, defined in the /etc/selinux directory. Most policies are controlled by a Boolean switch, set with the setsebool command, and viewed with the getsebool command.

Ubuntu systems utilize the AppArmor package to provide context-based permissions, but only to files. You can determine the status of the system using the aa-status command and set the policy enforcement using the aa-enforce, aa-complain, or aa-disable commands.

Encryption is a key component of Linux security. The chapter discussed the LUKS system for encrypting storage partitions so all files saved on the partition are encrypted. The main utility in LUKS is the cryptsetup command. It allows you to format a partition for encryption, then open and close the partition as needed.

Finally, the chapter closed out discussing how Linux firewalls work. The most popular firewall tool in Red Hat-based distributions is the   firewalld package. The firewalld package uses the firewall-cmd command to enable or disable the firewall, assign network interface cards to zones, and define policy rules for each zone. Using firewalld you can open your
Linux system to only a specific group of users or applications and block all other access.

KEY CONCEPTS AND TERMS

- AppArmor

- aulast

- cryptsetup

- Discretionary access control (DAC)

- firewalld

- Linux Unified Key Setup (LUKS)

- Mandatory access control (MAC)

- nologin

- Root user

- Security context

- SELinux

- sudo

- su

- sudoers

CHAPTER 11 ASSESSMENT

1. Which command allows you to run a single program with root privileges, then exits back to your user account?

1. sudo

2. aulast

3. su

4. sudoers

2. Which command allows you to change to another user account’s permissions permanently in the session?

1. sudo

2. aulast

3. su

4. sudoers

3. Which command allows you to view the login times for users on the system?

1. sudo

2. aulast

3. su

4. sudoers

4. Which program should you assign as the default shell to the root user account to prevent it from logging in?

1. sudoers

2. aulast

3. nologin

4. sudo

5. Which command should you use to determine if SELinux is activated on your system?

1. getenforce

2. semanage

3. chcon

4. runcon

6. Which command should you use to determine if AppArmor is active on your Ubuntu system?

1. aa-enforce

2. aa-disable

3. aa-status

4. aa-unconfined

7. What command should you use to determine if the firewalld package is active on your system?

1. firewalld -status

2. firewall-cmd --state

3. firewall-cmd --zone=mytest –permanent

4. firewalld --state

8. The AppArmor security program can set the security context for user accounts.

1. True

2. False

9. The LUKS encryption package allows you to set an entire storage partition to automatically encrypt all files stored in it.

1. True

2. False

10. The firewalld firewall package allows you to create custom policy rules to block individual IP addresses from accessing your system.

1. True

2. False

Resources

The firewalld Project, “HOME | firewalld,” Accessed on Jan. 22, 2022, from https://firewalld.org/.

Red Hat Documentation, “What is LUKS disk encryption and how can it be implemented?” Accessed on Jan. 22, 2022, from https://access.redhat.com/solutions/100463.

© Picsfive/Shutterstock

CHAPTER 12

Linux in the Cloud

CLOUD TECHNOLOGY HAS GREATLY CHANGED the landscape of the computer world. Moving computer resources and applications into a shared network environment changes how many companies do business and provide services to customers.

This chapter introduces the main concepts of just what a cloud is and the role that Linux plays in cloud computing. The chapter starts out by defining what cloud computing is and what the different types of cloud computing environments are. Next is a discussion of how virtualization plays an important role in cloud computing and how that is implemented in Linux.

Following that is an explanation of how containers fit into cloud computing and how they have changed how developers do their jobs. A hot topic in the container world these days is orchestration. The chapter discusses how orchestration is used to manage containers and helps automate deploying them. Finally, the chapter takes a peek at a common use for containers—DevOps.

CHAPTER 12 TOPICS

This chapter covers the following topics and concepts:

- Defining the different type of cloud environments

- How to use Linux in cloud environments

- How virtualization helps with creating clouds

- Using containers to deploy applications in the cloud

- Using orchestration tools to manage containers

- How to use containers for managing DevOps projects

CHAPTER 12 GOALS

When you complete this chapter, you will be able to:

- Learn the different types of cloud environments

- Explain how to run Linux as a virtual machine

- Understand how containers work and how they are used in the cloud

- Know the different orchestration tools available for managing containers

- Learn the basics of DevOps and how it uses containers to manage applications

Taking a Look at the Cloud

Before diving into how Linux participates in cloud computing, it’s a good idea to define just what a cloud is and what type of resources it provides. This section covers the basics of cloud computing.

What Is Cloud Computing?

The term cloud computing relates to the ability to obtain computing resources from a remote provider. Most cloud computing providers have large data centers with excess computing power that allow them to share that computing power (or rather, lease it) with customers.

The backbone of most cloud computing data centers is Linux, operating in a distributed computing environment. In distributed computing resources are combined among two or more servers to accomplish a single task, such as run an application. Companies such as Amazon Web Services (AWS), Google Cloud Platform, and Microsoft Azure utilize large numbers of Linux servers to provide cloud computing services to their customers.

Cloud computing provides the ability to share and deliver computing resources across networks. That network can be a corporate internal network or even the public Internet. With cloud computing, customers can purchase computing resources as needed from cloud computing vendors, including servers, storage space, databases, networks, operating systems, and even individual applications.

FIGURE 12-1 demonstrates the three different methods for providing cloud computing services. As seen in Figure 12-1, there are three primary methods for providing cloud computing environments:

- Public—In the public cloud computing environments, a third-party provides all of the computing resources outside of the organization. These resources are usually shared between multiple organizations.

- Private—In the private cloud computing environments, each individual organization builds its own cloud computing resources to provide resources internally.

- Hybrid—In hybrid cloud computing environments, computing resources are provided internally within the organization, but also connected to an external public cloud to help supplement resources when needed.

FIGURE 12-1 Cloud computing methods.

Description

The following sections take a closer look at the different components of a cloud computing environment.

What Are the Cloud Services?

Cloud computing environments have the ability to customize the level of resources provided to customers, depending on each customer’s needs. This section describes the three most popular models for providing resource levels that you’ll find from cloud computing vendors.

Infrastructure as a Service (IaaS)

In the Infrastructure as a Service (IaaS) model, the cloud computing vendor provides low-level server resources to host applications for organizations. These low-level resources include all of the physical components you’d need for a physical server, including CPU time, memory space, storage space, and network resources, as shown in FIGURE 12-2.

The server resources provided may be on a single server, or they may be distributed among several servers. In a distributed environment, the servers may be co-located in a single facility, or they may be separated into multiple facilities located in separate cities. This helps provide for increased availability.

FIGURE 12-2 The IaaS cloud model.

Description

As seen in Figure 12-2, in an IaaS model the customer supplies the operating system and any applications that it needs to run. Most IaaS environments support a multitude of different operating systems, including Linux, Windows, and macOS. The customer is responsible for any system administration work required for the operating system as well as any application administration. The cloud computing vendor takes responsibility for maintaining the physical infrastructure environment.

Software as a Service (SaaS)

In the Software as a Service (SaaS) model the cloud computing vendor provides both the physical server environment as well as the operating system environment to the customer, as shown in FIGURE 12-3.

FIGURE 12-3 The SaaS cloud model.

Description

With the SaaS model, the cloud computing vendor takes responsibility for both the physical components as well as the operating system administration. It provides system administration support to ensure the operating system is properly patched and updated to keep up with current releases and security features. This allows the customer to focus mainly on the applications running within the SaaS environment.

Platform as a Service (PaaS)

In the Platform as a Service (PaaS) model, the cloud computing vendor provides a complete computing environment for software development and deployment. The vendor provides the server environment, the operating system, and any programming tools and libraries required to develop and run applications. This is shown in FIGURE 12-4.

FIGURE 12-4 The PaaS cloud model.

Description

With the PaaS model, the customer can focus on developing software and deploying it to customers, often through the cloud computing environment. Clients can remotely connect to the application as it runs in the cloud computing environment to run the application. This model helps make migrating an application seamlessly through the development, test, and production phases without having to worry about changes in the server or operating system environments.

Understanding Virtualization

The technology that made cloud computing possible is virtualization, and this is also what has made Linux a popular choice for cloud computing vendors. Virtualization allows you to run multiple servers on a single hardware platform, sharing resources as needed between the servers.

In a normal physical server environment, the operating system may only utilize hardware resources for a fraction of the time. This results in “wasted” resources sitting idle. Virtualization takes advantage of this situation by allowing multiple servers to share the hardware resources, providing a huge cost savings. This section describes what virtualization is, the different types of virtualization available, and how to implement virtualization in a Linux environment.

Hypervisors

For organizations that run applications that support lots of clients, a standard performance model dictates that you should separate the different functions of an application onto separate servers, as shown in FIGURE 12-5.

FIGURE 12-5 Separating application resources.

Description

As seen in Figure 12-5, the application software, the web server, and the database server are located on separate physical servers. From a performance standpoint, this model makes sense as you dedicate separate computing resources to each element. Also, from a security standpoint this helps compartmentalize access, making the job of any potential attackers a little more difficult.

However, with the increased capacity of servers, this model becomes somewhat inefficient. Dedicating an entire physical server to just running a web server, another physical server to just running the database server, and yet a third physical server to just running the application software doesn’t utilize the full power of the servers and becomes costly.

This is where virtualization comes in. With virtualization, you can run multiple virtual smaller server environments on a single physical server. FIGURE 12-6 demonstrates this concept.

FIGURE 12-6 Server virtualization concept.

Description

Each virtual server operates as a stand-alone server running on the physical server hardware. This is called a virtual machine, or vm. Each server acts just as if it was located on a separate physical server. However, there needs to be a way for each virtual server to share the physical resources on the host server fairly, so they don’t conflict with one another.

This is where the hypervisor comes into play. The hypervisor, also called a virtual machine monitor (vmm), acts as the traffic cop for the physical server resources shared among the virtual machines. It provides a virtual environment of CPU time, memory space, and storage space to each virtual machine running on the server. As far as each virtual machine is concerned, it has direct access to the server resources; it has no idea that the hypervisor is in the middle controlling access to resources.

Since each virtual machine is a separate entity on the server, you can run different operating systems within the different virtual machines. This allows you to easily experiment running applications in different operating systems, or just different versions of the same operating system. All without having to purchase additional servers.

Types of Hypervisors

There are two different methods for implementing hypervisors. This section discusses what they are, and how they differ.

Type I Hypervisors

Type I hypervisors are commonly called bare-metal hypervisors. The hypervisor system runs directly on the server hardware, with no middleman. The hypervisor software interacts directly with the CPU, memory, and storage on the system, allocating them to each virtual machine as needed. FIGURE 12-7 illustrates this setup.

FIGURE 12-7 Type I hypervisors.

Description

In the Linux world, two popular Type I hypervisor packages are used:

- KVM—The Linux Kernel-based Virtual Machine (KVM) utilizes a standard Linux kernel along with a special hypervisor module, depending on the CPU used (Intel or AMD). Once installed it can host any type of guest operating systems.

- XEN—The XEN Project is an open source standard for hardware virtualization. Not only does it support Intel and AMD CPUs, but there’s also a version for Arm CPUs. The XEN Project includes additional software besides the hypervisor software, including an API stack for managing the hypervisor from a guest operating system.

Type II Hypervisors

Type II hypervisors are commonly called hosted hypervisors because they run on top of an existing operating system install. The hypervisor software runs like any other application on the host operating system. FIGURE 12-8 shows how a Type II hypervisor works.

FIGURE 12-8 Type II hypervisors.

Description

The Type II hypervisor software runs guest virtual machines as separate processes on the host operating system. The guest virtual machines support guest operating systems, which are completely separated from the host operating system. Thus, you can use a Linux host operating system and still run Windows or macOS guest operating systems.

Hypervisor Templates

The virtual machines that you create to run in the hypervisor must be configured to determine the resources they need and how they interact with the hardware. These configuration settings can be saved to template files so that you can easily duplicate a virtual machine environment either on the same hypervisor, or on a separate hypervisor server.

The open source standard for virtual machine configurations is called the Open Virtualization Format (OVF). The OVF format creates a distribution package consisting of multiple files. The package uses a single XML configuration file to define the virtual machine hardware environment requirements. Along with that file are additional files that define the virtual machine requirements for network access, virtual drive requirements, and any operating system requirements.

The downside to OVF templates is that they are cumbersome to distribute. The solution to that is the Open Virtualization Appliance (OVA) format. The OVA template bundles all of the OVF files into a single tar archive file for easy distribution.

Exploring Containers

While utilizing virtual machines is a great way to spin up multiple servers in a server environment, they’re still somewhat clunky for working with and distributing applications. There’s no need to duplicate an entire operating system environment to distribute an application. The solution to this problem is containers. This section explores what containers are and how they are changing the way developers manage and distribute applications in the cloud environment.

What Are Containers?

Developing applications requires lots of files. Besides the application runtime files, there are often additional library files that are required for interfacing the application to databases, desktop management software, or built-in operating system functions. These files are usually located in various hard-to-find places scattered around the Linux virtual directory.

Because of all the ancillary files required to run an application, all too often an application will work just fine in development, then come crashing down when deployed to a production environment that doesn’t accurately reproduce the development environment. In the Windows world this is commonly referred to as DLL hell, as different applications overwrite common DLL library files, breaking other applications. However, this isn’t limited to just the Windows world; it can also apply to the Linux world.

A container gathers all of the files necessary to run an application—the runtime files, library files, database files, and any operating system-specific files. The container becomes self-sufficient for the application to run—everything the application needs is stored within the container.

If you run multiple applications on a server, you can install multiple containers. Each container is still a self-contained environment for each particular application, as shown in FIGURE 12-9.

FIGURE 12-9 Running an application in a container.

Description

The application containers are portable. You can run the same container in any host environment and expect the exact same behavior for the application. This is ideal for application developers. The developer can develop the application container in one environment, copy it to a test environment, then deploy the application container to a production environment all without worrying about missing files.

By packaging and distributing an application as a container, the developer is ensured the application will work for customers the exact same way it worked in the development environment.

Since containers don’t contain the entire operating system, they’re more lightweight than trying to distribute a full virtual machine, making them easier to distribute. The following section describes two of the most common container packaging systems used in Linux.

Container Software

Linux has been in the forefront of container development, making it a popular choice for developers. Two main container packages are commonly used in Linux:

- LXC—The LXC package was developed as an open source standard for creating containers. Each container in LXC is a little more involved than just a standard lightweight application container, but not quite as heavy as a full virtual machine, placing it somewhere in the middle. LXC containers include their own bare-bones operating system that interfaces with the host system hardware directly, without requiring a host operating system. Because the LXC containers contain their own mini-operating system, they are sometimes referred to as virtual machines, although that term isn’t quite correct as the LXC containers require the host operating system to operate.

- Docker—The Docker package was developed by Docker Inc. and released as an open source project. Docker is extremely lightweight, allowing several containers to run on the same host Linux system. Docker uses a separate daemon that runs on the host Linux system that manages the Docker images installed. The daemon listens for requests from the individual containers as well as a Docker command-line interface that allows you to control the container environments.

Container Templates

Just like virtual machines, containers allow you to create templates to use to easily duplicate container environments. The different types of Linux containers utilize different methods for distributing templates.

The LXC package uses a separate utility called LXD to manage containers. LXD uses system images of the container

Docker uses Docker image files to store container configurations. The Docker image file is a read-only container image that you can use to store and distribute application containers.

Using Containers

When implemented correctly, containers provide a way to increase the speed and agility of application deployment. Whether your company’s data center is local or in the cloud, you can use container concepts to quickly set up your app’s required infrastructure. A few important infrastructure provisioning concepts are covered in the following sections.

Creating the Container

Much like a physical data center, a container needs to be managed and controlled. In most environments, the container’s configuration is treated in a manner similar to how software revisions are treated. The following sections outline the basic ideas in creating a container environment for an application.

Design the Container

Along with the app requirements, the environment on which the app is executed must be preplanned. This activity is a mutual one between software development and tech ops. In this mutual activity, the container’s operating system, libraries, services, security configuration, and any other supporting software or networking utilities are chosen.

The determined infrastructure is frozen to provide a non-changing environment for development and then production. Typically, this app container infrastructure is only accessible via the app’s or developer’s API. Remote access services such as OpenSSH are not provided in order to protect its environment.

Document the Container

The preset app container is typically documented to ensure the container can be accurately duplicated. While there are plenty of ways to document containers, these days this is often done using an orchestration tool. Orchestration tools allow you to easily automate the configuration, management, and coordination of containers. The configuration settings are loaded in a process called automated configuration management. The data are later used to deploy and replicate the app containers through build automation.

Provide Revision Control

The configuration management information is not just documented, it is also inserted into an orchestration tool registry, providing version control. Every time a change occurs in the container image infrastructure, its modifications are tracked in the version control system. This ensures any bugs introduced into the process can easily be “backed out” to a prior version of the app.

Troubleshoot the Container

If an app container is deployed into production and problems occur, tech ops, software developers, or both handle the troubleshooting process. One item to check is the production container’s documented configuration (as well as its revisions) to determine if any infrastructure items may be to blame.

This provides an easier method for tracking down any new software libraries that could cause problems. Various orchestration tools allow a quick determination of modified infrastructure components and quicker problem resolution.

Handling the application’s infrastructure in this manner increases the agility of your app container deployment. It also improves the time to production speed. The basic life cycle of an orchestrated app container image is shown in FIGURE 12-10.

FIGURE 12-10 Basic app container life cycle.

Description

Notice in Figure 12-10 that at the end of container’s life cycle (typically when the new app container image is ready), the container image is removed. However, the old app container image’s configuration should be stored within a version control system (or backup storage) and thus redeployed if any problems occur with the new app container image.

Automating the Container

With automated configuration management, not only can you troubleshoot the infrastructure more easily and roll the environment back to an earlier version, container deployment is automated. Often more than one app container is used to help load balance user requests. A high-volume web environment may require hundreds of running production app containers.

Manually configuring this infrastructure is tedious and certainly not fast or cost effective. With orchestration tools, such as Chef and Puppet, and automated configuration management, you can easily replicate the production app container and don’t even have to be involved in the process (build automation). You simply let your orchestration tool know that you need X number of production app container images running at any one time.

Agent and Agentless Containers

Orchestration monitoring, logging, and reporting tools let you track app containers’ health (how well they are performing, and if each one is still alive). Concerns over how these tools may adversely affect an app container’s health gave rise to the agent versus agentless dispute.

Agent monitoring tools are orchestration utilities that require software (an agent) to be installed in the app container being monitored. These agents collect the data and transmit it to another location, such as a monitor server. The monitor server manages the information, provides analysis reporting, and also sends alerts for events, such as a container crashing.

Agentless monitoring tools are also orchestration utilities. In this case, an agent is not installed in the app container being monitored. Instead, the tool uses preexisting and/or embedded software in the container or the container’s external environment to conduct its monitoring activity.

NOTE

Besides monitoring, logging, and reporting utilities, several high-level orchestration engines provide agentless orchestration too. One such example is Red Hat’s Ansible.

Whether to use an agent-based or an agentless orchestration utility is hotly debated. Some people feel that an agent is detrimental to an app container’s performance, while others see only minor effects. Some tech ops insist that agentless tools are inflexible, while others believe installing and maintaining an agent in their containers is an unnecessary hassle. Whatever side you choose, realize that most companies use a combination of agent and agentless orchestration tools.

Monitoring Containers

Orchestration monitoring utilities can automatically deal with an app container’s untimely demise. When an app container shuts down, this triggers an event, and the desired state is no longer met. A desired state is a predetermined setting that declares how many containers should be deployed and running.

For example, imagine that your software application needs to have 10 production app containers running to efficiently handle the workload. If one of those containers crashes, the container inventory now switches to nine. This triggers an event in the monitoring utility that the desired state is no longer being met.

Many orchestration utilities employ self-healing. With self-healing, if the desired state is not currently being achieved, the orchestration tool can automatically deploy additional production app containers. In the previous example, this means that the orchestration tool would immediately start up an additional production app container using the container’s stored configuration settings (build automation). No human involvement is needed.

When a new production app container is first deployed, the self-healing orchestration property will cause containers to be deployed automatically until the desired state is met. That’s handy.

Container Orchestration Engines

Whether the containers are on your local servers or in the cloud, properly maintaining them requires some type of orchestration engine (also called orchestration systems). No one system can do it all. The best combination is a set of general and specialized orchestration tools.

Kubernetes

Originally designed and used by Google, Kubernetes is an open-source orchestration system that is considered by many to be the de facto standard. Not only is Kubernetes very popular and free, it also is highly scalable, fault tolerant, and easy to learn.

This system contains years of Google’s orchestration experience, and because it is open source, additional community-desired features have been added. This is one reason so many companies have adopted its use for container orchestration.

Each Kubernetes managed service or application has the following primary components:

- Cluster service—Uses a YAML file to deploy and manage app pods

- Pod—Contains one or more running app containers

- Worker—Pod host system that uses a kubelet (agent) to communicate with cluster services

- YAML file—Contains a particular app container’s automated configuration management and desired state settings

This distributed component configuration allows high scalability and great flexibility. It also works very well for continuous software delivery desired by companies employing the DevOps model.

Docker Swarm

Docker, the popular app container management utility, created its own orchestration system, called Docker Swarm (also called Swarm). A group of Docker containers is referred to as a cluster, which appears to a user as a single container. To orchestrate a Docker cluster, you can employ Swarm.

With the Swarm system, you can monitor the cluster’s health and return the cluster to the desired state should a container within the cluster fail. You can also deploy additional Docker containers if the desired app performance is not currently being met. Swarm is typically faster than Kubernetes when it comes to deploying additional containers.

While not as popular as the Kubernetes orchestration system, Docker Swarm has its place. It is often used by those who are new to orchestration and already familiar with Docker tools.

Mesos and Marathon

Mesos (also called Apache Mesos) is not a container orchestration system. Instead, Apache Mesos, created at the University of California, Berkeley, is a distributed systems kernel. It is similar to the Linux kernel, except it operates at a higher construct level. One of its features is the ability to create containers. The bottom line is that Apache Mesos combined with another product, Marathon, does provide a type of container orchestration system framework. You could loosely compare Mesos with Marathon to Docker with Swarm.

Mesos with Marathon provides high availability and health monitoring integration and can support both Mesos and Docker containers. This orchestration framework has a solid history for large container deployment environments.

Understanding DevOps Concepts

One particular place where containers and orchestration have made an impact in the IT world is DevOps, which is getting a lot of attention these days. DevOps defines a methodology for creating and deploying applications by melding the functions of both software developers and IT operations. While not required, containers can help this process by providing a platform to automate deployment of applications from the development to production environments. This section provides an overview of what DevOps is all about.

DevOps Procedures

In DevOps, the main goal is to quickly and continually provide new software features, bug fixes, and desired modifications to the customer. The focus is on continual small changes to the app as opposed to large monolithic updates. Doing that involves several steps, as outlined in this section.

Continual App Processing

One DevOps layer involves the process of developers making software revisions in a controlled centralized repository. The centralized repository makes it easier to quickly integrates app changes into the main software branch (continuous integration) using an automated method. In addition, these changes undergo automated testing to avoid breaking the app when the branch merges (continuous testing). With the help of the two previous components, software is delivered to the customer on a continual basis (continuous delivery).

Controlling the App Environment

To support this continuous app processing layer, it is helpful in DevOps that the development and production environments match. This includes equivalent hardware, device drivers, operating system versions, software libraries, and so on. The requirement provides a software development environment that produces production code free from bugs and complications due to mismatched environments.

In addition, environment changes must be controlled and tested in a manner similar to how software revisions are orchestrated. For example, if a controlled update to the Linux kernel in the development environment introduces an unforeseen app bug, the environment can be rolled back to its previous version until the bug is addressed. Environment updates are typically done in small chunks, much like app revisions are handled, so that each environment modification can be properly and discretely managed. Tested new environments are added to a registry where older environments are also maintained in case a rollback to an earlier environment is needed.

Defining the App Environment

In DevOps, the development and production environments (infrastructure) have predefined specifications, such as what hardware devices are required, the essential operating system, and any needed software packages as well as critical code libraries. The non-hardware specifications are typically implemented into the environment via automated code (configuration management).

Besides an environment’s configuration, security measures, such as firewall configurations and authentication policies, must also be orchestrated. This too is implemented into the environment via automated code (policy as code).

Configuration management and policy as code fall under the umbrella term infrastructure as code. A benefit of using infrastructure as code is that the environments are repeatable. Also, they can be versioned, which is needed to implement revision control in the app environments for both policies and configuration. This DevOps component is covered more in depth later in this chapter.

Deploying the App Environment

The app and its development environment are often moved to a production status (production environment) in a continual manner. The “continual manner” can be hourly, daily, weekly or whatever meets the app’s business requirements.

The benefit of employing infrastructure as code techniques is that the process of deploying the app and its environment can be easily automated (infrastructure automation). Red Hat’s Ansible product is one tool used for this DevOps deployment.

Monitoring the App Environment

When the app is operating in its production environment, it needs to be monitored and logged. Software metrics, infrastructure resource usage, and performance statistics are just a few of the items to monitor and log. The goal is to track the app environment and ensure that it is meeting predetermined conditions (environment health). Often this monitoring is automated as well.

As business needs change, the logged data can be valuable for future desired environment states. It provides threshold and performance measurements that make much easier decisions as to what app or environment infrastructure modifications are needed.

In addition, monitoring can provide alerts to potential failures or resource depletion events. If a particular preset limit is crossed, the monitoring software can issue an alert or even handle the event itself using predefined event rules.

Orchestration is the key to agile DevOps. Besides the methodology, various orchestration tools provide additional speed needed to succeed in the continual software delivery business setting.

DevOps Container Attributes

Virtualization, and more specifically containers, greatly assists in the DevOps process. Containers in DevOps provide the following.

Static Environment

Containers provide a predetermined app environment (also called a container image) that does not change through time (immutable). The container is created with preset library and operating system versions and security settings. All these settings are recorded. No software updates using the standard operating system upgrade packages are issued within the image.

Version Control

After the software development process and prior to moving a modified app container image into production, the container and its recorded configuration are registered with a version control system. The version control system can contain previous app container images, including the one currently in production. Some companies use a manual version control system implemented via backups.

Replace Not Update

After registration, the app container is ready to move into production. Instead of the production app container image being updated to match the development image, the production container is stopped. The development app container image then replaces the production container and starts as the production environment. Thus, an environment switch occurs.

High Availability

Replication is the process of creating multiple copies of the production app container image and running them. This allows you to stop old currently unused production app containers and replace them with the new production app containers, which provides continual uptime for your app users. With containers and replication, the old method of shutting down your production environment to update it during a time period in the wee hours of the morning is gone.

To accomplish these tasks with container images, you need orchestration. Orchestration principles provide the tools, utilities, and guidance for implementing app container images in a fast-paced environment, such as one that uses DevOps. So in the end, the cloud, containers, orchestration, and DevOps all interact together to create the ideal application environment for today’s high-demand web world.

CHAPTER SUMMARY

Cloud computing provides an easy way to expand the computing resources for a company without having to purchase and administer your own hardware. Three levels of cloud computing each provides different services. IaaS provides hardware resources such as servers, storage, and network. SaaS runs applications from the cloud servers across the Internet. PaaS provides development environments that consist of an operating system and any libraries required to develop, test, and deliver application software.

Cloud computing environments utilize virtualization to implement many servers without lots of physical hardware. With virtualization, one large server can host multiple smaller guest systems. The hypervisor software manages the resources allocated to each guest system and manages how those resources are used. Two types of hypervisor environments are used. Type I hypervisors interact directly with the system hardware. Guest systems receive system resources directly from the hypervisor software. Type II hypervisors run on top of a host operating system. The host operating system interacts with the system hardware and provides resources to the Type II hypervisor, which in turn allocates the resources to the guest systems.

Containers are a different type of virtualization. Containers provide a consistent runtime environment for a single application. When you deploy an application into a container, the application container is guaranteed to run the same way no matter what server it runs on. By deploying applications using containers, you’re guaranteed the application will run the same way in the development, test, and production environments. Containers don’t contain as much overhead as virtual machines, making them easier to distribute.

Orchestration can involve processes in and out of the computing world, since many systems require harmonious, balanced, and coordinated procedures that achieve consistency in the results. DevOps is an IT method that benefits greatly from orchestration, including app container orchestration. The gains from these items allow such things as continuous delivery of software. Even outside of DevOps, app container orchestration is beneficial for many corporate environments.

KEY CONCEPTS AND TERMS

- Cloud

- Container

- DevOps

- Hypervisor

- Infrastructure as a Service (IaaS)

- Orchestration

- Platform as a Service (PaaS)

- Software as a Service (SaaS)

- Virtualization

CHAPTER 12 ASSESSMENT

1. Which cloud service method utilizes only servers owned and operated by a third party?

1. Private

2. Public

3. Hybrid

4. Type II

2. If a company currently runs a cloud on internal servers but needs some extra processing power to run a new application, what method of cloud service could they use?

1. Private

2. Public

3. Hybrid

4. Type I

3. Mary is interested in developing her application in the cloud without having to worry about administering an operating system. What type of cloud service should she buy?

1. PaaS

2. Private cloud

3. IaaS

4. SaaS

4. Which type of cloud service allows you to spin up your own operating systems?

1. PaaS

2. Private cloud

3. IaaS

4. SaaS

5. Which type of hypervisor interfaces directly with the host system hardware?

1. Private

2. Public

3. Type II

4. Type I

6. Sam already has installed Red Hat Linux on his server but now needs to install virtual machines. What type of hypervisor package should he use?

1. Private

2. Public

3. Type II

4. Type I

7. Which type of hypervisor template bundles all of the configuration files into a single file for distribution?

1. XML

2. JSON

3. VA

4. OVF

8. Jane wants to package her application so that it’s guaranteed to run the same way no matter what Linux distribution his customers use. How can she do this?

1. Package the application as a container

2. Package the application as a hypervisor

3. Deploy the application to a private cloud

4. Deploy the application as a virtual machine

9. Which of the following orchestrated container attributes best provides high availability to an app user?

1. Documentation

2. Version control

3. Replication

4. Automation

10. In DevOps and container orchestration, non-hardware items such as the operating system and libraries and security policies are documented within the orchestration tool, implemented into the desired environment, and are called what?

1. Build automation

2. A development environment

3. A container

4. Infrastructure as code

Resources

Docker Documentation, “What is a Container?” Accessed on Jan. 29, 2022, from https://www.docker.com/resources/what-container.

Red Hat Documentation, “Understanding Cloud Computing,” Accessed on Jan. 29, 2022 from https://www.redhat.com/en/topics/cloud.

Red Hat Documentation, “Understanding DevOps,” Accessed on Jan. 29, 2022, from https://www.redhat.com/en/topics/devops.

Resources

Docker Documentation, “What is a Container?” Accessed on Jan. 29, 2022, from https://www.docker.com/resources/what-container.

Red Hat Documentation, “Understanding Cloud Computing,” Accessed on Jan. 29, 2022 from https://www.redhat.com/en/topics/cloud.

Red Hat Documentation, “Understanding DevOps,” Accessed on Jan. 29, 2022, from https://www.redhat.com/en/topics/devops.

© Picsfive/Shutterstock

APPENDIX A

Answer Key

CHAPTER 1 Linux Basics

1. A  2. B  3. C  4. A  5. C  6. A  7. D  8. A  9. B  10. D

CHAPTER 2 Linux and Software

1. A  2. B  3. B, C  4. C  5. A  6. D  7. A  8. C  9. D  10. A

CHAPTER 3 Linux and Hardware

1. B  2. D  3. A, C  4. B  5. B  6. A  7. A  8. C  9. D  10. A

CHAPTER 4 Booting Linux

1. A  2. C  3. B  4. A  5. D  6. A  7. C  8. B  9. D  10. A

CHAPTER 5 Disk Management

1. A  2. B  3. E  4. C  5. B  6. A  7. D  8. B  9. B  10. A

CHAPTER 6 Command Line Basics

1. D  2. A  3. B  4. A  5. C  6. A  7. A  8. B  9. C  10. A

CHAPTER 7 File Management

1. B  2. C  3. A  4. A  5. A  6. B  7. A  8. D  9. B  10. A

CHAPTER 8 Networking Concepts

1. A  2. E  3. A  4. E  5. B  6. B  7. A  8. B  9. E  10. C

CHAPTER 9 Managing Processes

1. B  2. E  3. C  4. A  5. C  6. B  7. C  8. D  9. E  10. C

CHAPTER 10 Advanced Administration

1. C  2. A  3. D  4. B  5. A  6. A  7. A  8. B  9. B  10. A

CHAPTER 11 Linux Security

1. A  2. C  3. B  4. C  5. A  6. C  7. B  8. B  9. A  10. A

CHAPTER 12 Linux in the Cloud

1. B  2. C  3. A  4. C  5. D  6. C  7. C  8. A  9. C  10. D

© Picsfive/Shutterstock

Glossary

/dev/disk/by-id A directory that contains persistent links to storage device partitions based on their manufacturer information.

/dev/disk/by-label A directory that contains persistent links to storage device partitions based on their label.

/dev/disk/by-path A directory that contains persistent links to storage device partitions based on their hardware connection.

/dev/disk/by-uuid A directory that contains persistent links to storage device partitions based on their Universal Unique ID.

/dev/mapper A directory that contains raw device files that point to dynamic and virtual partitions created by LVM and multipath.

/etc/crypttab A configuration file that contains entries identifying encrypted storage device partitions Linux should mount at boot time.

/etc/fstab A configuration file that contains entries identifying the storage device partitions Linux should mount at boot time.

/etc/mstab A dynamic file that identifies the currently mounted partitions on the Linux system.

/proc/mounts A kernel-generated file that contains information about the currently mounted partitions and their location in the virtual directory.

/proc/partitions A kernel-generated file that contains information about the currently mounted partitions on the Linux system.

/sys/block A kernel-generated file that contains information about the block devices on the Linux system, including any mounted partitions.

Absolute filepath A filepath that contains the full path to a file, starting at the root directory.

Absolute path A directory or file path name that represents the location of the directory or file based on the root directory of the virtual directory.

Administration user account A user account that has full privileges on a Linux system.

Aliases Alternative names that can be used to receive email for a user account on an email server.

Apache Open-source web server commonly used in the Linux environment.

AppArmor A package used mostly in Ubuntu distributions for applying MAC-based permissions to files.

Application container Creates an environment where all of the files required for an application to run are bundled together, including runtime library files.

apropos A program that displays application documentation using advanced features such as links.

apt Command-line package manager program for Debian-based systems that can automatically install packages from the repository.

Asterisk A globbing character that matches zero or more characters in the file name.

Asymmetric encryption Applies encryption to files by utilizing a secret private key and a public key that can be made known to others.

at A command that allows you to schedule when a program should start.

atq A command that lists the jobs scheduled to start.

atrm A command that removes jobs scheduled to start.

aulast A utility for displaying the login activity for user accounts on the system.

Bash The most common Linux shell.

Basic Input/Output System (BIOS) A firmware that controls how an IBM-compatible system starts.

bg a command that restarts a stopped job in background mode.

blkid A utility in the e2fsprogs package that displays information about block devices, such as storage drives.

Block device file A type of device file that sends and receives data in multi-byte blocks.

Block devices Hardware devices that send data in block chunks to the system.

Boot loader A small program that launches the operating system at startup.

Boot manager A small boot loader program built into UEFI that controls which boot loader program to run.

btrfs A Linux file system that utilizes journaling and has increased performance.

cd A command to change the current directory for the command line.

chage Changes password properties for user accounts.

Chainloading The process of running a secondary boot loader from a primary boot loader.

Character device file A type of device file that sends and receives data 1 byte at a time.

Character devices Hardware devices that send data one character at a time to the system.

Chattr A utility in the e2fsprogs package that allows you to change attributes of files.

Chromium The open-source version of the Google Chrome browser.

CIFS The Common Internet File System, provides a protocol for accessing shared drives on a network.

Cinnamon A Linux desktop project started by the Linux Mint distribution.

Cloud A network of distributed applications running on separate servers.

Cold pluggable A hardware device that must be installed or removed when the system is powered off.

Collection Consists of documents which contain the individual data elements.

Command completion Allows you to begin typing a command or program and hit the Tab key to view commands and programs that match.

Command line interface (CLI) Provides an interactive interface for submitting commands to the kernel and displaying output from programs.

Command prompt A symbol used to prompt you to enter commands to the shell.

Common Unix Print System (CUPS) A program for providing a common interface for printing in Linux environments.

Compiled device driver Software compiled into the kernel software for hardware devices.

Compressed directory A Windows feature for creating zip files.

configure Program to run that determines the requirements for compiling an application.

Console A text-based interface to the Linux system.

Container An environment where all of the files necessary to run an application are bundled together in a single package to install as a whole.

Core Linux distribution A bundle of the Linux kernel, one or more graphical desktop environments, and most Linux applications.

Coreutils A GNU software package that contains utilities for file handling, text manipulation, and managing processes.

Cp Command to copy a file on the Linux system.

Cron A program that runs jobs at a pre-defined time and date

cryptsetup The utility used in LUKS For formatting, opening, and closing encrypted partitions.

date Display or change the time and/or date on a Linux system.

debugfs A utility in the e2fsprogs package that allows you to manually view and modify a file system structure.

Default.target A Systemd target that defines what unit files to start when the system boots.

Dependencies Packages that are required for another application package to run.

Device driver Small piece of software written to interact with a specific hardware device.

Device files Special files used by the Linux system to send and receive data with a hardware device.

DevOps A methodology for creating, deploying, and maintaining applications.

df A utility for displaying the utilization of drive partitions currently mounted on the Linux system.

dig A Linux command that displays DNS records for a servers in a domain.

Direct memory access (DMA) A system that allows hardware devices to store data directly in memory locations for the CPU to read.

Discretionary access control (DAC) The ability of users to define their own permissions to files and directories.

Distribution The bundling of a kernel, graphical desktop, and multiple applications into one package.

dm-multipath A Linux kernel module that supports multipath storage device access.

Dnf An updated version of yum with some additional features documents that contain the individual data elements.

Dolphin A graphical file manager program used in KDE desktops.

Dpkg Low-level command line package manager program for Debian-based distributions.

Drive letters An alphabetic letter designation used by Microsoft to indicate the device a file or directory is stored on.

Driver code Low-level programming code designed for the kernel to pass data back and forth with a device.

du A utility that displays the current files and space used by directories in the virtual directory structure.

dumpe2fs A utility in the e2fsprogs package that displays low-level block and superblock information about a storage device.

e2label A utility in the e2fsprogs package that allows you to modify the label assigned to a partition formatted with the ext file system.

ecryptfs A Linux file system that supports real-time file encryption.

EFI System Partition (ESP) The disk partition that stores boot loader files on a UEFI system.

Environment variables Memory locations in the shell that allow you to store values.

Escaping Placing a backslash (\) in front of a character so the shell interprets it as data and not a special command or character.

ethtool A Linux command that displays or sets Ethernet parameters on a network interface.

Evolution Graphical email client program used in GNOME desktop distributions.

Execute The permission that allows user accounts to run an application file.

eXim An open-source email server application that uses a simplified configuration file.

export Convert a local environment variable to a global environment variable.

ext3 The third version of the original Linux ext file system. It provides journaling capabilities for minimizing data loss after a server crash.

ext4 The current version of the original Linux ext file system. It incorporates journaling and additional performance enhancements.

Extended partition A partition method used by MBR drives to expand the number of partitions available on a storage device.

Extensible Firmware Interface (EFI) Created by Intel in 1998 to replace the BIOS.

External commands External programs and utilities that run on the Linux system.

fdisk A utility that allows you to partition MBR drives.

fg A command that restarts a stopped job in foreground mode.

File A command that displays the file type of the specified file.

File Allocation Table (FAT) A disk filesystem created by Microsoft.

File system A method of organizing files and directories on a Linux partition to help with storage and retrieval.

File system hierarchy standard (FHS) A Linux standard that specifies a virtual directory structure for organizing system and user files.

Files An open-source file manager program used in GNOME desktop distributions.

Find A versatile command that can search for files based on various file properties.

Firefox Graphical browser application available for multiple operating systems.

firewalld A package used mostly in Red Hat-based distributions for creating network firewalls.

Flatpack Application container format was created as an independent open source project with no direct ties to any specific Linux distribution.

Forwarding The ability to redirect email messages to another location.

Fsck A utility for analyzing and repairing Linux file systems.

Full-word parameters A word option used to modify the behavior of a command.

gcc A C and C++ program compiler for Linux created by the GNU project.

Gdisk A utility that allows you to partition GPT drives.

General purpose I/O Provides multiple digital input and output lines for receiving digital data and sending digital signals.

Ghostscript An open-source project to read and manage postscript files.

Global environment variable Stored data that can be accessed by any child process the shell spawns.

Globbing Using a wildcard character to specify one or more-character patterns to match in a filename.

GNOME Terminal The terminal emulation package used in GNOME desktops.

GNU (GNU’s Not Unix) An open-source project for porting Unix utilities for other operating systems.

GNU IceCat An open-source browser derived from the Firefox graphical browser.

GNU Network object model environment (gnome).

GNU Privacy Guard (GPG) A program for encrypting files.

gparted A graphical tool for easily viewing and modifying the partition on MBR and GPT drives.

Grand Unified Boot Loader (GRUB) Legacy An updated Linux boot loader that provided more robust features than LILO.

Group A set of user accounts that are granted the same permissions to files and folders.

Group permissions Set of access permissions applied to a file or directory for a specific user group.

GRUB2 An improved version of GRUB Legacy that can load hardware device drivers and use logic to dynamically alter the boot menu options.

GUID Partition Table (GPT) A system for organizing storage device partitions on a UEFI system.

gzip The Linux utility to compress files and directories.

Hard disk drive (HDD) A storage device that utilizes multiple disk platters and a read/write arm for magnetically storing persistent data.

Hard link Two files or more files that point to the same inode number

help A command to display information about shell built-in commands.

Hidden files Files that don’t appear in a standard directory listing.

Hierarchical File System (HFS) The default file system used for Apple macOS.

History file A file that stores each command entered into the command line from a session.

host A Linux command that displays the IP address of a specified host name, or the host name for a specified IP address.

Hot pluggable A hardware device that can be installed or removed while the system is powered on and running.

Hypervisor Manages the host physical resources between multiple virtual machines.

I/O ports Sections in memory where hardware devices can send and receive data from the CPU.

ifconfig A Linux command for displaying or setting the network address information for a network interface.

info A newer program to display application documentation.

Infrastructure as a Service (IaaS) The cloud provides low-level server resources to host applications.

init The initial program started by Linux that starts all other programs running on the system.

Init process|The first process started by the kernel at boot time, which is responsible for starting all other processes on the system.

Initialization process The process of starting background programs on the Linux system.

Inline input redirection Changes the input to an application to the command line.

Inode A special file that contains properties of a file on the Linux system.

Inode number A number assigned to each inode, unique for each disk partition.

Inode table A listing that matches inodes to each file on the disk partition.

Input redirection Changing the input to an application to a file.

insmod Installs a device module file into the kernel.

Internal commands Commands built into the shell for interacting with the kernel.

Internet Control Message Protocol (ICMP) A standard protocol for sending control packets to a remote device for testing and network information.

Interrupt requests Signals the CPU that a hardware device wants to send data.

iostat A utility to display a real-time chart of drive statistics based on partitions.

ip (command) A Linux command for displaying or setting IP network information on a network interface.

iproute2 An open-source collection of command-line tools for displaying and managing network configuration settings.

ISO image file |A copy of all the files contained on a DVD stored as a single file.

ISO-9660 A file system used for storing data on optical CD ROM devices.

jobs A command that controls processes running in background.

journalctl The systemd program for reading the log files created by the systemd-journald program.

Journaling A file system method that logs transactions separately so that any uncommitted transactions can be recovered in case of a system crash.

K Desktop Environment (KDE) A Linux graphical desktop released in 1996, similar to the Microsoft Windows environment.

KDE Plasma The branding of the current version of the K desktop environment.

Kernel The core Linux software that controls all of the hardware and software on a computer system.

Kernel modules Allows you to insert device driver code into a running kernel without having to recompile the kernel.

Kernel ring buffer A circular buffer in memory that contains boot messages.

Key mode The ability to log into a remote server using a public/private key pair.

kill sends a signal to a running process to pause or stop it.

KMail An email client designed by the KDE project.

Konsole The terminal emulation package used in KDE desktops.

kpartx A utility that configures multipath access to storage devices.

LibreOffice An open-source office productivity application common in Linux distributions.

Lighttpd A lightweight web server used in Linux distributions intended for low-power workstations.

Line Printer Daemon (LPD) A legacy printing method used in BSD Unix and implemented in Linux.

Link local address An ipv6 address assigned automatically to a device on a local network so it can communicate with other local devices without requiring to obtain a network address.

Links Virtual copies of a physical file.

Linux Loader (LILO) The original Linux boot loader program.

Linux Unified Key Setup (LUKS) A tool created for applying encryption to Linux partitions.

LiveDVD A self-contained ISO image file that can be burned onto a DVD disk or USB stick to boot up a Linux system directly.

Local environment variable Stored data that can only be accessed by the shell that defines them.

Local loopback interface A virtual network interface provided to allow applications to communicate internally using network protocols.

Locate A command that uses a database to quickly locate programs on the Linux system.

Logical volume manager (LVM) A method of creating and maintaining virtual storage volumes from one or more physical partitions. It allows you to dynamically add or remove partitions within the file system.

ls The list command, used to list files and folders on the system.

lsblk A command line utility that displays current partition sizes and mount points.

lsmod Command to list device modules installed in the kernel.

lspci A Linux program to displaying PCI boards connected to a system.

lsusb Lists information about the USB devices connected to the Linux system.

lvcreate A command line utility that creates logical volumes.

Lynx A command line text-based browser often used in screen-scraping text from websites in scripts.

Mail Delivery Agent (MDA) Receive incoming mail messages from an MTA and ensure they go to the correct local user mailbox.

Mail Submission Agent (MSA) Accept email messages from local users and submit them to the MTA for delivery to the proper user.

Mail Transport Agent (MTA) Send messages to remote servers and receive messages from remote servers.

Mail User Agent (MUA) Provide an interface for users to read their messages and send new messages.

Make A command line program used to compile application source code.

man A program that displays documentation about installed applications.

Mandatory access control (MAC) The ability of the system administrator to assign permissions to files and directories.

MariaDB An open-source relational database that supports advanced database features.

Master Boot Record (MBR) A system for organizing storage device partitions on a BIOS system. The first sector on a hard drive partition that contains the boot loader program.

MATE A Linux graphical desktop environment created in 2011 for Arch Linux.

mdadm A command line utility for working with multipath storage devices.

Memory management The ability to control how programs and utilities run within the memory restrictions of the system.

mkdir Command to create a new directory.

mkfs A command line utility for creating file systems.

modprobe Installs and removes device module files into the kernel.

Modules Device software that can be inserted into a running kernel.

MongoDB An open-source database that uses the nosql database format.

mount A command line utility for mounting partitions within the virtual directory structure at a mount point.

Mount points A directory within the virtual directory used as a mount point for partition file systems. Directories in the virtual directory where you assign additional storage devices

Mounting The process of adding the file system contained on a partition to the Linux system’s virtual directory structure.

Multipath The ability to define multiple paths to a storage device. The multiple paths can be aggregated to provide more bandwidth, and provide fault-tolerance if one path goes down.

multipathd A background process that monitors connections for multipath storage devices.

Multi-user operating system A computer systems that allows multiple users to log in simultaneously and submit programs.

mv Command to move (rename) a file on the Linux system.

MySQL An open-source relational database that is fast but doesn’t support many advanced features.

netstat A Linux command for displaying open network ports on the system, as well as network statistics.

Net-tools A legacy open-source collection of command-line tools for displaying and managing network configuration settings.

Network device file Also called a socket file, used to easily send packets of data to devices, usually network cards.

Network File Sharing (NFS) An open-source application used to share files from a Linux server with other Linux servers.

Network Manager A set of both graphical and command-line tools for defining network interface settings.

Network Time Protocol (NTP) A standard protocol for sharing the time across multiple devices on a network.

NginX An open-source web server for Linux commonly used in environments that require load balancing between multiple servers.

nice A command to specify the priority of a program when started.

nmcli A command line tool for defining network interface settings.

nmtui A text-based menu tool for defining network interface settings.

Nodes A special file in Linux for communicating with a device on the system.

nohup A program that runs a command and blocks any SIGHUP signals sent to it.

nologin A utility used as the default shell for user accounts that shouldn’t log into a command line.

Normal user account A user account that does not have permissions to system files and folders, but only to the user files and applications.

NoSQL Databases can handle large quantities of data by foregoing the structured database tables of SQL relational databases and instead store data as structure-less collections.

New Technology File System (NTFS) The file system used by Microsoft workstations and servers.

Open-source software (OSS) A licensing concept for programmers to release software with no restrictions attached on its use.

OpenOffice.org The original open-source office productivity application for Linux and other operating systems.

OpenSSH An Open-source program for securely sending data across a network.

Opera A commercial (but free) web browser program for Linux.

Orchestration Tools that allow you to automate configuration, management, and coordination of containers.

Orphan file A file whose owner user account no longer exists on the system.

Other permissions The set of file or folder permissions that apply to all other user accounts on the system that aren’t the owner or in the default group for the file or folder.

Output redirection Changing the output of an application from the standard output to a file.

Owner permissions The set of file or folder permissions that apply to the owner of the file or folder.

Package A bundle of files required for an application. The package allows users developers to distribute an application as a single file.

Package management system A system for tracking which applications are installed on a Linux system.

Pages Blocks of memory that are allocated by the kernel.

Parallel Advanced Technology Attachment (PATA) An older storage device connection method that utilizes parallel connections.

Parted A command-line utility for partitioning storage devices, supported by the GNU project.

Partition A subsection of a hard drive that can be formatted to support a file system.

passwd A command-line utility for changing the password for a user account.

Password mode The method of using a password to log into a remote system.

Peripheral Component Interface (PCI) A standard for communicating with hardware boards.

Persistent device files Files located in the /dev/ disk directory that always point to the same storage device, based on manufacturer id, system label, connection path, or UUID value.

ping A command line tool for testing connectivity to remote systems using the ipv4 protocol.

ping6 A command line tool for testing connectivity to remote systems using the ipv6 protocol.

Piping Redirecting the output of one command to the input of another.

pkill sends a signal to a running process, specified by name, to pause or stop it.

Platform as a Service (PaaS) The cloud provides a complete computer environment for software development and deployment.

Plug-and-Play System for automatically configuring hardware on IBM-compatible PCs.

Postfix An open-source email server application that uses simplified configuration files.

PostgreSQL An open-source relational database that supports advanced database features.

Postscript Printer Definition (PPD) A set of rules that define how Linux should handle a Postscript file for a printer.

Postscript protocol A formatting language that defines how the printer displays text and graphics.

Power-on self-test (POST) The firmware performs a quick check of the hardware.

Primary partition One of four main partitions that you can create on an MBR drive.

Private key The part of an asymmetric encryption key pair that you must keep and not share with others.

proc directory Virtual directory that displays information about the kernel.

Process a running program on the Linux system.

Procmail An MDA program that allows the mail administrator to customize mail delivery to users.

ps A command to display a snapshot of the running processes at a specific time.

Public key The part of an asymmetric key pair that you share with others who need to send you encrypted files.

pvcreate A command line utility for defining physical volumes in an LVM setup.

qMail An open-source email server that is maintains high-reliability in case of system crashes.

Question mark A globbing character that matches one character in the file name.

Quoting Placing quotes around a filename that contains spaces.

RAID 0 A data storage method that utilizes disk striping to spread data across multiple drives to increase performance.

RAID 1 A data storage method that utilizes mirroring by duplicating data across two drives.

RAID 10 A data storage method that utilizes mirroring and striping of data across multiple drives.

RAID 4 A data storage method that utilizes striping with a parity bit on a separate drive, allowing the system to recover if a single data drive fails.

RAID 5 A data storage method that utilizes data striping with distributed parity, allowing the system to recover if any of the drives fails.

RAID 6 A data storage method that utilizes striping with double parity, allowing the system to recover if two drives fail.

Raw device A file created by the Linux kernel to directly reference data stored on a storage device.

Read The ability to access the data in a file or folder.

Redundant Array of Inexpensive Disks (RAID) A method of utilizing multiple drives to store data for fault tolerance and increased performance.

reiserFS An advanced Linux file system that utilizes journaling and advanced performance techniques. No longer supported by the Linux kernel.

Relative filepath A filepath that points to a file or directory relative to the current location.

Relative path A method of referencing file and directory names based on the current location of the shell.

renice a command to change the priority of a running program.

Repository A collection of software packages for a specific Linux distribution.

resize2fs A utility in the e2fsprog package for resizing ext file systems.

rm Command to remove a file from the Linux system.

rmdir Command to delete an existing empty directory.

rmmod Removes a device module from the kernel.

Root The base directory in the virtual directory.

Root directory The base of the Linux virtual directory.

Root drive The physical device that contains the core of the virtual directory.

Root user The default administrator account for Linux systems.

rpm The core Red Hat package manager program.

runlevels Administrative levels used by Linux systems to control which programs should be running.

Samba An open-source file sharing server that can interface with Windows workstations and servers.

scp The secure copy program which copies a file between systems using an encrypted protocol.

Secure Shell (SSH) A protocol for encrypting communication between two network servers.

Security context A policy for defining who or what has permissions to an object.

SELinux A package used mostly in Red Hat-based distributions for applying MAC-based permissions to users, files, and processes.

Sendmail The original Unix email server, sometimes used in the Linux environment.

Serial Advanced Technology Attachment (SATA) A storage device connection method that utilizes high speed serial data transfer.

Service account A user account that can run programs in background, but not log in at a command line or graphical desktop.

sftp A standard protocol for sending and receiving files from a remote server using encryption.

Shell The middleman between the kernel and the user.

Shell script A series of shell commands saved in a file that can be run as a program from the command line.

Simple Mail Transport Protocol (SMTP) A standard protocol for exchanging mail between two email servers.

Single-letter parameter A single letter option used to modify the behavior of a command.

Small Computer System Interface (SCSI) An advanced storage device connection method that allows multiple storage devices to connect to a single serial data connection.

SMB The Server Message Block, a network protocol developed by Microsoft and used for accessing network devices.

Snap Packaging system bundles all the files required for an application into a single snap distribution file.

snapd Application runs in background, and you use the snap command line tool to query the snap database to display installed snap packages, as well as to install, upgrade, and remove snap packages.

Software as a Service (SaaS) The cloud provides both a physical server and operating system environment.

Software package A collection of an application's executable files, library files, and configuration files bundled into one archive file.

Solid-state drive (SSD) A storage device that utilizes an integrated circuit to persistently store data.

ss A command line tool for displaying open network ports on the system, as well as the processes that are using them.

Standard input The default input device (usually the keyboard) in a virtual terminal.

Standard output The default output device (usually the monitor) in a virtual terminal.

su A program for changing your current login account to another account on the system. Commonly used for gaining root privileges on the system.

Sudo A program for running an application with root permissions.

sudoers A file for defining what users, aliases, or groups have the ability to use the sudo command.

Swap A Linux file system type that allows the system to utilize the drive partition as additional memory space.

Swap space Space on a hard disk allocated for storing the contents of virtual memory.

Symbolic link Two or more files that reference a single physical file.

Symbolic mode The method of specifying permissions using characters for files and folders.

sys directory Virtual directory that displays information about hardware connected to the system.

syslogd The legacy Linux program for logging events in log files.

system An initialization process created by Red Hat Linux that uses targets instead of runlevels.

systemd-journald The Systemd program for logging events in log files.

SysVinit The original Unix initialization process program ported to the Linux environment.

tar The Linux utility to archive files and directories.

Tarball Package uses the tar command to archive multiple files into a single file (either with or without compression).

Target Represents a group of services that should be running in the systemd initialization method.

Telnet A legacy program for connecting to a remote system using plain text that can be captured and viewed on the network.

Terminal emulation Provides a CLI contained within a window in a graphical desktop environment.

Thunderbird An open-source email client created by Mozilla.

touch Command to create an empty file or modify the access time on an existing file.

top A real-time display of running processes.

tune2fs A utility in the e2fsprogs package that allows you to change parameters of ext file systems.

Tunneling The ability to provide an encrypted connection between two servers that any application can use to send data.

udev A background process that monitors for connected devices and automatically generates /dev raw devices for them.

umount A command line utility for removing a partition file system from the Linux virtual directory structure.

Unified Extensible Firmware Interface (UEFI) Newer firmware to control how an IBM-compatible system starts.

Unit A service or action defined on a Systemd initialization system.

Unit files A configuration file that defines the programs to start when a specific event occurs.

Universal Disc Format (UDF) The Universal Disc Format, a file system used for storing data on optical DVD Rom drives.

Universal Serial Bus (USB) A protocol and hardware standard for connecting hardware to a computer system.

updated A command that runs in background to populate the locate database.

User accounts Uniquely identify individual users on the Linux system.

useradd A utility for adding new user accounts.

userdel A utility for deleting existing user accounts.

usermod A utility for modifying existing user accounts.

VFAT The Virtual File Allocation Table, a file system developed by Microsoft for use on Windows systems.

vgcreate A command line utility for creating volume groups as part of an LVM setup.

Virtual directory The method utilized by Linux systems to combine file systems from one or more partitions into a single directory structure.

Virtual File System (VFS) Provides a standard interface used by the Linux kernel to interface with different filesystems.

Virtual memory Memory reserved on a hard drive and treated as real memory.

Virtual terminal A CLI session that runs in memory on the Linux system.

Virtualization The ability to run multiple servers on a single hardware platform.

Wayland A modern X Window implementation for Linux that is more secure than the original X.org and easier to maintain.

whereis A command that looks for commands in specific folders on the system.

which A command that finds both external and built-in programs on the Linux system.

whois A command-line tool that connects to the centralized Internet registry to display information about a registered domain.

Write The permission for being able to modify a file or folder.

X Window A low-level program that works directly with the video card and monitor on a workstation, and controls how Linux applications interact with them.

X.org An older X Window implementation for Linux.

XFS The X File System, a file system developed by Silicon Graphics for use on their workstations and servers.

xfs_admin A command line utility for displaying and modifying information in an xfs file system.

xfs_info A command line utility for displaying information from an xfs file system.

xterm A generic terminal emulation package that works in multiple desktop environments.

Yum A command line package manager program used by Red Hat-based Linux distributions.

ZFS The Zettabyte File System, a file system developed by Sun Microsystems for its Unix workstations and servers.

Zypper The package management system used by openSUSE.

© Picsfive/Shutterstock

Index

NOTE: Page numbers followed by f and t indicate material in figures and tables respectively.

A

aa-complain command, 279

aa-disable command, 279

aa-enforce command, 279

aa-status command, 277–278

aa-unconfined command, 278–279

absolute filepaths, 157–158

absolute path, 106

access control list (ACL), 244–246

firewalls, 281–287

administration user accounts, 233–234

aliases, 255

AllowTcpForwarding configuration, 256

Apache web server, 28

AppArmor MAC system, 265

application containers, 41–42

flatpak container, 44–45

snap container, 42–43

apropos, 129

ash shell, 121

asterisk glob character, 174, 175

asymmetric encryption, 256

at command, 223–226

atq command, 225–226

atrm command, 226

audio cards, 59

aulast command, 270

B

bash shell, 17, 121

Basic Input/Output System (BIOS), 76–77

Berkeley Software Distribution (BSD), 249

style parameters, 210

bg command, 222–223

BIOS. Basic Input/Output System

blkid tool, 111

block device files, 8, 61

bluetooth devices, 59

boot loader program, 76, 77

EXTLINUX, 83

GRUB2, 78, 81–82

GRUB Legacy, 78–81, 79t

ISOLINUX, 83

Linux Loader, 78

MEMDISK, 83

PXELINUX, 83

SYSLINUX, 83

boot manager, 77

boot process

boot loader (boot loader program)

firmware startup

BIOS, 76–77

UEFI, 77–78

initialization process, 83–84

systemd, 84, 87–92

SysVinit, 84–87

kernel ring buffer, 74–76

procedural steps, 74

Bourne shell, 17

btrfs Linux file system, 106

C

cat command, 61

chage command, 236

chainloading method, 77, 81

change directory (cd) command, 157

character device files, 8, 61

chattr tool, 111

chmod command, 142

Chromium browser, 25

Cinnamon desktop, 15, 15f

CLI. command line interface

cloud computing, 292–293, 293f

containers (containers)

IaaS model, 293, 294f

PaaS model, 294–295, 295f

SaaS model, 294, 294f

virtualization, 295–298

cold pluggable devices, 69

command completion, 130–131

command line interface (CLI), 17–18, 119, 120

console, 123

shell (shells)

terminal emulation package, 126–127, 127f

virtual terminals, 124–126, 125f

command-line tools

for network connections

DHCP client program, 196–197

iproute2 package, 191–193, 192t

net-tools package, 193–196

Network Manager tool, 190–191, 190f

command prompt, 17, 122–123, 124t

command substitution, 145–146

Common Unix Printing System (CUPS)

configuration, 249–250

defined, 249

LPD commands, 250, 251t

web interface, 250, 250f

compiled device driver, 52

compressed directories, 179

configuration, 29

console, 123

running programs without, 219–220

containers

agent and agentless, 302–303

application, 41–42

flatpak container, 44–45

snap container, 42–43

application in, 299, 299f

automated configuration management, 302

creating, 300

defined, 299

design, 301

DevOps, 304–306

document, 301

life cycle, 301, 302f

monitoring, 303

orchestration engines, 303–304

software, 300

templates, 300

troubleshooting process, 301

version control, 301

control command, 69

core Linux distribution, 18–19, 18t

coreutils package, 11

cp command, 168–171, 170t

cron program, 226–228

cron.service configuration file, 88–89

crontab command, 227

cryptsetup command, 279, 281

CUPS. Common Unix Printing System

D

dash shell, 121

database server, 28

data collections, 28

date and time management, 247–249

date command, 132, 247

Debian-based package management system, 30

apt tool, 30

installing software packages with, 33–35

managing packages with, 31–33

uninstalling software with, 37–38

upgrading software with, 35–36

dpkg command, 30

debugfs tool, 111

default command, 92

default.target target, 7, 90

dependencies, 29

desktop applications, 24

email client, 25–26, 27f

file management, 26, 27f

office productivity, 24, 25f

web browser, 25, 26f

/dev directory, 60–61

/dev/disk/by-id directory, 98

/dev/disk/by-label directory, 98

/dev/disk/by-path directory, 98

/dev/disk/by-uuid directory, 99

device driver

compiled, 52

defined, 52

modules, 53

installing new, 55–58

listing installed, 53–55

removing modules, 58

device files, 8–9

device interfaces

GPIO interface, 59–60

PCI, 58–59

USB, 59–60

Device Mapper Multipathing (DM-multipathing), 112–113

/dev/mapper device file directory, 112

DevOps, 304–306

df tool, 111

dig command, 200–201

direct memory access (DMA) channels, 63

directory handling, in files, 166–168

discretionary access control (DAC) methods, 272

disk management

automatic drive detection, 98–99

drive connections, 97

file system (file system)

overview of, 95–96

partitioning drives, 98

partitioning tools

fdisk command, 99–100, 100t

gdisk program, 101, 102t

GNU parted program, 101–102

graphical tools, 103

storage devices

Logical Volume Manager, 113–114, 113f

multipath device, 112–113

RAID technology, 114

distribution

core Linux distribution, 18–19, 18t

defined, 18

derivative Linux, 19–20, 19t

DLL hell, 299

dmesg command, 74–76

dm-multipath tool, 112

Docker container package, 300

Docker Swarm, 304

document container, 301

documents, 28

Dolphin file manager, 26

dpkg package management system, 30

drive letters, 95

driver code, 8

dumpe2fs tool, 111

du tool, 111

Dynamic Host Configuration Protocol (DHCP) client program, 196–197

E

echo command, 137, 138, 143–144

ecryptfs Linux file system, 106–107

EFI System Partition (ESP), 77

e2fsprogs package, 111

e2label tool, 111

email administration, 251

architecture, 252–253, 253f

client packages, 253–254, 254f

redirecting mail delivery, 255

server programs, 253, 253t

email client, 25–26, 27f, 253–254, 254f

email server, 29, 253, 253t

environment variables, 136

global, 136–138, 140

local, 138–140

removing, 140–141

escaping files, 176

/etc/bashrc file, 122

/etc/crypttab file, 110

/etc/fstab file, 109–110

/etc/mstab file, 110

/etc/passwd file, 121

ethtool command, 193–194

Evolution email client, 25

execute permission, 239, 240, 242

eXim, 29

export command, 140

extended partitions, 98

Extensible Firmware Interface (EFI), 77

external commands, 120

external hard drives, 59

EXTLINUX boot loader program, 83

ext3 Linux file system, 107

ext4 Linux file system, 107

F

FAT32, 95

fdisk command, 99–100, 100t

fg command, 223

FHS. file system hierarchy standard (FHS)

File Allocation Table (FAT), 77

file command, 159

file compression, 179–180, 180t

file handling

copying files, 168–171

creating files, 168

deleting files, 173–174

links, 171–172

renaming files, 172–173

file links, 171–172

file management, 26, 27f

archiving files, 179–182

directory handling, 166–168

directory listing and, 162–166

directory structure, 154

features

case sensitivity, 176

quoting, 175–176

wildcards, 174–175

file type determination, 158–159

find command, 178–179, 179t

hidden files, 159–161, 160f

inodes, 161

Linux filesystem hierarchy standard, 156, 156t

locate command, 177–178

names, 159

structure, 155f, 155f

traversing directories, 157–158

whereis command, 178

which command, 177

Files file manager, 26, 27f

file system, 100, 103–104

creating, 108

defined, 9

Linux, 106–107

management, 9, 10t, 110–112

mounting, 108–110

non-Linux, 107–108

virtual directory, 104–106, 105f

file system hierarchy standard (FHS), 105, 105t, 156, 156t

find command, 178–179, 179t

Firefox, 25

firewalld program, 281–287, 283t

firewalls, network security using, 281

ACL rules, 285–287

Red Hat server, 281–283, 282f

status, 283–284

zones, 284–285

flatpak application container, 44–45

Fluxbox desktops, 16t

for command, 148

forwarding email, 255

fsck program, 111–112

full-word parameters, 164, 164t–165t

fvwm desktop, 16t

fvwm95 desktop, 16t

G

gcc package, 48

gdisk command, 101, 102t

general purpose input/output (GPIO) interface, 60

getfacl command, 245

getsebool command, 276, 277

Ghostscript program, 251

global environment variable, 136–138, 140

globbing technique, 174

GNOME desktop. GNU Network Object Model Environment desktop

GNOME Terminal package, 126

GNU IceCat browser, 25

GNU Network Object Model Environment (GNOME) desktop, 13–15, 14f, 14t

GNU Privacy Guard (GPG) package, 258–259

GNU's Not Unix (GNU) utilities, 10–11

long parameters, 210

parted program, 101–102

gparted window, 103, 103f

Grand Unified Boot Loader (GRUB) Legacy, 78–81, 79t

graphical desktops, 16t

graphical.target target, 7, 90

grep command, 129, 130f

group permissions, 240

groups, 235–236

groups command, 268, 269

GRUB2 boot loader, 78, 81–82

grub-install command, 80–81

GRUB Legacy. Grand Unified Boot Loader Legacy

GUID Partition Table (GPT) method, 77, 98

gzip command, 180

H

halt command, 87

hard disk drive (HDD), 97

hard link, 171

hardware devices, 58

/dev directory, 60–61

device driver (device driver)

direct memory access, 63

dmesg command, 66–67

GPIO interface, 59–60

hot pluggable devices, 69–70

interrupt requests, 61–62

I/O ports, 62–63

lsblk command, 65

lsdev command, 64–65

PCI, 58–59, 67–68

/proc directory, 61

/sys directory, 63–64

USB devices, 59–60, 68

hardware management, 8–9

help command, 128–129, 128f

hidden files, 159–161, 160f

Hierarchical File System (HFS), 107

history file, 130

/home directory, 104

host address, 186

host command, 199–200

hot pluggable devices, 69–70

hybrid cloud computing, 292

hypervisor, 296–297

templates, 298

Type I, 297, 297f

Type II, 297–298, 298f

I

IaaS model. Infrastructure as a Service model

ifconfig command, 194–195

if-then condition statement, 146–148

info program, 129

Infrastructure as a Service (IaaS) model, 293, 294f

initialization process

defined, 83

systemd, 84, 87–92

SysVinit, 84–87

init process, 6, 210

init program, 83

initrd command, 80

inline input redirection, 133

inode number, 161

inodes, 161

inode table, 161

input redirection, 132–133

insmod command, 55–57

internal commands, 120

internal hard drives, 59

Internet Control Message Protocol (ICMP), 197

Internet Printing Protocol (IPP), 249

interrupt requests (IRQs), 61–62

I/O ports, 62–63

iostat tool, 111

ip command, 191–193, 192t

iproute2 package, 191–193, 192t

IRQs. interrupt requests

ISO image file, 19

isolate command, 92

ISOLINUX boot loader program, 83

ISO-9660 standard, 107

iwconfig command, 196

J

job control, 220–223

jobs command, 220–223, 221t

Joe's Window Manager (JWM) desktop, 16t

journalctl program, 261

journaling, 107

K

KDE Plasma desktop, 12–13, 12f, 13t, 15

K Desktop Environment (KDE), 12

applications, 13t

Plasma desktop, 12–13, 12f, 13t, 15

kernel, 3

filesystem management, 9, 10t

GNU utilities, 10–11

hardware management, 8–9

memory management, 3–5, 4f

software program management, 6–8

Kernel-based Virtual Machine (KVM), 297

kernel command, 80

kernel module, 8, 53

installing new, 55–58

listing installed, 53–55

removing modules, 58

kernel ring buffer, 74–76

key mode, 257, 258

kill command, 215–216

KMail email client, 25–26

Konsole package, 126

kpartx tool, 112

ksh shell, 121

Kubernetes, 303–304

L

LibreOffice, 24, 25

Lighttpd web server, 28

Line Printer Daemon (LPD) print method, 249, 250, 251t

link local address, 187

links, 171–172

Linux file and directory permissions, 237

default permissions, 243–244

group, 237, 239

ownership, 237–239

permission controls, 239–241, 240f

special permissions, 241–243

Linux file system. file management

Linux Loader (LILO), 78

Linux Logical Volume Manager (LMV), 113–114, 113f

Linux system, block diagram of, 2, 2f

Linux Unified Key Setup (LUKS), 61, 279

list-units parameter, 88

LiveDVD version, 19

local environment variables, 138–140

local loopback interface (lo), 191–193

locate command, 177–178

log files

syslogd program, 259–260, 260t, 261t

systemdjournald logging system, 261

logical volume management (LVM), 61, 106

logic statements, 146–148, 147t

lsblk tool, 111

ls command, 63, 160–161

listing, 162–163

modifying listing information, 163–164

parameter list, 164, 164t–165t, 166

lsmod command, 53–55

lspci command, 67–68, 67t

lsusb command, 68, 68t

lvcreate tool, 113

LXC container package, 300

Lynx, 25

M

MAC method. mandatory access control method

mail command, 254

Mail Delivery Agent (MDA), 252, 253

Mail Submission Agent (MSA), 254

Mail Transport Agent (MTA), 252, 253

Mail User Agent (MUA), 252

make package, 48

mandatory access control (MAC) method, 273

AppArmor, 277–279

SELinux, 273–277

man program, 129

Marathon, 304

MariaDB, 28

Master Boot Record (MBR), 77, 98

MATE desktop, 15

MDA. Mail Delivery Agent

mdadm utility, 114

MEMDISK boot loader program, 83

memory management, 3–5, 4f

memory pages, 3–4

menuentry command, 81–82

Mesos, 304

mkdir command, 166–167

mkfs program, 108

modprobe command, 57–58, 57t

modules, 53

installing new, 55–58

listing installed, 53–55

removing modules, 58

MongoDB database, 28

more command, 135

mount command, 109

mounting file system, 103, 108–110

mount points, 104, 155

MSA. Mail Submission Agent

MTA. Mail Transport Agent

mtr command, 198, 199f

MUA. Mail User Agent

multipathd tool, 112

multipath tool, 112

multi-user operating system, 232

mv command, 172–173

MySQL database server, 28

N

netstat command, 202–205

net-tools legacy tool, 193–196

network device file, 9

Network File Sharing (NFS), 29

network interface cards, 59

Network Manager tool

command-line tool, 190–191, 190f

graphical tool, 188–190, 190f

networks

command-line tools

DHCP client program, 196–197

iproute2 package, 191–193, 192t

net-tools package, 193–196

Network Manager tool, 190–191, 190f

configuration files, 186–188, 186t

information to configure, 186

Network Manager tool, 188–190, 190f

troubleshooting

host information, 199–202

netstat command, 202–205

ss command, 205–206

test packets, 197–198, 199f

Network Time Protocol (NTP), 247

New Technology File System (NTFS), 95, 107

Nginx web server, 28

nice command, 215

nmcli command-line tool, 190–191

nmtui command-line tool, 190, 190f

nodes, 9

nohup command, 219

nohup.out file, 219–220

non-Linux file system, 107–108

Non-Volatile Memory Express (NVMe), 97

normal user accounts, 233

NoSQL databases, 28

nslookup command, 201

ntpd program, 247–248

O

octal mode permissions, 241–243, 242t

office productivity, 24, 25f

OpenOffice.org software package, 24

open source software (OSS), 10–11

OpenSSH, 255, 256

Open Virtualization Format (OVF), 298

Opera browser, 25

orchestration tool, 301

orphan file, 237

output redirection, 132

owner permissions, 240

P

PaaS model. Platform as a Service model

package, defined, 29

package management system, 29–30

debian-based distributions, 30–38

Red Hat-based systems, 30, 38–41

Parallel Advanced Technology Attachment (PATA), 97

partition, defined, 98

passwd command, 236, 237

password mode, 257–258

PCI. Peripheral Component Interconnect

PCI Express (PCIe) standard, 59, 67

p command, 99

Peripheral Component Interconnect (PCI), 58–59, 67–68

PermitRootLogin configuration, 256

persistent device files, 98

pgrep command, 217

ping command, 197–198

ping6 command, 197–198

piping process, 134–135

pkill command, 216–217

Platform as a Service (PaaS) model, 294–295, 295f

PnP system, 61

Postfix, 29, 253

PostgreSQL database server, 28

Postscript Printer Definition (PPD) file, 251

Postscript protocol, 251

poweroff command, 87

power-on self-test (POST), 74

Pre-boot eXecution Environment (PXE) standard, 83

primary partitions, 98

printenv command, 136–138

printer administration, 249–251

private cloud computing, 292

private key, 256, 257

/proc directory, 61

process

defined, 6, 210

init process, 210

job control, 220–223

job scheduling

cron program, 226–228

using at command, 223–226

management, 213

priority setting, 213, 215

process signals, 215–217, 216t

monitoring in real time, 212–214

running on system, 211

running programs

in background mode, 217–219

without console, 219–220

sleep mode, 211

process initialization. initialization process

process signals, 215–217, 216t

Procmail program, 253

/proc/mounts directory, 111

/proc/partitions directory, 111

Protocol configuration, 256

ps command, 7–8, 210, 212, 213, 217–219

PS1 command line prompt, 123

PS2 command line prompt, 123

public cloud computing, 292

public key, 256, 257

pvcreate tool, 113

PXELINUX boot loader program, 83

Q

qMail, 29

question mark glob character, 174–175

quoting files, 175–176

R

RAID 0, 114

RAID 1, 114

RAID 4, 114

RAID 5, 114

RAID 6, 114

RAID 10, 114

RAID. Redundant Array of Independent Disks

raw device, 97

read permission, 239, 240

reboot command, 87

Red Hat package management system (RPM), 30, 134

dnf tool, 38

installing software with, 39–40

listing installed packages, 38–39

uninstalling software with, 41

upgrading software with, 40–41

yum tool, 38

zypper tool, 38

Redundant Array of Independent Disks (RAID), 106, 114

reiserFS Linux file system, 107

relative filepaths, 158

relative path, 106

renice command, 215

repositories, 29

resize2fs tool, 111

rm command, 173–176

rmdir command, 167

rmmod command, 58

root administrator, 233

root command, 80

root directory, 104, 155

root drive, 155

rootnoverify command, 80

root user account, 266–267

route command, 195–196

rpm command, 134–135

rpm package management system, 30

runlevels, 6, 84, 85t

changing current, 86–87

checking, 86

start applications in, 85, 86t

S

SaaS model. Software as a Service model

Samba software package, 29

/sbin/nologin file, 272

scp program, 256

secure shell (SSH) login, 255

disabling root access from, 270–271

encrypting files, 258–259

key mode, 257, 258

OpenSSH package, 255–257

password mode, 257–258

security context, 274–275

Security-Enhanced Linux (SELinux), 265, 273–274

policies, 275–277

security context, 274–275

security features, of Linux

encrypting partitions, 279–281

firewalls, 281–287

mandatory access control (MAC) method, 273

AppArmor, 277–279

SELinux, 273–277

root user account, 266–267

aulast command, 270

automatic logout, 271

blocking root access, 271–272

privilege elevation status, 269–270

SSH server, 270–271

super user privileges, 267–269

SELinux. Security-Enhanced Linux

sendmail package, 29

Serial Advanced Technology Attachment (SATA), 97

server applications, 28

database server, 28

email server, 29

Network File Sharing, 29

web server, 28

service accounts, 233, 266

set command, 138

setfacl command, 245

Set Group ID (SGID), 242, 243

setsebool command, 277

Set User ID (SUID) bit, 242

sftp program, 256

shells, 17, 17t

command completion, 130–131

command line

editing commands, 131t

parameters, 122t

command prompt, 122–123, 124t

commands, 127–130

defined, 120

environment variables, 136

global, 136–138, 140

local, 138–140

removing, 140–141

external commands, 120

history file, 130

input redirection, 132–133

internal commands, 120

multiple commands, 131

output redirection, 132

redirection

input, 132–133

output, 132

pipes, 134–135

scripts (shell scripts)

starting shell, 121–122

types of, 121

shell scripts, 17, 131, 141–142

command line arguments, 145

command substitution, 145–146

displaying messages, 143–144

getting started, 142–143

logic statements, 146–148, 147t

looping commands, 148–150

variables, 144

shutdown command, 87

Simple Mail Transfer Protocol (SMTP), 253

single-letter parameters, 164, 164t–165t

Small Computer System Interface (SCSI), 97

snap application container, 42–43

snapd application, 42

Software as a Service (SaaS) model, 294, 294f

software package, 24

software program management, 6–8

solid state drive (SSD), 9, 97

sort command, 135

source code packages, 45–49

ss command, 205–206

sshd program, 256

SSH login. secure shell login

ssh program, 256

standard input, for shell, 128

standard output, for shell, 128

standard user account, 266

start command, 90

stop command, 90

su command, 234, 267, 269

sudo command, 234, 235, 267–269

sudoedit command, 269

sudoers file, 268

super user privileges, 267–269

swap file system, 107

swap space, 3

symbolic link, 171

symbolic mode permissions, 240–241

/sys/block directory, 111

/sys directory, 63–64

SYSLINUX boot loader program, 83

syslogd program, 259–260, 260t, 261t

systemctl program, 90–92, 91t

systemd initialization process method, 6, 7, 84, 87

systemctl program, 90–92, 91t

units and targets, 87–90

systemdjournald logging system, 261

systemd-timesyncd program, 248

SysVinit

initialization method, 6–7, 6t, 84–87

startup script method, 259

T

tarball package, 45, 46

tar command, 45, 46, 180–182, 181t

targets, 7, 87–90

tcsh shell, 121

Telnet protocol, 255

terminal emulation package, 126–127, 127f

Thunderbird email client, 26, 27f, 253, 254f

title command, 80

top command, 212, 212f, 213, 214t

Torvalds, Linus, 3

touch command, 168

traceroute command, 198

Transmission Control Protocol (TCP), 206

traversing directories, Linux filesystem, 157–158

tune2fs tool, 111

tunneling, 256

Type I hypervisor, 297, 297f

Type II hypervisor, 297–298, 298f

type shell built-in program, 127

U

udevadm command, 69, 70t

udev program, 69, 98–99

UEFI. Unified Extensible Firmware Interface

umask command, 243, 244, 244t

umount command, 109

Unified Extensible Firmware Interface (UEFI), 76–78

unit files, 7

units, 87–90

Universal Disc Format (UDF), 107

Universal Serial Bus (USB) interface, 59–60, 68

Unix style parameters, 210

unmounting, 103

unset command, 140–141

updatedb program, 177–178

USB interface. Universal Serial Bus interface

user accounts, 232

commands to manage, 236–237

types of, 233–234, 266

useradd command, 236, 236t

userdel command, 236, 237

user management, 232

accessing administrator privileges, 234–235

groups, 235–236

user accounts, 233–234, 236–237

usermod command, 236, 237

V

VFS. Virtual File System

vgcreate tool, 113

video accelerators, 59

virtual directory, 104–106, 105f, 108, 155

Virtual File Allocation Table (VFAT), 107

Virtual File System (VFS), 9

virtualization

defined, 295

hypervisor, 296–297

templates, 298

Type I, 297, 297f

Type II, 297–298, 298f

separating application resources, 295, 296f

server concept, 295, 296f

virtual machine monitor (vmm). hypervisor

virtual memory, 3

virtual terminals, 124–126, 125f

visudo command, 269

W

Wayland software, 12

wc command, 133

web browser, 25, 26f

web server, 28

whereis command, 178

which command, 177

while loop, 149–150

whoami command, 269

who command, 132

whois command, 201–202

wired network interface (enp0s3), 193

wireless network cards, 59

write permission, 239, 240

X

XEN Project, 297

Xfce desktops, 16f, 16t

X File System (XFS), 107, 111

X11Forwarding configuration, 256

XFS. X File System

xfs_admin tool, 111

xfs_info tool, 111

X.org package, 12

xterm package, 126

X Window software, 11–12

Z

Zettabyte File System (ZFS), 108

zsh shell, 121

A box labeled Application software is connected by two double headed arrows with another box labeled User interface (text or graphical). The box labeled Application software is also connected by two double headed arrows with another empty box. The empty box is attached with the User interface box. Two double headed arrows connect the empty box with another box labeled G N U system utilities. Each of the boxes labeled User interface and G N U system utilities are connected by two double headed arrows with another box labeled Linux kernel. The Linux kernel box is connected by four double headed arrows with another box labeled computer hardware at the bottom.

Back to Figure

Line 1: dollar cat slash proc slash mem info. Line 2: Mem Total colon 2035504 k B. Line 3: Mem Free colon 1449632 k B. Line 4: Mem Available colon 1742352 k B. Line 5: Buffers colon 25452 k B. Line 6: Cached colon 386028 k B. Line 7: Swap Cached colon 0 k B. Line 8: Active colon 166036 k B. Line 9: Inactive colon 290704 k B. Line 10: Active open parenthesis anon close parenthesis colon 51796 k B. Line 11: Inactive open parenthesis anon close parenthesis colon 128 k B. Line 12: Active open parenthesis file close parenthesis colon 114240 k B. Line 13: Inactive open parenthesis file close parenthesis colon 290576 k B. Line 14: Unevictable colon 18640 k B. Line 15: M locked colon 18640 k B. Line 16: Swap Total colon 2097148 k B. Line 17: Swap Free colon 2097148 k B. Line 18: Dirty colon 156 k B. Line 19: Write back colon 0 k B. Line 20: Anon Pages colon 63940 k B. Line 21: Mapped colon 63344 k B. Line 22: Shmem colon 1048 k B. Line 23: K Reclaimable colon 38664 k B. Line 24: Slab colon 74316 k B. Line 25: S Reclaimable colon 38664 k B. Line 26: S Unreclaim colon 35652 k B. Line 27: Kernel Stack colon 2044 k B. Line 28: Page Tables colon 1268 k B. Line 29: N F S underscore Unstable colon 0 k B. Line 30: Bounce colon 0 k B. Line 31: Write back T m p colon 0 k B. Line 32: Commit Limit colon 3114900 k B. Line 33: Committed underscore A S colon 376812 k B. Line 34: V m alloc Total colon 34359738367 k B. Line 35: V m alloc Used colon 27676 k B. Line 36: V m alloc Chunk colon 0 k B. Line 37: Per c p u colon 516 k B. Line 38: Hardware Corrupted colon 0 k B. Line 39: Anon Huge Pages colon 0 k B. Line 40: Shmem Huge Pages colon 0 k B. Line 41: Shmem P m d Mapped colon 0 k B. Line 42: File Huge Pages colon 0 k B. Line 43: File P m d Mapped colon 0 k B. Line 44: C m a Total colon 0 k B. Line 45: C m a Free colon 0 k B. Line 46: Huge Pages underscore Total colon 0. Line 47: Huge Pages underscore Free colon 0. Line 48: Huge Pages underscore R s v d colon 0. Line 49: Huge Pages underscore Surp colon 0. Line 50: Huge page size colon 2048 k B. Line 51: Huge t l b colon 0 k B. Line 52: Direct Map 4 k colon 90048 k B. Line 53: Direct Map 2 M colon 2007040 k B. Line 54: dollar.

Back to Code

Line 1: dollar space p s space a x. Line 2: P I D space T T Y space STAT space TIME space COMMAND. Line 3: 1 space question mark space S s space 0 colon 01 space slash s bin space init splash. Line 4: 2 space question mark space S space 0 colon 00 space open bracket k t h read d close bracket. Line 5: 3 space question mark space I less than space 0 colon 00 space open bracket r c u underscore g p close bracket. Line 6: 4 space question mark space I less than space 0 colon 00 space open bracket r c u underscore par underscore g p close bracket. Line 7: 5 space question mark space I space 0 colon 00 space open bracket k worker slash 0 colon 0 hyphen events close bracket. Line 8: 6 space question mark space I less than space 0 colon 00 space open bracket k worker slash 0 colon 0 H hyphen events underscore high pri close bracket. Line 9: 7 space question mark space I space 0 colon 00 space open bracket k worker slash 0 colon 1 hyphen events close bracket. Line 10: 8 space question mark space I space 0 colon 00 space open bracket k worker slash u 2 colon 0 hyphen ext 4 hyphen r s v hyphen conversion close bracket. Line 11: 9 space question mark space I less than space 0 colon 00 space open bracket m m underscore per c p u underscore w q close bracket. Line 12: 10 space question mark space S space 0 colon 00 space open bracket r c u underscore tasks underscore rude underscore close bracket.

Back to Code

Line 13: ellipsis. Line 14: 3119 space question mark space S s l space 0 colon 00 space slash u s r slash libexec slash gnome hyphen terminal hyphen server. Line 15: 3128 space p t s slash 0 S s space 0 colon 00 space bash. Line 16: 3138 space p t s slash 0 R plus space 0 colon 00 space p s space a x. Line 17: dollar.

Back to Code

Line 1: dollar l s box al s d a asterisk. Line 2: b r w box r w box box box box dot 1 root Disk 8 comma 0 Sep 10 16 colon 27 s d a. Line 3: b r w box r w box box box box dot 1 root Disk 8 comma 1 Sep 10 16 colon 27 s d a 1. Line 4: b r w box r w box box box box dot 1 root Disk 8 comma 2 Sep 10 16 colon 27 s d a 2. Line 5: b r w box r w box box box box dot 1 root Disk 8 comma 3 Sep 10 16 colon 27 s d a 3. Line 6: b r w box r w box box box box dot 1 root Disk 8 comma 4 Sep 10 16 colon 27 s d a 4. Line 7: dollar.

Back to Code

Home and trash icons are shown in the desktop. In the menu at bottom left of the desktop, favorites, applications, computer, history, and leave icons are shown at the bottom from left to right in which favorites icon is selected. Web browser, personal information manager, word processor, file manager, configure desktop, help center, and terminal icons are listed from top to bottom under the username rich.

Back to Figure

A list of icons is shown in the left ribbon from top to bottom. From the five icons shown at bottom left of the desktop, the first icon is selected. From the menu opened up, All Applications option is selected. A list of applications is shown under All Applications. A search bar is above the list. Accessories, Graphics, Internet, Office, Sound and Video, Administration, Preferences, Places, and Recent Files are the applications listed on the left of the menu. Accessibility, Account details, Applets, Archive Manager, Backgrounds, Backup Tool, Bluetooth, Boot Repair, Calculator, and Calendar are the applications listed on the right of the menu.

Back to Figure

Icons are listed in the left ribbon of the desktop from top to bottom. An icon at bottom left of the desktop is selected which opens up a menu of icons. The username is indicated as rich on the top of the menu. A search bar is below the username. Run Program, Conky Toggle, Libre Office, M X Tools, M X Package Installer, M X User Manual, Task Manager, X f c e Terminal, and Quick System Info are the icons listed on the left of the menu. Favorites, Recently Used, All Applications, Accessories, Development, Games, Graphics, Internet, Multimedia, M X Tools, Office, Settings, and System are the icons listed on the right of the menu in which Favorites icon is selected.

Back to Figure

File, edit, view, insert, format, styles, table, form, tools, window, and help are the menus on the top. Two rows of toolbars are found below the menu bar. A blank content pane is shown below the toolbars.

Back to Figure

File, edit, view, go, message, tools, and help are the menus on the top. Home tab is selected in the window. The page is titled Welcome to Mozilla Thunderbird 78 dot 13 dot 0. Under Choose what to set up, Email, Calendar, Address Book, Chat, Filelink, Feeds, and Newsgroups icons are displayed. Text is shown under the heads Import from another program and About Mozilla Thunderbird.

Back to Figure

Files dropdown is selected in the top bar of the desktop. Among Rich and Trash icons of the desktop, Rich icon is selected. On the top of the window in the forefront, Home dropdown is selected. Recent, Starred, Home, Desktop, Documents, Downloads, Music, Pictures, Videos, Trash, s f underscore v m share, and other locations are the icons listed on the left pane of the window from top to bottom in which Home icon is selected. Desktop, Documents, Downloads, Junk, Music, Pictures, Public, snap, Templates, and Videos are the folders of the content pane. Data dot t x t, data 1, data 2, file dot t x t, menu 1, menu 3, menu 5, temp 1, test dot s h, test dot t x t, test 1 dot t x t are the files shown in the content pane.

Back to Figure

Line 1: dollar apt hyphen hyphen installed list. Line 2: Listing ellipsis Done. Line 3: accounts service slash focal comma now 0 dot 6 dot 55 hyphen 0 ubuntu 11 a m d 64. Line 4: open bracket installed comma automatic square bracket. Line 5: a c l slash focal comma now 2 dot 2 dot 53 hyphen 6 a m d 64 open bracket installed comma automatic close bracket. Line 6: a c p i hyphen support slash focal comma now 0 dot 143 a m d 64 open bracket installed comma automatic close bracket. Line 7: a c p i d slash focal comma now 1 colon 2 dot 0 dot 32 hyphen 1 ubuntu 1 a m d 64 open bracket installed comma automatic close bracket. Line 8: add user slash focal comma focal comma now 3 dot 118 ubuntu 2 all open bracket installed comma automatic close bracket. Line 9: adwaita hyphen icon hyphen theme slash focal comma focal comma now 3 dot 36 dot 0 hyphen 1 ubuntu 1 all. Line 10: open bracket installed comma automatic close bracket. Line 11: aisleriot slash focal comma now 1 colon 3 dot 22 dot 9 hyphen 1 a m d 64 open bracket installed comma automatic close bracket. Line 12: alsa hyphen base slash focal comma focal comma now 1 dot 0 dot 25 plus d f s g hyphen 0 ubuntu 5 all. Line 13: open bracket installed comma automatic close bracket. Line 14: alsa hyphen topology hyphen conf slash focal comma focal comma now 1 dot 2 dot 2 hyphen 1 all. Line 15: open bracket installed comma automatic close bracket. Line 16: alsa hyphen u c m hyphen conf slash focal comma focal comma now 1 dot 2 dot 2 hyphen 1 all open bracket installed comma automatic close bracket. Line 17: ellipsis. Line 18: dollar.

Back to Code

Line 1: dollar apt show z s h. Line 2: Package colon z s h. Line 3: Version colon 5 dot 8 hyphen 3 ubuntu 1. Line 4: Priority colon optional. Line 5: Section colon shells. Line 6: Origin colon Ubuntu. Line 7: Maintainer colon Ubuntu Developers open angle bracket Ubuntu hyphen devel hyphen discuss at lists dot Ubuntu dot com close angle bracket. Line 8: Original hyphen Maintainer colon Debian Z s h Maintainers open angle bracket p k g hyphen z s h hyphen. Line 9: devel at lists dot alioth dot debian dot o r g close angle bracket. Line 10: Bugs colon h t t p s colon double slash bugs dot launch pad dot net slash Ubuntu slash plus file bug. Line 11: Installed hyphen Size colon 2,390 k B. Line 12: Depends colon z s h hyphen common open parenthesis equals 5 dot 8 hyphen 3 ubuntu 1 close parenthesis, lib c 6 open parenthesis greater than or equal to 2.29 close parenthesis comma lib cap 2 open parenthesis greater than or equal to. Line 13: 1 colon 2 dot 10 close parenthesis, lib t info 6 open parenthesis greater than or equal to 6 close parenthesis. Line 14: Recommends colon lib g d b m 6 open parenthesis greater than or equal to 1 dot 16 close parenthesis comma lib n curse s w 6 open parenthesis greater than or equal to 6 close parenthesis comma lib p c r e 3. Line 15: Suggests colon z s h hyphen doc. Line 16: Homepage colon h t t p s colon double slash w w w dot z s h dot o r g slash. Line 17: Download hyphen Size colon 707 k B. Line 18: A P T hyphen Sources colon h t t p colon double slash u s dot archive dot Ubuntu dot com slash ubuntu focal slash main a m d 64. Line 19: Packages. Line 20: Description: shell with lots of features. Line 21: Z s h is a UNIX command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, z s h most closely resembles k s h but includes many enhancements. Z s h has command line editing, built in spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and a host of other features. Line 28: dollar.

Back to Code

Line 1: dollar d p k g hyphen L a c l. Line 2: slash dot. Line 3: slash bin. Line 4: slash bin slash c h a c l. Line 5: slash bin slash get f a c l. Line 6: slash bin slash set f a c l. Line 7: slash u s r. Line 8: slash u s r slash share. Line 9: slash u s r slash share slash doc. Line 10: slash u s r slash share slash doc slash a c l. Line 11: slash u s r slash share slash doc slash a c l slash copyright. Line 12: slash u s r slash share slash man. Line 13: slash u s r slash share slash man slash man 1. Line 14: slash u s r slash share slash man slash man 1 slash c h a c l dot 1 dot g z. Line 15: slash u s r slash share slash man slash man 1 slash get f a c l dot 1 dot g z. Line 16: slash u s r slash share slash man slash man 1 slash set f a c l dot 1 dot g z. Line 17: slash u s r slash share slash man slash man 5. Line 18: slash u s r slash share slash man slash man 5 slash a c l dot 5 dot g z. Line 19: slash u s r slash share slash doc slash a c l slash change log dot Debian dot g z. Line 20: dollar.

Back to Code

Line 1: dollar apt double hyphen names hyphen only search z s h. Line 2: Sorting ellipsis Done. Line 3: Full Text Search ellipsis Done. Line 4: fizsh slash focal comma focal 1 dot 0 dot 9 hyphen 1 all. Line 5: single indent, Friendly Interactive Z S H ell. Line 6: z s h slash focal 5 dot 8 hyphen 3 ubuntu 1 a m d 64. Line 7: single indent, shell with lots of features. Line 8: z s h hyphen antigen slash focal comma focal 2 dot 2 dot 3 hyphen 2 all. Line 9: single indent, manage your z s h plugins. Line 10: z s h hyphen autosuggestions slash focal comma focal 0 dot 6 dot 4 hyphen 1 all. Line 11: single indent, Fish hyphen like fast slash unobtrusive autosuggestions for z s h. Line 12: z s h hyphen common slash focal comma focal 5 dot 8 hyphen 3 ubuntu 1 all. Line 13: single indent, architecture independent files for Z s h. Line 14: z s h dev slash focal 5 dot 8 hyphen 3 ubuntu 1 a m d 64. Line 15: single indent, shell with lots of features open parenthesis development files close parenthesis. Line 16: z s h hyphen doc slash focal comma focal 5 dot 8 hyphen 3 ubuntu 1 all. Line 17: single indent, z s h documentation hyphen info slash H T M L format. Line 18: z s h hyphen static slash focal 5 dot 8 hyphen 3 ubuntu 1 a m d 64. Line 19: single indent, shell with lots of features open parenthesis static link close parenthesis. Line 20: z s h hyphen syntax hyphen highlighting slash focal comma focal 0 dot 6 dot 0 hyphen 3 all. Line 21: single indent, Fish shell like syntax highlighting for z s h. Line 22: z s h hyphen theme hyphen power level 9 k slash focal comma focal 0 dot 6 dot 7 hyphen 2 all. Line 23: single indent, power level 9 k is a theme for z s h which uses powerline fonts. Line 24: z s h d b slash focal comma focal 1 dot 1 dot 2 hyphen 1 all. Line 25: single indent, debugger for Z Shell scripts. Line 26: dollar.

Back to Code

Line 1: dollar sudo apt install z s h. Line 2: open bracket sudo close bracket password for rich colon. Line 3: Reading package lists ellipsis Done. Line 4: Building dependency tree. Line 5: Reading state information ellipsis Done. Line 6: The following additional packages will be installed colon. Line 7: single indent, z s h hyphen common. Line 8: Suggested packages colon. Line 9: single indent, z s h hyphen doc. Line 10: The following NEW packages will be installed colon. Line 11: single indent, z s h z s h hyphen common. Line 12: 0 upgraded comma 2 newly installed comma 0 to remove and 56 not upgraded. Line 13: Need to get 4,450 kB of archives. Line 14: After this operation comma 18.0 M B of additional disk space will be used. Line 15: Do you want to continue question mark open bracket Y slash n close bracket y. Line 16: Get colon 1 h t t p colon double slash u s dot archive dot Ubuntu dot com slash ubuntu focal slash main a m d 64 z s h hyphen common. Line 17: all 5 dot 8 hyphen 3 ubuntu 1 open bracket 3,744 k B close bracket. Line 18: Get colon 2 h t t p colon double slash u s dot archive dot Ubuntu dot com slash ubuntu focal slash main a m d 64 z s h a m d 64. Line 19: 5 dot 8 hyphen 3 ubuntu 1 open bracket 707 k B close bracket. Line 20: Fetched 4,450 k B in 4 s open parenthesis 1,039 k B slash s close parenthesis. Line 21: Selecting previously unselected package z s h hyphen common. Line 22: open parenthesis Reading database ellipsis 179515 files and directories currently. Line 23: installed dot close parenthesis. Line 24: Preparing to unpack ellipsis slash z s h hyphen common underscore 5 dot 8 hyphen 3 ubuntu 1 underscore all dot deb ellipsis. Line 25: Unpacking z s h hyphen common open parenthesis 5 dot 8 hyphen 3 ubuntu 1 close parenthesis ellipsis. Line 26: Selecting previously unselected package z s h. Line 27: Preparing to unpack ellipsis slash z s h underscore 5 dot 8 hyphen 3 ubuntu 1 underscore a m d 64 dot deb ellipsis. Line 28: Unpacking z s h open parenthesis 5 dot 8 hyphen 3 ubuntu 1 close parenthesis ellipsis. Line 29: Setting up z s h hyphen common open parenthesis 5 dot 8 hyphen 3 ubuntu 1 close parenthesis ellipsis. Line 30: Setting up z s h open parenthesis 5 dot 8 hyphen 3 ubuntu 1 close parenthesis ellipsis. Line 31: Processing triggers for man hyphen d b open parenthesis 2 dot 9 dot 1 hyphen 1 close parenthesis ellipsis. Line 32: dollar.

Back to Code

Line 1: dollar sudo apt upgrade. Line 2: Reading package lists ellipsis Done. Line 3: Building dependency tree. Line 4: Reading state information ellipsis Done. Line 5: Calculating upgrade ellipsis Done. Line 6: The following NEW packages will be installed colon. Line 7: single indent, binutils binutils hyphen common binutils hyphen x 86 hyphen 64 hyphen linux hyphen g n u build hyphen essen hyphen. Line 8: tial d p k g hyphen dev. Line 9: single indent, fakeroot g plus plus g plus plus hyphen 9 g c c g c c hyphen 9 lib algorithm hyphen diff hyphen perl. Line 10: single indent, lib algorithm hyphen diff hyphen x s hyphen perl lib algorithm hyphen merge hyphen perl libasan 5. Line 11: libatomic 1. Line 12: single indent, libbinutils lib c hyphen dev hyphen bin lib c 6 hyphen dev lib crypt hyphen dev lib c t f hyphen n o b f d 0. Line 13: lib c t f 0. Line 14: single indent, lib fakeroot lib g c c hyphen 9 hyphen dev lib i t m 1 lib l san 0 lib quad math 0 lib s t d c plus plus hyphen 9 hyphen. Line 15: dev. Line 16: single indent, lib t san 0 lib ub san 1 linux hyphen lib c hyphen dev make man pages hyphen dev. Line 17: The following packages will be upgraded colon. Line 18: single indent, chromium hyphen codecs hyphen f f m p e g hyphen extra e o g file hyphen roller fonts hyphen open symbol gedit. Line 19: single indent, gedit hyphen common gir 1 dot 2 hyphen gnome desktop hyphen 3 dot 0 glib hyphen networking glib hyphen. Line 20: networking hyphen common. Line 21: single indent, glib hyphen networking hyphen services gnome hyphen control hyphen center gnome hyphen control hyphen. Line 22: center hyphen data. Line 23: single indent, gnome hyphen control hyphen center hyphen faces gnome hyphen desktop 3 hyphen data gnome hyphen initial hyphen setup. Line 24: single indent, lib gnome hyphen desktop hyphen 3 hyphen 19 lib j u h hyphen java lib jurt hyphen java libnautilus hyphen. Line 25: extension 1 a. Line 26: single indent, lib net plan 0 libre office hyphen base hyphen core libre office hyphen calc libre office hyphen. Line 27: common. Line 28: single indent, libre office hyphen core libre office hyphen draw libre office hyphen gnome libre office hyphen. Line 29: g t k 3. Line 30: single indent, libre office hyphen help hyphen common libre office hyphen help hyphen en hyphen us libre office hyphen. Line 31: impress. Line 32: single indent, libre office hyphen math libre office hyphen o g l trans libre office hyphen p d f import. Line 33: single indent, libre office hyphen style hyphen breeze libre office hyphen style hyphen colibre. Line 34: single indent, libre office hyphen style hyphen elementary libre office hyphen style hyphen tango libre office hyphen. Line 35: writer. Line 36: single indent, lib r i d l hyphen java libuno hyphen c p p u 3 libuno hyphen c p p u help e r g c c 3 hyphen 3 libuno hyphen. Line 37: purp e n v help e r g c c 3 hyphen 3. Line 38: single indent, libuno hyphen sal 3 libuno hyphen sal help e r g c c 3 hyphen 3 libuno loader hyphen java nautilus. Line 39: nautilus hyphen data. Line 40: single indent, net plan dot i o python 3 hyphen dist upgrade python 3 hyphen uno thermald Ubuntu hyphen drivers hyphen. Line 41: common. Line 42: single indent, Ubuntu hyphen release hyphen upgrader hyphen core Ubuntu hyphen release hyphen upgrader hyphen g t k uno hyphen. Line 43: libs hyphen private. Line 44: single indent, ure. Line 45: 56 upgraded comma 32 newly installed comma 0 to remove and 0 not upgraded. Line 46: Need to get 133 M B of archives. Line 47: After this operation, 143 M B of additional disk space will be used. Line 48: Do you want to continue question mark open bracket Y slash n close bracket.

Back to Code

Line 1: dollar sudo apt purge z s h. Line 2: Reading package lists ellipsis Done. Line 3: Building dependency tree. Line 4: Reading state information ellipsis Done. Line 5: The following package was automatically installed and is no longer. Line 6: required colon. Line 7: single indent, z s h hyphen common. Line 8: Use single quote sudo apt autoremove single quote to remove it. Line 9: The following packages will be REMOVED colon. Line 10: single indent, z s h asterisk. Line 11: 0 upgraded comma 0 newly installed comma 1 to remove and 56 not upgraded. Line 12: After this operation, 2,390 k B disk space will be freed. Line 13: Do you want to continue question mark open bracket Y slash n close bracket y. Line 14: open parenthesis Reading database ellipsis 180985 files and directories currently. Line 15: installed dot close parenthesis. Line 16: Removing z s h open parenthesis 5 dot 8 hyphen 3 ubuntu 1 close parenthesis ellipsis. Line 17: Processing triggers for man hyphen d b open parenthesis 2 dot 9 dot 1 hyphen 1 close parenthesis ellipsis. Line 18: open parenthesis Reading database ellipsis 180928 files and directories currently. Line 19: installed dot close parenthesis. Line 20: Purging configuration files for z s h open parenthesis 5 dot 8 hyphen 3 ubuntu 1 close parenthesis ellipsis. Line 21: dollar.

Back to Code

Line 1: dollar sudo apt autoremove. Line 2: Reading package lists ellipsis Done. Line 3: Building dependency tree. Line 4: Reading state information ellipsis Done. Line 5: The following packages will be REMOVED colon. Line 6: single indent, z s h hyphen common. Line 7: 0 upgraded comma 0 newly installed comma 1 to remove and 56 not. Line 8: upgraded. Line 9: After this operation, 15.6 M B disk space will be freed. Line 10: Do you want to continue question mark open bracket Y slash n close bracket y. Line 11: open parenthesis Reading database ellipsis 180928 files and directories currently. Line 12: installed dot close parenthesis. Line 13: Removing z s h hyphen common open parenthesis 5 dot 8 hyphen 3 ubuntu 1 close parenthesis ellipsis. Line 14: Processing triggers for man hyphen d b open parenthesis 2 dot 9 dot 1 hyphen 1 close parenthesis ellipsis. Line 15: dollar.

Back to Code

Line 1: dollar d n f list x term. Line 2: Last metadata expiration check colon 0 colon 05 colon 17 ago on Sat 18 Sep 2021. Line 3: single indent, 12 colon 10 colon 24 P M E D T. Line 4: Available Packages. Line 5: x term dot x 86 underscore 64 space 351 hyphen 1 dot f c 31. Line 6: updates. Line 7: dollar d n f list installed x term. Line 8: Error colon No matching Packages to list. Line 9: blank. Line 10: dollar d n f list installed bash. Line 11: Installed Packages. Line 12: Bash dot x 86 underscore 64 space 5 dot 0 dot 11 hyphen 1 dot f c 31. Line 13: at updates. Line 14: dollar.

Back to Code

Line 1: dollar d n f provides slash u s r slash bin slash g zip. Line 2: Last metadata expiration check colon 0 colon 12 colon 06 ago on Sat 18 Sep 2021. Line 3: single indent, 12 colon 10 colon 24 P M E D T. Line 4: g zip hyphen 1 dot 10 hyphen 1 dot f c 31 dot x 86 underscore 64 colon The G N U data compression program. Line 5: Repo colon at System. Line 6: Matched from colon. Line 7: Filename colon slash u s r slash bin slash g zip. Line 8: g zip hyphen 1 dot 10 hyphen 1 dot f c 31 dot x 86 underscore 64 colon The G N U data compression program. Line 9: Repo colon fedora. Line 10: Matched from colon. Line 11: Filename colon slash u s r slash bin slash g zip. Line 12: dollar.

Back to Code

Line 1: dollar sudo d n f install z s h. Line 2: open bracket sudo close bracket password for rich colon. Line 3: Last metadata expiration check colon 0 colon 19 colon 45 ago on Sat 18 Sep. Line 4: 2021 12 colon 05 colon 01 P M E D T dot. Line 5: Dependencies resolved dot. Line 6: double dashed line. Line 7: Package space Architecture space Version space Repository space Size. Line 8: double dashed line. Line 7 consists of column heads of a table within two dashed lines. Line 9: Installing colon. Line 10: z s h space x 86 underscore 64 space 5 dot 7 dot 1 hyphen 6 dot f c 31 space updates space 2 dot 9 M. Line 11: Transaction Summary. Line 12: double dashed line. Line 13: Install 1 Package. Line 14: Total download size colon 2 dot 9 M. Line 15: Installed size colon 7 dot 4 M. Line 16: Is this ok open bracket y slash N close bracket colon. Line 17: Downloading Packages colon. Line 18: z s h hyphen 5 dot 7 dot 1 hyphen 6 dot f c 31 dot x 86 underscore 64 dot r p m space 1 dot 5 M B slash s vertical bar 2 dot 9 M B. Line 19: 00 colon 01. Line 20: single dashed line. Line 21: Total space 1 dot 0 M B slash s vertical bar 2 dot 9 M B. Line 22: 00 colon 02. Line 23: Running transaction check. Line 24: Transaction check succeeded dot. Line 25: Running transaction test. Line 26: Transaction test succeeded dot. Line 27: Running transaction. Line 28: single indent, Preparing colon. Line 29: 1 slash 1. Line 30: single indent, Installing colon z s h hyphen 5 dot 7 dot 1 hyphen 6 dot f c 31 dot x 86 underscore 64. Line 31: 1 slash 1. Line 32: single indent, Running scriptlet colon z s h hyphen 5 dot 7 dot 1 hyphen 6 dot f c 31 dot x 86 underscore 64. Line 33: 1 slash 1. Line 34: single indent, Verifying colon z s h hyphen 5 dot 7 dot 1 hyphen 6 dot f c 31 dot x 86 underscore 64. Line 35: 1 slash 1. Line 36: Installed colon. Line 37: single indent, z s h hyphen 5 dot 7 dot 1 hyphen 6 dot f c 31 dot x 86 underscore 64. Line 38: Complete exclamation. Line 39: dollar.

Back to Code

Line 1: dollar snap version. Line 2: snap 2 dot 44 dot 3 plus 20 dot 04. Line 3: snap d 2 dot 44 dot 3 plus 20 dot 04. Line 4: series 16. Line 5: ubuntu 20 dot 04. Line 6: kernel 5 dot 4 dot 0 hyphen 31 hyphen generic. Line 7: dollar.

Back to Code

Line 1: dollar snap list. Line 2: Name space Version space Rev space Tracking space Publisher space Notes. Line 3: core 18 space 20200427 space 1754 space latest slash stable space canonical space base. Line 4: gimp space 2 dot 10 dot 18 space 273 space latest slash stable space snap crafters space hyphen. Line 5: gnome hyphen 3 hyphen 28 hyphen 1804 space 3 dot 28 dot 0 hyphen 16 c 9 space 116 space latest slash stable space canonical space hyphen. Line 6: gnome hyphen 3 hyphen 34 hyphen 1804 space 0 plus g i t dot 3009 f c 7 space 33 space latest slash stable slash ellipsis space canonical space hyphen. Line 7: g t k hyphen common hyphen themes space 0 dot 1 hyphen 36 hyphen g c 75 space 1506 space latest slash stable slash ellipsis space canonical space hyphen. Line 8: g t k 2 hyphen common hyphen themes space 0 dot 1 space 9 space latest slash stable space canonical space hyphen. Line 9: snap hyphen store space 3 dot 36 dot 0 hyphen 74 hyphen g a 164 e c 9 space 433 space latest slash stable slash ellipsis space canonical space hyphen. Line 10: snap d space 2 dot 44 dot 3 space 7264 space latest slash stable space canonical space snap d. Line 11: dollar.

Back to Code

Line 1: dollar snap find solitaire. Line 2: Name space Version space Publisher space Notes space Summary. Line 3: solitaire space 1 dot 0 space 1 b s y l space hyphen space usual Solitaire. Line 4: card game comma as known as Patience or Klondike. Line 5: kmahjongg space 20 dot 04 dot 1 space k d e space hyphen space Mahjong Solitaire. Line 6: kshisen space 19 dot 08 dot 0 space k d e space hyphen space Shisen hyphen Sho. Line 7: Mahjongg hyphen like Tile Game. Line 8: k pat space 20 dot 04 dot 0 space k d e space hyphen space Solitaire card game. Line 9: free cell hyphen solitaire space 1 dot 0 space 1 b s y l space hyphen space Free Cell. Line 10: Solitaire comma card game. Line 11: open hyphen solitaire hyphen classic space 0 dot 9 dot 2 space metasmug space hyphen space Open hyphen source. Line 12: implementation of the classic solitaire game. Line 13: spider hyphen solitaire space 1 dot 0 space 1 b s y l space hyphen space Spider Solitaire. Line 14: card game. Line 15: solvitaire space blank space master popey space hyphen space solitaire open parenthesis k lon hyphen. Line 16: dike ampersand spider close parenthesis in your terminal. Line 17: gnome hyphen mahjongg space 3 dot 34 dot 0 space ken hyphen vandine space hyphen space Match tiles and. Line 18: clear the board. Line 19: dollar.

Back to Code

Line 1: dollar snap info solitaire. Line 2: name colon solitaire. Line 3: summary colon usual Solitaire card game comma as known as Patience or Klondike. Line 4: publisher colon Sylvain Becker open parenthesis 1 b s y l close parenthesis. Line 5: store hyphen u r colon h t t p s colon double slash snapcraft dot i o slash solitaire. Line 6: contact colon sylvain dot becker at gmail dot com. Line 7: license colon Proprietary. Line 8: description colon. Line 9: single indent, This is the usual Solitaire card game. Also known as Patience or Klondike. Line 10: snap hyphen i d colon 0 r n k e s Z h 4 j F y 9 o o v D T v L 6 6 1 q V T W 4 i D d E. Line 11: channels colon. Line 12: single indent, latest slash stable colon 1 dot 0 space 2017 hyphen 05 hyphen 17 space open parenthesis 2 close parenthesis space 11 M B space hyphen. Line 13: single indent, latest slash candidate colon 1 dot 0 space 2017 hyphen 05 hyphen 17 space open parenthesis 2 close parenthesis 11 M B hyphen. Line 14: single indent, latest slash beta colon 1 dot 0 space 2017 hyphen 05 hyphen 17 space open parenthesis 2 close parenthesis space 11 M B space hyphen. Line 15: single indent, latest slash edge colon 1 dot 0 space 2017 hyphen 05 hyphen 17 space open parenthesis 2 close parenthesis 11 M B space hyphen. Line 16: dollar.

Back to Code

Line 1: dollar sudo snap install solitaire. Line 2: open bracket sudo close bracket password for rich colon. Line 3: solitaire 1 dot 0 from Sylvain Becker open parenthesis 1 b s y l close parenthesis installed. Line 4: dollar.

Back to Code

Line 1: dollar flatpak list. Line 2: Name space Application I D space Version space Branch. Line 3: Installation Platform space o r g dot fedora project dot Platform space f 32 space system. Line 4: dollar.

Back to Code

Line 1: dollar flatpak search solitaire. Line 2: Name space Description space Application I D space Version space Branch. Line 3: Remotes Aisleriot Solitaire space o r g dot gnome dot Aisleriot space stable space fedora. Line 4: GNOME Mahjongg space o r g dot gnome dot Mahjongg space 3 dot 32 dot 0 stable space fedora. Line 5: dollar.

Back to Code

Line 1: dollar sudo flatpak install o r g dot gnome dot Aisleriot. Line 2: Looking for matches ellipsis. Line 3: Found similar ref open parenthesis s close parenthesis for single quote o r g dot gnome dot Aisleriot single quote in remote. Line 4: single quote fedora single quote open parenthesis system close parenthesis dot. Line 5: Use this remote question mark open bracket Y slash n close bracket colon y. Line 6: o r g dot gnome dot Aisleriot permissions colon. Line 7: i p c space pulse audio space wayland space x 11 space d r i space file. Line 8: access open bracket 1 close bracket d bus. Line 9: access open bracket 2 close bracket. Line 10: open bracket 1 close bracket x d g hyphen run slash d conf comma tilde slash dot config slash d conf colon r o. Line 11: open bracket 2 close bracket c a dot d e s r t dot d conf comma o r g dot gnome dot G Conf. Line 12: I D space Arch space Branch space Remote. Line 13: Download. Line 14: 1 dot o r g dot gnome dot Aisleriot space x 86 underscore 64 space stable space fedora. Line 15: 8 dot 4 M B slash 8 dot 4 M B. Line 16: Installation complete dot. Line 17: dollar.

Back to Code

Line 1: dollar flatpak list. Line 2: Name space Application I D space Version space Branch. Line 3: Installation Platform space o r g dot fedora project dot Platform space f 32 space system. Line 4: Aisleriot Solitaire space o r g dot gnome dot Aisleriot space stable space system. Line 5: dollar.

Back to Code

Line 1: dollar sudo flatpak uninstall o r g dot gnome dot Aisleriot. Line 2: I D space Arch space Branch. Line 3: 1 dot o r g dot gnome dot Aisleriot space x 86 underscore 64 space stable. Line 4: Uninstall complete dot. Line 5: dollar.

Back to Code

Line 1: dollar tar hyphen J x v f sys stat hyphen 12 dot 5 dot 4 dot tar dot x z. Line 2: sys stat hyphen 12 dot 5 dot 4 slash. Line 3: sys stat hyphen 12 dot 5 dot 4 slash p c p underscore stats dot h. Line 4: sys stat hyphen 12 dot 5 dot 4 slash r d underscore sensors dot h. Line 5: sys stat hyphen 12 dot 5 dot 4 slash x m l slash. Line 6: sys stat hyphen 12 dot 5 dot 4 slash x m l slash sys stat dot x s d. Line 7: sys stat hyphen 12 dot 5 dot 4 slash x m l slash sys stat hyphen 3 dot 9 dot d t d. Line 8: sys stat hyphen 12 dot 5 dot 4 slash s a dot h. Line 9: sys stat hyphen 12 dot 5 dot 4 slash man slash. Line 10: sys stat hyphen 12 dot 5 dot 4 slash man slash s a d f dot in. Line 11: sys stat hyphen 12 dot 5 dot 4 slash man slash m p stat dot 1. Line 12: ellipsis. Line 13: sys stat hyphen 12 dot 5 dot 4 slash p c p underscore stats dot c. Line 14: sys stat hyphen 12 dot 5 dot 4 slash p r underscore stats dot h. Line 15: sys stat hyphen 12 dot 5 dot 4 slash r d underscore stats dot c. Line 16: sys stat hyphen 12 dot 5 dot 4 slash p r underscore stats dot c. Line 17: sys stat hyphen 12 dot 5 dot 4 slash dot travis dot y m l. Line 18: sys stat hyphen 12 dot 5 dot 4 slash configure. Line 19: dollar.

Back to Code

Line 1: dollar c d sys stat hyphen 12 dot 5 dot 4. Line 2: dollar l s. Line 3: activity dot c space images space p r underscore stats dot h space sar dot c. Line 4: BUG underscore REPORT space INSTALL space raw underscore stats dot c space s a underscore wrap dot c. Line 5: build space i o conf dot c space raw underscore stats dot h space s v g underscore stats dot c. Line 6: CHANGES space i o conf dot h space r d underscore sensors dot c space s v g underscore stats dot h. Line 7: cifsio stat dot c space i o stat dot c space r d underscore sensors dot h space sys config dot in. Line 8: cifsio stat dot h space i o stat dot h space r d underscore stats dot c space sys stat hyphen 12 dot 5 dot 4 dot l s m. Line 9: common dot c space j son underscore stats dot c space r d underscore stats dot h space sys stat hyphen 12 dot 5 dot 4 dot spec. Line 10: common dot h space j son underscore stats dot h space README dot m d space sys stat dot in. Line 11: configure space Make file dot in space r n d r underscore stats dot c space sys stat dot i o conf. Line 12: configure dot in space man space r n d r underscore stats dot h space sys stat dot service dot in. Line 13: contrib space m p stat dot c space s a 1 dot in space sys stat dot sys config dot in. Line 14: COPYING space m p stat dot h space s a 2 dot in space sys test dot c. Line 15: count dot c space n l s space s a underscore common dot c space sys test dot h. Line 16: count dot h space p c p underscore def underscore metrics dot c space s a underscore conv dot c space tape stat dot c. Line 17: CREDITS space p c p underscore d e f underscore metrics dot h space s a underscore conv dot h space tape stat dot h. Line 18: cron space p c p underscore stats dot c space s a d c dot c space tests. Line 19: do underscore test space p c p underscore stats dot h space s a d f dot c space version dot in. Line 20: F A Q dot m d space p i d stat dot c space s a d f dot h space x m l. Line 21: format dot c space p i d stat dot h space s a d f underscore misc dot c space x m l colon stats dot c. Line 22: i config space p r underscore stats dot c space s a dot h space x m l colon stats dot h. Line 23: dollar.

Back to Code

Line 1: dollar dot slash configure. Line 2: dot. Line 3: Check programs colon. Line 4: dot. Line 5: checking for g c c ellipsis g c c. Line 6: checking whether the C compiler works ellipsis yes. Line 7: checking for C compiler default output file name ellipsis a dot out. Line 8: checking for suffix of executables ellipsis. Line 9: checking whether we are cross compiling ellipsis no. Line 10: checking for suffix of object files ellipsis o. Line 11: checking whether we are using the G N U C compiler ellipsis yes. Line 12: checking whether g c c accepts hyphen g ellipsis yes. Line 13: ellipsis. Line 14: config dot status colon creating man slash cifsio stat dot 1. Line 15: config dot status colon creating tests slash variables. Line 16: config dot status colon creating Makefile. Line 17: Sys stat version colon 12 dot 5 dot 4. Line 18: Installation prefix colon slash u s r slash local. Line 19: r c directory colon slash e t c. Line 20: Init directory colon slash e t c slash init dot d. Line 21: System d unit d i r colon slash lib slash system d slash system. Line 22: Configuration file colon slash e t c slash sys config slash sys stat. Line 23: Man pages directory colon dollar open brace data root d i r close brace slash man. Line 24: Compiler colon g c c. Line 25: Compiler flags colon hyphen g hyphen O 2. Line 26: dollar.

Back to Code

Line 1: dollar make. Line 2: g c c hyphen o s a d c dot o hyphen c hyphen g hyphen O 2 hyphen Wall hyphen W strict hyphen prototypes hyphen pipe hyphen O 2. Line 3: single indent, hyphen D S A underscore D I R equals backslash double quote slash var slash log slash s a backslash double quote hyphen D S A D C underscore PATH equals backslash double quote slash u s r slash local slash lib slash s a slash s a d c backslash double quote. Line 4: single indent, hyphen D HAVE underscore SYS underscore SYS MACROS underscore H hyphen D HAVE underscore LINUX underscore S C H E D underscore H hyphen D HAVE underscore SYS underscore PARAM underscore H. Line 5: s a d c dot c. Line 6: g c c hyphen o act underscore s a d c dot o hyphen c hyphen g hyphen O 2 hyphen Wall hyphen W strict hyphen prototypes hyphen pipe hyphen O 2 hyphen. Line 7: D SOURCE underscore S A D C. Line 8: single indent, hyphen D S A underscore D I R equals backslash double quote slash var slash log slash s a backslash double quote hyphen D S A D C underscore PATH equals backslash double quote slash u s r slash local slash lib slash s a slash s a d c backslash double quote. Line 9: single indent, hyphen D HAVE underscore SYS underscore SYS MACROS underscore H hyphen D HAVE underscore LINUX underscore S C H E D underscore H hyphen DHAVE underscore SYS underscore PARAM underscore H. Line 10: activity dot c. Line 11: g c c hyphen o s a underscore wrap dot o hyphen c hyphen g hyphen O 2 hyphen Wall hyphen W strict hyphen prototypes hyphen pipe hyphen O 2 hyphen. Line 12: D SOURCE underscore S A D C. Line 13: single indent, hyphen D S A underscore D I R equals backslash double quote slash var slash log slash s a backslash double quote hyphen D S A D C underscore PATH equals backslash double quote slash u s r slash local slash lib slash s a slash s a d c backslash double quote. Line 14: single indent, hyphen D HAVE underscore SYS underscore SYS MACROS underscore H hyphen D HAVE underscore LINUX underscore S C H E D underscore H hyphen D HAVE underscore SYS underscore PARAM underscore H. Line 15: s a underscore wrap dot c. Line 16: g c c hyphen o s a underscore common underscore s a d c dot o hyphen c hyphen g hyphen O 2 hyphen Wall hyphen W strict hyphen prototypes hyphen pipe hyphen O 2. Line 17: hyphen D SOURCE underscore S A D C. Line 18: single indent, hyphen D S A underscore D I R equals backslash double quote slash var slash log slash s a backslash double quote hyphen D SA D C underscore PATH equals backslash double quote slash u s r slash local slash lib slash s a slash s a d c backslash double quote. Line 19: single indent, hyphen D HAVE underscore SYS underscore SYS MACROS underscore H hyphen D HAVE underscore LINUX underscore S C H E D underscore H hyphen D HAVE underscore SYS underscore PARAM underscore H. Line 20: s a underscore common dot c. Line 21: ellipsis. Line 22: dollar.

Back to Code

Line 1: dollar sudo make install. Line 2: m k d i r hyphen p slash u s r slash local slash share slash man slash man 1. Line 3: m k d i r hyphen p slash u s r slash local slash share slash man slash man 5. Line 4: m k d i r hyphen p slash u s r slash local slash share slash man slash man 8. Line 5: r m hyphen f slash u s r slash local slash share slash man slash man 8 slash s a 1 dot 8 asterisk. Line 6: install hyphen m 644 hyphen g man man slash s a 1 dot 8 slash u s r slash. Line 7: local slash share slash man slash man 8. Line 8: r m hyphen f slash u s r slash local slash share slash man slash man 8 slash s a 2 dot 8 asterisk. Line 9: install hyphen m 644 hyphen g man man slash s a 2 dot 8 slash u s r slash. Line 10: local slash share slash man slash man 8. Line 11: r m hyphen f slash u s r slash local slash share slash man slash man 8 slash s a d c dot 8 asterisk. Line 12: install hyphen m 644 hyphen g man man slash s a d c dot 8 slash u s r slash local slash share slash man slash man 8. Line 13: install hyphen m 644 F A Q slash u s r slash local slash share slash doc slash sys stat hyphen 12 dot 5 dot 4. Line 14: install hyphen m 644 asterisk dot l s m slash u s r slash local slash share slash doc slash sys stat hyphen 12 dot 5 dot 4. Line 15: dollar.

Back to Code

Line 1: dollar l s mod. Line 2: Module space Size space Used by. Line 3: v box s f space 81920 space 1. Line 4: v box video space 36864 space 0. Line 5: d m underscore multipath space 32768 space 0. Line 6: s c s i underscore d h underscore r d a c space 16384 space 0. Line 7: s c s i underscore d h underscore e m c space 16384 space 0. Line 8: s c s i underscore d h underscore a l u a space 20480 space 0. Line 9: intel underscore r a p l underscore m s r space 20480 space 0. Line 10: intel underscore r a p l underscore common space 24576 space 1 intel underscore r a p l underscore m s r. Line 11: intel underscore power clamp space 20480 space 0. Line 12: r a p l space 20480 space 0. Line 13: s n d underscore intel 8 x 0 space 45056 space 0. Line 14: input underscore leds space 16384 space 0. Line 15: serio underscore raw space 20480 space 0. Line 16: joydev space 24576 space 0. Line 17: s n d underscore a c 97 underscore codec space 131072 space 1 s n d underscore intel 8 x 0. Line 18: a c 97 underscore bus space 16384 space 1 s n d underscore a c 97 underscore codec. Line 19: s n d underscore p c m space 106496 space 2 s n d underscore intel 8 x 0 comma s n d underscore a c 97 underscore codec. Line 20: s n d underscore timer space 36864 space 1 s n d underscore p c m. Line 21: s n d space 90112 space 4 s n d underscore intel 8 x 0 comma s n d underscore timer comma s n d underscore a c 97 underscore codec comma s n d underscore p c m. Line 22: sound core space 16384 space 1 s n d. Line 23: v box guest space 348160 space 2 v box s f. Line 24: mac underscore h i d space 16384 space 0. Line 25: s c h underscore f q underscore codel space 20480 space 3. Line 26: par port underscore p c space 40960 space 0. Line 27: p p dev space 24576 space 0. Line 28: l p space 20480 space 0. Line 29: par port space 53248 space 3 par port underscore p c comma l p comma p p dev. Line 30: i p underscore tables space 32768 space 0. Line 31: x underscore tables space 40960 space 1 i p underscore tables. Line 32: auto f s 4 space 45056 space 2. Line 33: b t r f s space 1261568 space 0. Line 34: z s t d underscore compress space 167936 space 1 b t r f s. Line 35: raid 10 space 61440 space 0. Line 36: raid 456 space 155648 space 0. Line 37: async underscore raid 6 underscore recov space 24576 space 1 raid 456. Line 38: async underscore mem c p y space 20480 space 2 raid 456 comma async underscore raid 6 underscore recov. Line 39: async underscore p q space 24576 space 2 raid 456 comma async underscore raid 6 underscore recov. Line 40: async underscore x o r space 20480 space 3 async underscore p q comma raid 456 comma async underscore raid 6 underscore recov. Line 41: async underscore t x space 20480 space 5 async underscore p q comma async underscore mem c p y comma async underscore x o r comma raid 456 comma async underscore raid 6 underscore recov. Line 42: x o r space 24576 space 2 async underscore x o r comma b t r f s. Line 43: raid 6 underscore p q space 114688 space 4 async underscore p q comma b t r f s comma raid 456 comma async underscore raid 6 underscore recov. Line 44: lib c r c 32 c space 16384 space 2 b t r f s comma raid 456. Line 45: raid 1 space 45056 space 0. Line 46: raid 0 space 24576 space 0. Line 47: multipath space 20480 space 0. Line 48: linear space 20480 space 0. Line 49: h i d underscore generic space 16384 space 0. Line 50: u s b h id space 57344 space 0. Line 51: h id space 131072 space 2 u s b h i d comma h i d underscore generic. Line 52: c r c t 10 d i f underscore p c l m u l space 16384 space 1. Line 53: c r c 32 underscore p c l m u l space 16384 space 0. Line 54: g hash underscore c l m u l n i underscore intel space 16384 space 0. Line 55: v m w g f x space 299008 space 1. Line 56: t t m space 106496 space 2 v m w g f x comma v box video. Line 57: aesni underscore intel space 372736 space 0. Line 58: crypto underscore sim d space 16384 space 1 aesni underscore intel. Line 59: cryptd space 24576 space 2 crypto underscore sim d comma g hash underscore c l m u l n I underscore intel. Line 60: glue underscore helper space 16384 space 1 aesni underscore intel. Line 61: d r m underscore k m s underscore helper space 184320 space 2 v m w g f x comma v box video. Line 62: sys copy area space 16384 space 1 d r m underscore k m s underscore helper. Line 63: sys fill rect space 16384 space 1 d r m underscore k m s underscore helper. Line 64: sys i m g b l t space 16384 space 1 d r m underscore k m s underscore helper. Line 65: p s mouse space 155648 space 0. Line 66: f b underscore sys underscore f o p s space 16384 space 1 d r m underscore k m s underscore helper. Line 67: a h c i space 40960 space 2. Line 68: lib a h c i space 32768 space 1 a h c i. Line 69: i 2 c underscore p i i x 4 space 28672 space 0. Line 70: e 1000 space 147456 space 0. Line 71: p a t a underscore a c p i space 16384 space 0. Line 72: d r m space 491520 space 5 v m w g f x comma d r m underscore k m s underscore helper comma v box video comma t t m. Line 73: video space 49152 space 0. Line 74: dollar.

Back to Code

Line 1: dollar l s hyphen l. Line 2: total 832. Line 3: d r w x r hyphen x r hyphen x space 2 space root space root space 4096 space Jul 23 space 13 colon 10 space dot. Line 4: d r w x r hyphen x r hyphen x space 103 space root space root space 4096 space Jul 23 space 13 colon 10 space double dot. Line 5: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 26289 space Jul 9 space 15 colon 49 space a t h 3 k dot k o. Line 6: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 14833 space Jul 9 space 15 colon 49 space b c m 203 x dot k o. Line 7: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 28137 space Jul 9 space 15 colon 49 space b f u s b dot k o. Line 8: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 17881 space Jul 9 space 15 colon 49 space blue card underscore c s dot k o. Line 9: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 22521 space Jul 9 space 15 colon 49 space b p a 10 x dot k o. Line 10: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 17625 space Jul 9 space 15 colon 49 space b t 3 c underscore c s dot k o. Line 11: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 18257 space Jul 9 space 15 colon 49 space b t b c m dot k o. Line 12: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 26657 space Jul 9 space 15 colon 49 space b t intel dot k o. Line 13: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 40625 space Jul 9 space 15 colon 49 space b t m r v l dot k o. Line 14: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 46145 space Jul 9 space 15 colon 49 space b t m r v l underscore s d i o dot k o. Line 15: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 28857 space Jul 9 space 15 colon 49 space b t m t k s d i o dot k o. Line 16: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 7401 space Jul 9 space 15 colon 49 space b t m t k u art dot k o. Line 17: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 24737 space Jul 9 space 15 colon 49 space b t q c a dot k o. Line 18: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 10297 space Jul 9 space 15 colon 49 space b t r s i dot k o. Line 19: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 24793 space Jul 9 space 15 colon 49 space b t r t l dot k o. Line 20: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 18609 space Jul 9 space 15 colon 49 space b t s d i o dot k o. Line 21: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 92617 space Jul 9 space 15 colon 49 space b t u s b dot k o. Line 22: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 14649 space Jul 9 space 15 colon 49 space b t w i link dot k o. Line 23: hyphen r w hyphen r double hyphen r double hyphen space 1 root space root space 16329 space Jul 9 space 15 colon 49 space d t l 1 underscore c s dot k o. Line 24: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 29617 space Jul 9 space 15 colon 49 space h c i underscore nokia dot k o. Line 25: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 250041 space Jul 9 space 15 colon 49 space h c i underscore u art dot k o. Line 26: hyphen r w hyphen r double hyphen r double hyphen space 1 space root space root space 17369 space Jul 9 space 15 colon 49 space h c i underscore v h c i dot k o. Line 27: dollar.

Back to Code

Line 1: dollar sudo ins mod slash lib slash modules slash 5 dot 4 dot 0 hyphen 80 hyphen generic slash kernel slash drivers slash Bluetooth slash. Line 2: b t u s b dot k o. Line 3: password colon. Line 4: dollar.

Back to Code

Line 1: dollar sudo mod probe hyphen i v b t u s b. Line 2: ins mod slash lib slash modules slash 5 dot 4 dot 0 hyphen 80 hyphen generic slash kernel slash drivers slash blue hyphen tooth slash b t u s b dot k o. Line 3: dollar.

Back to Code

Line 1: dollar cat space slash proc slash interrupts. Line 2: double indent, C P U 0. Line 3: 0 colon space 36 space I O hyphen A P I C space 2 hyphen edge space timer. Line 4: 1 colon space 297 space I O hyphen A P I C space 1 hyphen edge space i 8042. Line 5: 8 colon space 0 space I O hyphen A P I C space 8 hyphen edge space r t c 0. Line 6: 9: space 0 space I O hyphen A P I C space 9 hyphen fast e o i space a c p i. Line 7: 12: space 396 space I O hyphen A P I C space 12 hyphen edge space i 8042. Line 8: 14: space 0 space I O hyphen A P I C space 14 hyphen edge space a t a underscore p i i x. Line 9: 15: space 914 space I O hyphen A P I C space 15 hyphen edge space a t a underscore p i i x. Line 10: 18: space 2 space I O hyphen A P I C space 18 hyphen fast e o i space v box video. Line 11: 19: space 4337 space I O hyphen A P I C space 19 hyphen fast e o i space e n p 0 s 3. Line 12: ellipsis. Line 13: dollar.

Back to Code

Line 1: dollar cat slash proc slash i o ports. Line 2: 0 0 0 0 hyphen 0 c f 7 colon P C I Bus 0 0 0 0 colon 0 0. Line 3: 0 0 0 0 hyphen 0 0 1 f colon d m a 1. Line 4: 0 0 2 0 hyphen 0 0 2 1 colon pic 1. Line 5: 0 0 4 0 hyphen 0 0 4 3 colon timer 0. Line 6: 0 0 5 0 hyphen 0 0 5 3 colon timer 1. Line 7: 0 0 6 0 hyphen 0 0 6 0 colon keyboard. Line 8: 0 0 6 4 hyphen 0 0 6 4 colon keyboard. Line 9: 0 0 7 0 hyphen 0 0 7 1 colon r t c underscore c m o s. Line 10: 0 0 7 0 hyphen 0 0 7 1 colon r t c 0. Line 11: 0 0 8 0 hyphen 0 0 8 f colon d m a page reg. Line 12: 0 0 a 0 hyphen 0 0 a 1 colon pic 2. Line 13: 0 0 c 0 hyphen 0 0 d f colon d m a 2. Line 14: 0 0 f 0 hyphen 0 0 f f colon f p u. Line 15: 0 1 7 0 hyphen 0 1 7 7 colon 0 0 0 0 colon 0 0 colon 0 1 dot 1. Line 16: 0 1 7 0 hyphen 0 1 7 7 colon a t a underscore p i i x. Line 17: 0 1 f 0 hyphen 0 1 f 7 colon 0 0 0 0 colon 0 0 colon 0 1 dot 1. Line 18: 0 1 f 0 hyphen 0 1 f 7 colon a t a underscore p i i x. Line 19: 0 3 7 6 hyphen 0 3 7 6 colon 0 0 0 0 colon 0 0 colon 0 1 dot 1. Line 20: 0 3 7 6 hyphen 0 3 7 6 colon a t a underscore p i i x. Line 21: 0 3 c 0 hyphen 0 3 d f colon v g a plus. Line 22: 0 3 f 6 hyphen 0 3 f 6 colon 0 0 0 0 colon 0 0 colon 0 1 dot 1. Line 23: 0 3 f 6 hyphen 0 3 f 6 colon a t a underscore p i i x. Line 24: 0 c f 8 hyphen 0 c f f colon P C I conf 1. Line 25: 0 d 0 0 hyphen f f f f colon P C I Bus 0 0 0 0 colon 0 0. Line 26: ellipsis. Line 27: dollar.

Back to Code

Line 1: dollar l s hyphen a l slash sys. Line 2: total 4. Line 3: d r hyphen x r hyphen x r hyphen x space 13 space root space root space 0 space Feb 16 space 18 colon 06 space dot. Line 4: d r w x r hyphen x r hyphen x space 25 space root space root space 4096 space Feb 4 space 06 colon 54 space double dot. Line 5: d r w x r hyphen x r hyphen x space 2 space root space root space 0 space Feb 16 space 17 colon 48 space block. Line 6: d r w x r hyphen x r hyphen x space 41 space root space root space 0 space Feb 16 space 17 colon 48 space bus. Line 7: d r w x r hyphen x r hyphen x space 62 space root space root space 0 space Feb 16 space 17 colon 48 space class. Line 8: d r w x r hyphen x r hyphen x space 4 space root space root space 0 space Feb 16 space 17 colon 48 space dev. Line 9: d r w x r hyphen x r hyphen x space 14 space root space root space 0 space Feb 16 space 17 colon 48 space devices. Line 10: d r w x r hyphen x r hyphen x space 5 space root space root space 0 space Feb 16 space 17 colon 49 space firmware. Line 11: d r w x r hyphen x r hyphen x space 8 space root space root space 0 space Feb 16 space 17 colon 48 space f s. Line 12: d r w x r hyphen x r hyphen x space 2 space root space root space 0 space Feb 16 space 18 colon 06 space hypervisor. Line 13: d r w x r hyphen x r hyphen x space 13 space root space root space 0 space Feb 16 space 17 colon 48 space kernel. Line 14: d r w x r hyphen x r hyphen x space 143 space root space root space 0 space Feb 16 space 17 colon 48 space module. Line 15: d r w x r hyphen x r hyphen x space 2 space root space root space 0 space Feb 16 space 17 colon 48 space power. Line 16: dollar.

Back to Code

Line 1: dollar l s dev. Line 2: Device space D M A space I R Q space I slash O Ports. Line 3: ellipsis. Line 4: a c p i blank 9 blank. Line 5: A C P I blank blank 4000 hyphen 4003 4004 hyphen 4005 4008 hyphen 400 b 4020 hyphen 4021. Line 6: a h c i blank blank d 240 hyphen d 247 d 248 hyphen d 24 b d 250 hyphen d 257 d 258 hyphen d 25 b. Line 7: a t a underscore p i i x space 14 space 15 space 0170 hyphen 0177 0 1 f 0 hyphen 0 1 f 7 0376 hyphen 0376 0 3 f 6 hyphen 0 3 f 6. Line 8: cascade 4 blank blank. Line 9: d m a blank blank 0080 hyphen 0 0 8 f. Line 10: d m a 1 blank blank 0000 hyphen 0 0 1 f. Line 11: d m a 2 blank blank 0 0 c 0 hyphen 0 0 d f. Line 12: e 1000 blank blank d 0 1 0 hyphen d 0 1 7. Line 13: e n p 0 s 3 blank 19 blank. Line 14: f p u blank blank 0 0 f 0 blank 0 0 f f. Line 15: i 8042 space 1 space 12 space blank. Line 16: Intel blank blank d 100 hyphen d 1 f f d 200 hyphen d 23 f. Line 17: keyboard blank blank 0060 hyphen 0060 0064 hyphen 0064. Line 18: o h c i underscore h c d colon u s b 1 blank 22 blank. Line 19: P C I blank blank 0000 hyphen 0 c f 7 space 0 c f 8 hyphen 0 c f f space 0 d 0 0 hyphen f f f f. Line 20: pic 1 blank blank 0020 hyphen 0021. Line 21: pic 2 blank blank 0 0 a 0 hyphen 0 0 a 1. Line 22: p i i x 4 underscore s m bus blank blank 4100 hyphen 4108. Line 23: r t c 0 blank 8 space 0070 hyphen 0071. Line 24: r t c underscore c m o s blank blank 0070 hyphen 0071. Line 25: s n d underscore intel 8 x 0 blank 21 blank. Line 26: timer blank 0 blank. Line 27: timer 0 blank blank 0040 hyphen 0043. Line 28: timer 1 blank blank 0050 hyphen 0053. Line 29: v box guest blank 20 blank. Line 30: v box video blank 18 blank. Line 31: v g a + blank blank 0 3 c 0 hyphen 0 3 d f. Line 32: dollar.

Back to Code

Line 1: dollar l s b l k. Line 2: NAME space MAJ colon MIN space R M space SIZE space R O space TYPE space MOUNT POINT. Line 3: loop 0 space 7 colon 0 space 0 space 34 dot 6 M space 1 space loop space slash snap slash g t k hyphen common hyphen themes slash 818. Line 4: loop 1 space 7 colon 1 space 0 space 2 dot 2 M space 1 space loop space slash snap slash gnome hyphen calculator slash 222. Line 5: ellipsis. Line 6: s d a space 8 colon 0 space 0 space 10 G space 0 space disk space blank. Line 7: single indent, s d a 1 space 8 colon 1 space 0 space 10 G space 0 space part space blank. Line 8: double indent, Ubuntu double hyphen v g hyphen root space 253 colon 0 space 0 space 9 G space 0 space l v m space slash. Line 9: double indent, Ubuntu double hyphen v g hyphen swap underscore 1 space 253 colon 1 space 0 space 976 M space 0 space l v m space open bracket SWAP close bracket. Line 10: s r 0 space 11 colon 0 space 1 space 1024 M space 0 space rom space blank. Line 11: dollar.

Back to Code

Line 1: dollar l s b l k hyphen S. Line 2: NAME space H C T L space TYPE space VENDOR space MODEL space REV space TRAN. Line 3: s d a space 2 colon 0 colon 0 colon 0 space disk space A T A space V BOX HARDDISK space 1 dot 0 space sata. Line 4: s r 0 space 1 colon 0 colon 0 colon 0 space rom space V BOX space C D hyphen ROM space 1 dot 0 space ata. Line 5: dollar.

Back to Code

Line 1: open bracket 2525 dot 4 9 9 2 1 6 close bracket u s b 1 hyphen 2 colon new full hyphen speed U S B device number 3 using o h c i hyphen p c i. Line 2: open bracket 2525 dot 7 9 1 0 9 3 close bracket u s b 1 hyphen 2 colon config 1 interface 0 alt setting 0 endpoint 0 x 1 has invalid max packet 512, setting to 64. Line 3: open bracket 2525 dot 7 9 1 1 0 7 close bracket u s b 1 hyphen 2 colon config 1 interface 0 alt setting 0 endpoint 0 x 81 has invalid max packet 512, setting to 64. Line 4: open bracket 2525 dot 8 2 1 0 7 9 close bracket u s b 1 hyphen 2 colon New U S B device found comma i d Vendor equals a b c d comma i d Product equals 1 2 3 4. Line 5: open bracket 2525 dot 8 2 1 0 8 8 close bracket u s b 1 hyphen 2 colon New U S B device strings colon M f r equals 1 comma Product equals 2 comma Serial Number equals 3. Line 6: open bracket 2525 dot 8 2 1 0 9 4 close bracket u s b 1 hyphen 2 colon Product colon U Disk. Line 7: open bracket 2525 dot 8 2 1 0 9 9 close bracket u s b 1 hyphen 2 colon Manufacturer colon General. Line 8: open bracket 2525 dot 8 2 1 1 0 4 close bracket u s b 1 hyphen 2 colon Serial Number colon. Line 9: open bracket 2525 dot 9 2 7 0 9 6 close bracket u s b hyphen storage 1 hyphen 2 colon 1 dot 0 colon U S B Mass Storage device detected. Line 10: open bracket 2525 dot 9 2 7 9 5 0 close bracket s c s i host 3 colon u s b hyphen storage 1 hyphen 2 colon 1 dot 0. Line 11: open bracket 2525 dot 9 2 8 0 3 3 close bracket u s b core colon registered new interface driver u s b hyphen storage. Line 12: open bracket 2525 dot 9 4 0 3 7 6 close bracket u s b core colon registered new interface driver u a s. Line 13: open bracket 2526 dot 9 6 1 7 5 4 close bracket s c s i 3 colon 0 colon 0 colon 0 colon Direct hyphen Access General U Disk 5 dot 00 P Q colon 0 A N S I colon 2. Line 14: open bracket 2526 dot 9 6 6 6 4 6 close bracket s d 3 colon 0 colon 0 colon 0 colon Attached s c s i generic s g 2 type 0. Line 15: open bracket 2526 dot 9 9 2 7 0 7 close bracket s d 3 colon 0 colon 0 colon 0 colon open bracket s d b close bracket 3 1 3 3 6 4 4 8 512 hyphen byte logical blocks colon open parenthesis 16 dot 0 G B slash 14 dot 9 G i B close parenthesis. Line 16: open bracket 2527 dot 0 0 9 1 9 7 close bracket s d 3 colon 0 colon 0 colon 0 colon open bracket s d b close bracket Write Protect is off. Line 17: open bracket 2527 dot 0 0 9 2 0 0 close bracket s d 3 colon 0 colon 0 colon 0 colon open bracket s d b close bracket Mode Sense colon 0 b 0 0 0 0 0 8. Line 18: open bracket 2527 dot 0 2 6 7 6 4 close bracket s d 3 colon 0 colon 0 colon 0 colon open bracket s d b close bracket No Caching mode page found. Line 19: open bracket 2527 dot 0 2 6 7 7 0 close bracket s d 3 colon 0 colon 0 colon 0 colon open bracket s d b close bracket Assuming drive cache colon write through. Line 20: open bracket 2527 dot 1 2 7 6 1 3 close bracket s d b colon s d b 1. Line 21: open bracket 2527 dot 2 2 9 9 4 3 close bracket s d 3 colon 0 colon 0 colon 0 colon open bracket s d b close bracket Attached S C S I removable disk.

Back to Code

Line 1: dollar l s p c i. Line 2: 00 colon 00 dot 0 Host bridge colon Intel Corporation 440 F X hyphen 8 2 4 4 1 F X P M C open bracket Natoma close bracket open parenthesis rev 02 close parenthesis. Line 3: 00 colon 01 dot 0 I S A bridge colon Intel Corporation 8 2 3 7 1 S B P I I X 3 I S A open bracket Natoma slash Triton second close bracket. Line 4: 00 colon 01 dot 1 I D E interface colon Intel Corporation 8 2 3 7 1 A B slash E B slash M B P I I X 4 I D E open bracket rev 01 close bracket. Line 5: 00 colon 02 dot 0 V G A compatible controller colon InnoTek Systemberatung G m b H Virtual Box Graphics Adapter. Line 6: 00 colon 03 dot 0 Ethernet controller colon Intel Corporation 8 2 5 4 0 E M Gigabit Ethernet Controller open parenthesis rev 02 close parenthesis. Line 7: 00 colon 04 dot 0 System peripheral colon InnoTek Systemberatung G m b H Virtual Box Guest Service. Line 8: 00 colon 05 dot 0 Multimedia audio controller colon Intel Corporation 8 2 8 0 1 A A A C single quote 97 Audio Controller open parenthesis rev 01 close parenthesis. Line 9: 00 colon 06 dot 0 U S B controller colon Apple Inc dot Key Largo slash Intrepid U S B. Line 10: 00 colon 07 dot 0 Bridge colon Intel Corporation 8 2 3 7 1 A B slash E B slash M B P I I X 4 A C P I open parenthesis rev 08 close parenthesis. Line 11: 00 colon 0 d dot 0 SATA controller colon Intel Corporation 8 2 8 0 1 H M slash H E M open parenthesis I C H 8 M slash I C H 8 M hyphen E close parenthesis SATA Controller open bracket A H C I mode close bracket open parenthesis rev 02 close parenthesis. Line 12: dollar.

Back to Code

Line 1: dollar l s u s b. Line 2: Bus 001 Device 003 colon I D a b c d colon 1 2 3 4 Unknown. Line 3: Bus 001 Device 002 colon I D 80 e e colon 0 0 2 1 Virtual Box U S B Tablet. Line 4: Bus 001 Device 001 colon I D 1 d 6 b colon 0 0 0 1 Linux Foundation 1 dot 1 root hub. Line 5: dollar.

Back to Code

Line 1: dollar d m e s g. Line 2: open bracket 0 dot 000000 close bracket Linux version 5 dot 11 dot 0 hyphen 38 hyphen generic open parenthesis build d at l g w 0 1 hyphen a m d 64 hyphen 041 close parenthesis open parenthesis g c c open parenthesis Ubuntu 9 dot 3 dot 0 hyphen 17 ubuntu 1 tilde 20 dot 04 close parenthesis 9 dot 3 dot 0 comma G N U l d open parenthesis G N U Binutils for Ubuntu close parenthesis 2 dot 34 close parenthesis. Line 3: hash 42 tilde 20 dot 04 dot 1 hyphen Ubuntu S M P Tue Sep 28 20 colon 41 colon 07 U T C 2021 open parenthesis Ubuntu 5 dot 11 dot 0 hyphen 38 dot 42 tilde 20 dot 04 dot 1 hyphen generic 5 dot 11 dot 22 close parenthesis. Line 4: open bracket 0 dot 000000 close bracket Command line colon BOOT underscore IMAGE equals slash boot slash v m linuz hyphen 5 dot 11 dot 0 hyphen 38 hyphen generic root equals U U I D equals 5 4 2 3 1 1 7 e hyphen 4 a a f hyphen 4 4 1 6 hyphen a d a 7 hyphen 0 1 e 0 7 0 7 3 b 2 e 1 r o quiet splash. Line 5: Open bracket 0 dot 000000 close bracket KERNEL supported c p u s colon. Line 6: open bracket 0 dot 000000 close bracket Intel Genuine Intel. Line 7: open bracket 0 dot 000000 close bracket A M D Authentic A M D. Line 8: open bracket 0 dot 000000 close bracket Hygon Hygon Genuine. Line 9: open bracket 0 dot 000000 close bracket Centaur Centaur Hauls. Line 10: open bracket 0 dot 000000 close bracket zhaoxin Shanghai. Line 11: open bracket 0 dot 000000 close bracket x 86 slash f p u colon Supporting X SAVE feature 0 x 001 colon single quote x 87 floating point registers single quote. Line 12: open bracket 0 dot 000000 close bracket x 86 slash f p u colon Supporting X SAVE feature 0 x 002 colon single quote S S E registers single quote. Line 13: open bracket 0 dot 000000 close bracket x 86 slash f p u colon Supporting X SAVE feature 0 x 004 colon single quote A V X registers single quote. Line 14: open bracket 0 dot 000000 close bracket x 86 slash f p u colon x state underscore offset open bracket 2 close bracket colon 576 comma x state underscore sizes open bracket 2 close bracket colon 256. Line 15: open bracket 0 dot 000000 close bracket x 86 slash f p u colon Enabled x state features 0 x 7 comma con hyphen text size is 832 bytes comma using single quote standard single quote format dot. Line 16: open bracket 0 dot 000000 close bracket BIOS hyphen provided physical RAM map colon. Line 17: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 0000000000000000 hyphen 0 x 00000000000 9 f b f f close bracket usable. Line 18: open bracket 0 dot 000000 close bracket BIOS hyphen 820 colon open bracket mem 0 x 00000000000 9 f c 0 0 hyphen 0 x 00000000000 9 f f f f close bracket reserved. Line 19: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 00000000000 f 0000 hyphen 0 x 00000000000 f f f f f close bracket reserved. Line 20: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 0000000000 1 00000 hyphen 0 x 00000000 d f f e f f f f close bracket usable. Line 21: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 00000000 d f f f 0000 hyphen 0 x 00000000 d f f f f f f f close bracket A C P I data. Line 22: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 00000000 f e c 00000 hyphen 0 x 00000000 f e c 0 0 f f f close bracket reserved. Line 23: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 00000000 f e e 00000 hyphen 0 x 00000000 f e e 0 0 f f f close bracket reserved. Line 24: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 00000000 f f f c 0000 hyphen 0 x 00000000 f f f f f f f f close bracket reserved. Line 25: open bracket 0 dot 000000 close bracket BIOS hyphen e 820 colon open bracket mem 0 x 0000000 1 00000000 hyphen 0 x 0000000 2 1 f f f f f f f close bracket usable. Line 26: open bracket 0 dot 000000 close bracket N X open parenthesis Execute Disable close parenthesis protection colon active. Line 27: open bracket 0 dot 000000 close bracket S M BIOS 2 dot 5 present dot. Line 28: open bracket 0 dot 000000 close bracket D M I colon innotek G m b H Virtual Box slash Virtual Box comma. Line 29: BIOS Virtual Box 12 slash 01 slash 2006.

Back to Code

Line 1: menu entry double quote Ubuntu Linux double quote open brace. Line 2: single indent, set root equals open parenthesis h d 1 comma 1 close parenthesis. Line 3: single indent, linux space slash boot slash v m linuz. Line 4: single indent, init r d space slash init r d. Line 5: close brace. Line 6: single indent, menu entry double quote Windows double quote open brace. Line 7: double indent, set root equals open parenthesis h d 0 comma 1 close parenthesis. Line 8: single indent, close brace.

Back to Code

Line 1: dollar space p s space hyphen p space 1. Line 2: double indent, P I D space T T Y space TIME space C M D. Line 3: triple indent, 1 space question mark space 00 colon 00 colon 01 space system d. Line 4: dollar.

Back to Code

Line 1: hash system c t l list hyphen units. Line 2: UNIT space LOAD space ACTIVE space SUB space DESCRIPTION. Line 3: ellipsis. Line 4: crond dot service space loaded space active space running space Command Scheduler. Line 5: cups dot service space loaded space active space running space CUPS Printing Service. Line 6: d bus dot service space loaded space active space running space D hyphen Bus System Message. Line 7: ellipsis. Line 8: multi hyphen user dot target space loaded space active space active space Multi hyphen User System. Line 9: network dot target space loaded space active space active space Network. Line 10: paths dot target space loaded space active space active space Paths. Line 11: remote hyphen f s dot target space loaded space active space active space Remote File Systems. Line 12: slices dot target space loaded space active space active space Slices. Line 13: sockets dot target space loaded space active space active space Sockets. Line 14: ellipsis. Line 15: 218 loaded units listed. Pass double hyphen all to see loaded but inactive units, too. Line 16: To show all installed unit files use single quote system c t l list hyphen unit hyphen files single quote. Line 17: hash.

Back to Code

Line 1: dollar cat cron dot service. Line 2: open bracket Unit close bracket. Line 3: Description equals Regular background program processing daemon. Line 4: Documentation equals man colon cron open parenthesis 8 close parenthesis. Line 5: After equals remote hyphen f s dot target n s s hyphen user hyphen lookup dot target. Line 6: open bracket Service close bracket. Line 7: Environment File equals hyphen slash e t c slash default slash cron. Line 8: Exec Start equals slash u s r slash s bin slash cron hyphen f dollar EXTRA under OPTS. Line 9: Ignore SIG PIPE equals false. Line 10: Kill Mode equals process. Line 11: Restart equals on hyphen failure. Line 12: open bracket Install close bracket. Line 13: Wanted By equals multi hyphen user dot target. Line 14: dollar.

Back to Code

Line 1: dollar cat graphical dot target. Line 2: hash S P D X hyphen License hyphen Identifier colon L G P L hyphen 2 dot 1 plus. Line 3: hash. Line 4: hash This file is part of system d. Line 5: hash. Line 6: hash system d is free software semicolon you can redistribute it and slash or modify it. Line 7: hash under the terms of the G N U Lesser General Public License as published by. Line 8: hash the Free Software Foundation semicolon either version 2 dot 1 of the License comma or. Line 9: hash open parenthesis at your option close parenthesis any later version. Line 10: open bracket Unit close bracket. Line 11: Description equals Graphical Interface. Line 12: Documentation equals man colon system d dot special open parenthesis 7 close parenthesis. Line 13: Requires equals multi hyphen user dot target. Line 14: Wants equals display hyphen manager dot service. Line 15: Conflicts equals rescue dot service rescue dot target. Line 16: After equals multi hyphen user dot target rescue dot service rescue dot target display hyphen manager dot service. Line 17: Allow Isolate equals yes. Line 18: dollar.

Back to Code

Line 1: dollar l s hyphen al default asterisk. Line 2: l r w x r w x r w x 1 root root 16 Sep 7 14 colon 37 default dot target hyphen close angle bracket. Line 3: graphical dot target. Line 4: rich at Ubuntu 20 colon slash u s r slash lib slash system d slash system dollar. Line 5: dollar.

Back to Code

Line 1: dollar system c t l status cron dot service. Line 2: single indent, cron dot service hyphen Regular background program processing daemon. Line 3: Loaded colon loaded open parenthesis slash lib slash system d slash system slash cron dot service semicolon enabled semicolon vendor preset colon enabled close parenthesis. Line 4: Active colon active open parenthesis running close parenthesis since Sat 2021 hyphen 10 hyphen 23 08 colon 19 colon 28 E D T semicolon 28 minutes ago. Line 5: Docs colon man colon cron open parenthesis 8 close parenthesis. Line 6: Main P I D colon 585 open parenthesis cron close parenthesis. Line 7: Tasks colon 1 open parenthesis limit colon 9482 close parenthesis. Line 8: Memory colon 468 dot 0 K. Line 9: C Group colon slash system dot slice slash cron dot service box drawing character 585 slash u s r slash s bin slash cron hyphen f. Line 10: Oct 23 08 colon 19 colon 28 ubuntu 20 system d open bracket 1 close bracket colon Started Regular background program processing daemon. Line 11: Oct 23 08 colon 19 colon 28 ubuntu 20 cron open bracket 585 close bracket colon open parenthesis CRON close parenthesis INFO open parenthesis p i d file f d equals 3 close parenthesis. Line 12: Oct 23 08 colon 19 colon 28 ubuntu 20 cron open bracket 585 close bracket colon open parenthesis CRON close parenthesis INFO open parenthesis Running at reboot jobs close parenthesis. Line 13: Oct 23 08 colon 30 colon 01 ubuntu 20 CRON open bracket 2882 close bracket colon pam underscore unix open parenthesis cron colon session close parenthesis colon session opened for user root by open parenthesis u i d equals 0 close parenthesis. Line 14: Oct 23 08 colon 30 colon 01 ubuntu 20 CRON open bracket 2882 close bracket colon pam underscore unix open parenthesis cron colon session close parenthesis colon session closed for user root. Line 15: dollar sudo system c t l stop cron dot service. Line 16: dollar system c t l status cron dot service. Line 17: cron dot service hyphen Regular background program processing daemon. Line 18: Loaded colon loaded open parenthesis slash lib slash system d slash system slash cron dot service semicolon enabled semicolon vendor preset colon enabled close parenthesis. Line 19: Active colon inactive open parenthesis dead close parenthesis since Sat 2021 hyphen 10 hyphen 23 08 colon 51 colon 01 E D T semicolon 3 s ago. Line 20: Docs colon man colon cron open parenthesis 8 close parenthesis. Line 21: Process colon 585 Exec Start equals slash u s r slash s bin slash cron hyphen f dollar EXTRA underscore OPTS open parenthesis code equals killed comma signal equals TERM close parenthesis. Line 22: Main P I D colon 585 open parenthesis code equals killed comma signal equals TERM close parenthesis. Line 23: Oct 23 08 colon 19 colon 28 ubuntu 20 system d open bracket 1 close bracket colon Started Regular background program processing daemon. Line 24: Oct 23 08 colon 19 colon 28 ubuntu 20 cron open bracket 585 close bracket colon open parenthesis CRON close parenthesis INFO open parenthesis p i d file f d equals 3 close parenthesis. Line 25: Oct 23 08 colon 19 colon 28 ubuntu 20 cron open bracket 585 close bracket colon open parenthesis CRON close parenthesis INFO open parenthesis Running at reboot jobs close parenthesis. Line 26: Oct 23 08 colon 30 colon 01 ubuntu 20 CRON open bracket 2882 close bracket colon pam underscore unix open parenthesis cron colon session close parenthesis colon session opened for user root by open parenthesis u i d equals 0 close parenthesis. Line 27: Oct 23 08 colon 30 colon 01 ubuntu 20 CRON open bracket 2882 close bracket colon pam underscore unix open parenthesis cron colon session close parenthesis colon session closed for user root. Line 28: Oct 23 08 colon 51 colon 01 ubuntu 20 system d open bracket 1 close bracket colon Stopping Regular background program processing daemon ellipsis. Line 29: Oct 23 08 colon 51 colon 01 ubuntu 20 system d open bracket 1 close bracket colon cron dot service colon Succeeded. Line 30: Oct 23 08 colon 51 colon 01 ubuntu 20 system d open bracket 1 close bracket colon Stopped Regular background program processing daemon. Line 31: dollar.

Back to Code

Line 1: dollar sudo f disk slash dev slash s d a. Line 2: open bracket sudo close bracket password for rich colon. Line 3: Welcome to f disk open parenthesis util hyphen linux 2 dot 23 dot 2 close parenthesis dot. Line 4: Changes will remain in memory only comma until you decide to write them. Line 5: Be careful before using the write command. Line 6: Command open parenthesis m for help close parenthesis colon.

Back to Code

Line 1: Command open parenthesis m for help close parenthesis colon p. Line 2: Disk space slash dev slash s d a colon 10 point 7 G B comma 10737418240 bytes comma 20971520 sectors. Line 3: Units equal sectors of 1 asterisk 512 equals 512 bytes. Line 4: Sector size open parenthesis logical slash physical close parenthesis colon 512 bytes slash 512 bytes. Line 5: I slash O size open parenthesis minimum slash optimal close parenthesis colon 512 bytes slash 512 bytes. Line 6: Disk label type colon dos. Line 7: Disk identifier colon 0 x 0 0 0 5 2 8 e 6. Line 8: Device space Boot space Start space End space Blocks space I d space System. Line 9: slash dev slash s d a 1 space asterisk space 2048 space 2099199 space 1048576 space 83 space Linux. Line 10: slash dev slash s d a 2 space blank space 2099200 space 20971519 space 9436160 space 83 space Linux. Line 11: Command open parenthesis m for help close parenthesis colon.

Back to Code

Line 1: dollar sudo g disk slash dev slash s d a. Line 2: open bracket sudo close bracket password for rich colon. Line 3: G P T f disk open parenthesis g disk close parenthesis version 1 dot 0 dot 3. Line 4: Partition table scan colon. Line 5: single indent, M B R colon protective. Line 6: single indent, B S D colon not present. Line 7: single indent, A P M colon not present. Line 8: single indent, G P T colon present. Line 9: Found valid G P T with protective M B R semicolon using G P T dot. Line 10: Command open parenthesis question mark for help close parenthesis colon.

Back to Code

Line 1: dollar sudo parted. Line 2: G N U Parted 3 dot 2. Line 3: Using slash dev slash s d a. Line 4: Welcome to G N U Parted exclamation Type single quote help single quote to view a list of commands dot. Line 5: open parenthesis parted close parenthesis print. Line 6: Model colon A T A V BOX HARDDISK open parenthesis s c s i close parenthesis. Line 7: Disk slash dev slash s d a colon 15 point 6 G B. Line 8: Sector size open parenthesis logical slash physical close parenthesis colon 512 B slash 512 B. Line 9: Partition Table colon g p t. Line 10: Disk Flags colon. Line 11: Number space Start space End space Size space File system space Name space Flags. Line 12: 1 space 1049 k B space 1000 M B space 999 M B space fat 32 space blank space boot comma e s p. Line 13: 2 space 1000 M B space 13 point 6 G B space 12 point 6 G B space e x t 4 space blank space blank. Line 14: 3 space 13 point 6 G B space 15 point 6 G B space 2000 M B space linux hyphen swap open parenthesis v 1 close parenthesis space blank space blank. Line 15: open parenthesis parted close parenthesis.

Back to Code

Line 1: dollar sudo m k f s hyphen t e x t 4 space slash dev slash s d b 1. Line 2: m k e 2 f s 1 dot 44 dot 1 open parenthesis 24 hyphen Mar hyphen 2018 close parenthesis. Line 3: Creating filesystem with 2621440 4 k blocks and 655360 inodes. Line 4: Filesystem U U I D colon f 9 1 3 7 b 2 6 hyphen 0 c a f hyphen 4 a 8 a hyphen a f d 0 hyphen 3 9 2 0 0 2 4 2 4 e e 8. Line 5: Superblock backups stored on blocks colon. Line 6: single indent, 32768 comma 98304 comma 163840 comma 229376 comma 294912 comma 819200 comma 884736 comma 1605632. Line 7: Allocating group tables colon done. Line 8: Writing inode tables colon done. Line 9: Creating journal open parenthesis 16384 blocks close parenthesis colon done. Line 10: Writing superblocks and filesystem accounting information colon done. Line 11: dollar.

Back to Code

Line 1: dollar mount. Line 2: ellipsis. Line 3: slash dev slash s d a 2 on slash type e x t 4 open parenthesis r w comma relatime comma errors equals remount hyphen. Line 4: r o comma data equals ordered close parenthesis. Line 5: slash dev slash s d a 1 on slash boot slash e f i type v fat. Line 6: single indent, open parenthesis r w comma relatime comma f mask equals 0077 comma d mask equals 0077 comma code page 437 comma i o char set equals iso 8859. Line 7: hyphen 1 comma short name equals mixed comma errors equals remount hyphen r o close parenthesis. Line 8: ellipsis. Line 9: slash dev slash s d b 1 on slash media slash u s b 1 type e x t 4 open parenthesis r w comma relatime comma data equals ordered close parenthesis. Line 10: slash dev slash s d b 2 on slash media slash u s b 2 type e x t 4 open parenthesis r w comma relatime comma data equals ordered close parenthesis. Line 11: rich at rich hyphen Test Box 2 colon tilde dollar.

Back to Code

Line 1: dollar cat slash e t c slash f s tab. Line 2: hash slash e t c slash f s tab colon static file system information dot. Line 3: hash. Line 4: hash Use single quote b l kid single quote to print the universally unique identifier for a. Line 5: hash device semicolon this may be used with U U I D equals as a more robust way to name devices. Line 6: hash that works even if disks are added and removed dot See f s tab open parenthesis 5 close parenthesis dot. Line 7: hash. Line 8: hash open angle bracket file system close angle bracket open angle bracket mount point close angle bracket open angle bracket type close angle bracket open angle bracket options close angle bracket open angle bracket dump close angle bracket open angle bracket pass close angle bracket. Line 9: hash slash was on slash dev slash s d a 2 during installation. Line 10: U U I D equals 4 6 a 8 4 7 3 c hyphen 8 4 3 7 hyphen 4 d 5 f hyphen a 6 a 1 hyphen 6 5 9 6 c 4 9 2 c 3 c e slash e x t 4 errors equals remount hyphen r o 0 1. Line 11: hash slash boot slash e f i was on slash dev slash s d a 1 during installation. Line 12: U U I D equals 8 6 4 B hyphen 6 2 F 5 slash boot slash e f i v fat u mask equals 0077 0 1. Line 13: hash swap was on slash dev slash s d a 3 during installation. Line 14: U U I D equals 8 6 7 3 4 4 7 a hyphen 0 2 2 7 hyphen 4 7 d 7 hyphen a 6 7 a hyphen e 6 b 8 3 7 b d 7 1 8 8 none swap s w 0 0. Line 15: dollar.

Back to Code

Line 1: dollar sudo f s c k hyphen f slash dev slash s d b 1. Line 2: f s c k from util hyphen linux 2 dot 31 dot 1. Line 3: e 2 f s c k 1 dot 44 dot 1 open parenthesis 24 hyphen Mar hyphen 2018 close parenthesis. Line 4: Pass 1 colon Checking inodes comma blocks comma and sizes. Line 5: Pass 2 colon Checking directory structure. Line 6: Pass 3 colon Checking directory connectivity. Line 7: Pass 4 colon Checking reference counts. Line 8: Pass 5 colon Checking group summary information. Line 9: slash dev slash s d b 1 colon 11 slash 655360 files open parenthesis 0 point 0 percent non hyphen contiguous close parenthesis comma. Line 10: 66753 slash 2621440 blocks. Line 11: dollar.

Back to Code

Line 1: dollar P S 1 equals single quote open bracket backslash t close bracket open bracket backslash u close bracket backslash dollar single quote. Line 2: single indent, open bracket 14 colon 40 colon 32 close bracket open bracket rich close bracket dollar.

Back to Code

Line 1: dollar date semicolon who. Line 2: Sat 20 Nov 2021 08 colon 25 colon 55 A M E S T. Line 3: rich space colon 0 space 2021 hyphen 11 hyphen 20 space 08 colon 21 space open parenthesis colon 0 close parenthesis. Line 4: dollar.

Back to Code

Line 1: dollar date greater than test 1. Line 2: dollar l s hyphen l test 1. Line 3: hyphen r w hyphen r dash r double hyphen space 1 rich space rich space 20 Nov 21 space 08 colon 30 space test 1. Line 4: dollar cat test 1. Line 5: Sat Nov 20 08 colon 30 colon 04 E D T 2021. Line 6: dollar.

Back to Code

Line 1: dollar who greater than test 2. Line 2: dollar cat test 2. Line 3: rich space colon 0 space 2021 hyphen 11 hyphen 20 space 08 colon 21 space open parenthesis colon 0 close parenthesis. Line 4: dollar.

Back to Code

Line 1: dollar date double greater than test 2. Line 2: dollar cat test 2. Line 3: Sat Nov 20 08 colon 30 colon 04 E D T 2021. Line 4: rich space colon 0 space 2021 hyphen 11 hyphen 20 space 08 colon 21 space open parenthesis colon 0 close parenthesis. Line 5: dollar.

Back to Code

Line 1: dollar w c double less than E O F. Line 2: greater than test string 1. Line 3: greater than test string 2. Line 4: greater than test string 3. Line 5: greater than E O F. Line 6: double indent, 3 space 9 space 42. Line 7: dollar.

Back to Code

Line 1: dollar r p m hyphen q a greater than r p m dot list. Line 2: dollar sort less than r p m dot list. Line 3: abattis hyphen cantarell hyphen fonts hyphen 0 dot 0 dot 25 hyphen 6 dot e l 8 dot noarch. Line 4: accounts service hyphen 0 dot 6 dot 55 hyphen 2 dot e l 8 dot x 86 underscore 64. Line 5: accounts service hyphen libs hyphen 0 dot 6 dot 55 hyphen 2 dot e l 8 dot x 86 underscore 64. Line 6: a c l hyphen 2 dot 2 dot 53 hyphen 1 dot e l 8 dot 1 dot x 86 underscore 64. Line 7: adcli hyphen 0 dot 8 dot 2 hyphen 12 dot e l 8 dot x 86 underscore 64. Line 8: adobe hyphen mappings hyphen c m a p hyphen 20171205 hyphen 3 dot e l 8 dot noarch. Line 9: adobe hyphen mappings hyphen c m a p hyphen deprecated hyphen 20171205 hyphen 3 dot e l 8 dot noarch. Line 10: adobe hyphen mappings hyphen p d f hyphen 20180407 hyphen 1 dot e l 8 dot noarch. Line 11: adwaita hyphen cursor hyphen theme hyphen 3 dot 28 dot 0 hyphen 2 dot e l 8 dot noarch. Line 12: adwaita hyphen g t k 2 hyphen theme hyphen 3 dot 22 dot 3 hyphen 4 dot e l 8 dot x 86 underscore 64. Line 13: adwaita hyphen icon hyphen theme hyphen 3 dot 28 dot 0 hyphen 2 dot e l 8 dot noarch. Line 14: ellipsis.

Back to Code

Line 1: dollar r p m hyphen q a vertical bar sort. Line 2: abattis hyphen cantarell hyphen fonts hyphen 0 dot 0 dot 25 hyphen 6 dot e l 8 dot noarch. Line 3: accounts service hyphen 0 dot 6 dot 55 hyphen 2 dot e l 8 dot x 86 underscore 64.

Back to Code

Line 4: accounts service hyphen libs hyphen 0 dot 6 dot 55 hyphen 2 dot e l 8 dot x 86 underscore 64. Line 5: a c l hyphen 2 dot 2 dot 53 hyphen 1 dot e l 8 dot 1 dot x 86 underscore 64. Line 6: adcli hyphen 0 dot 8 dot 2 hyphen 12 dot e l 8 dot x 86 underscore 64. Line 7: adobe hyphen mappings hyphen c m a p hyphen 20171205 hyphen 3 dot e l 8 dot noarch. Line 8: adobe hyphen mappings hyphen c m a p hyphen deprecated hyphen 20171205 hyphen 3 dot e l 8 dot noarch. Line 9: adobe hyphen mappings hyphen p d f hyphen 20180407 hyphen 1 dot e l 8 dot noarch. Line 10: adwaita hyphen cursor hyphen theme hyphen 3 dot 28 dot 0 hyphen 2 dot e l 8 dot noarch. Line 11: adwaita hyphen g t k 2 hyphen theme hyphen 3 dot 22 dot 3 hyphen 4 dot e l 8 dot x 86 underscore 64. Line 12: adwaita hyphen icon hyphen theme hyphen 3 dot 28 dot 0 hyphen 2 dot e l 8 dot noarch. Line 13: ellipsis.

Back to Code

Line 1: dollar r p m hyphen q a vertical bar sort greater than r p m dot list. Line 2: dollar more r p m dot list. Line 3: abattis hyphen cantarell hyphen fonts hyphen 0 dot 0 dot 25 hyphen 6 dot e l 8 dot noarch. Line 4: accounts service hyphen 0 dot 6 dot 55 hyphen 2 dot e l 8 dot x 86 underscore 64. Line 5: accounts service hyphen libs hyphen 0 dot 6 dot 55 hyphen 2 dot e l 8 dot x 86 underscore 64. Line 6: a c l hyphen 2 dot 2 dot 53 hyphen 1 dot e l 8 dot 1 dot x 86 underscore 64. Line 7: adcli hyphen 0 dot 8 dot 2 hyphen 12 dot e l 8 dot x 86 underscore 64. Line 8: adobe hyphen mappings hyphen c m a p hyphen 20171205 hyphen 3 dot e l 8 dot noarch. Line 9: adobe hyphen mappings hyphen c m a p hyphen deprecated hyphen 20171205 hyphen 3 dot e l 8 dot noarch. Line 10: adobe hyphen mappings hyphen p d f hyphen 20180407 hyphen 1 dot e l 8 dot noarch. Line 11: adwaita hyphen cursor hyphen theme hyphen 3 dot 28 dot 0 hyphen 2 dot e l 8 dot noarch. Line 12: adwaita hyphen g t k 2 hyphen theme hyphen 3 dot 22 dot 3 hyphen 4 dot e l 8 dot x 86 underscore 64. Line 13: adwaita hyphen icon hyphen theme hyphen 3 dot 28 dot 0 hyphen 2 dot e l 8 dot noarch ellipsis.

Back to Code

Line 1: dollar print e n v. Line 2: SHELL equals slash bin slash bash. Line 3: SESSION underscore MANAGER equals local slash Ubuntu 20 colon at slash t m p slash dot I C E hyphen unix slash 1609 comma unix slash Ubuntu 20 colon slash t m p slash dot I C E hyphen unix slash 1609. Line 4: Q T underscore ACCESSIBILITY equals 1. Line 5: COLOR TERM equals truecolor. Line 6: X D G underscore CONFIG underscore D I R S equals slash e t c slash x d g slash x d g hyphen Ubuntu colon slash e t c slash x d g. Line 7: X D G underscore MENU underscore PREFIX equals gnome hyphen GNOME underscore DESKTOP underscore SESSION underscore I D equals this hyphen is hyphen deprecated. Line 8: GNOME underscore SHELL underscore SESSION underscore MODE equals Ubuntu. Line 9: S S H underscore AUTH underscore SOCK equals slash run slash user slash 1000 slash key ring slash s s h. Line 10: X MODIFIERS equals at i m equals i bus. Line 11: DESKTOP underscore SESSION equals Ubuntu. Line 12: S S H underscore AGENT underscore P I D equals 1562. Line 13: G T K underscore MODULES equals gail colon a t k hyphen bridge. Line 14: P W D equals slash home slash rich. Line 15: LOG NAME equals rich. Line 16: X D G underscore SESSION underscore DESKTOP equals Ubuntu. Line 17: X D G underscore SESSION underscore TYPE equals x 11.

Back to Code

Line 18: G P G underscore AGENT underscore INFO equals slash run slash user slash 1000 slash g n u p g slash S dot g p g hyphen agent colon 0 colon 1. Line 19: X AUTHORITY equals slash run slash user slash 1000 slash g d m slash X authority. Line 20: G J S underscore DEBUG underscore TOPICS equals J S ERROR semicolon J S LOG. Line 21: WINDOW PATH equals 2. Line 22: HOME equals slash home slash rich. Line 23: USERNAME equals rich. Line 24: I M underscore CONFIG underscore PHASE equals 1. Line 25: LANG equals en underscore U S dot U T F hyphen 8. Line 26: X D G underscore CURRENT underscore DESKTOP equals Ubuntu colon GNOME. Line 27: V T E underscore VERSION equals 6003. Line 28: GNOME underscore TERMINAL underscore SCREEN equals slash o r g slash gnome slash Terminal slash screen slash 5 6 4 7 9 9 c 2 underscore 2928 underscore 4 1 c f underscore 8 d 6 8 underscore 7 2 4 9 9 7 4 a d 9 9 9. Line 29: INVOCATION underscore I D equals 8 2 1 c 3 0 7 9 e c 8 6 4 a 1 5 9 2 a b 9 8 4 c 7 4 e 2 9 c 0 1. Line 30: MANAGE R P I D equals 1342. Line 31: G J S underscore DEBUG underscore OUTPUT equals s t d e r r. Line 32: LESS CLOSE equals slash u s r slash bin slash less pipe percentage s percentage s. Line 33: X D G underscore SESSION underscore CLASS equals user. Line 34: TERM equals x term hyphen 256 color. Line 35: LESS OPEN equals vertical bar slash u s r slash bin slash less pipe percentage s. Line 36: USER equals rich. Line 37: GNOME underscore TERMINAL underscore SERVICE equals colon 1 point 75. Line 38: DISPLAY equals colon 0. Line 39: S H L V L equals 1. Line 40: Q T underscore I M underscore MODULE equals i bus. Line 41: X D G underscore RUNTIME underscore D I R equals slash run slash user slash 1000. Line 42: JOURNAL underscore STREAM equals 8 colon 35357. Line 43: X D G underscore DATA underscore D I R S equals slash u s r slash share slash Ubuntu colon slash u s r slash local slash share slash colon slash u s r slash share slash colon slash var slash lib slash snap d slash desktop. Line 44: PATH equals slash u s r slash local slash s bin colon slash u s r slash local slash bin colon slash u s r slash s bin colon slash u s r slash bin colon slash s bin colon slash bin colon slash u s r slash games colon slash u s r slash local slash games colon slash snap slash bin. Line 45: G D M SESSION equals Ubuntu. Line 46: D BUS underscore SESSION underscore BUS underscore ADDRESS equals unix colon path equals slash run slash user slash 1000 slash bus. Line 47: OLD P W D equals slash home slash rich slash Desktop. Line 48: underscore equals slash u s r slash bin slash print e n v. Line 49: dollar.

Back to Code

Line 1: BASH equals slash u s r slash bin slash bash. Line 2: BASH OPTS equals check winsize colon c m d hist colon complete underscore fullquote colon expand underscore aliases colon e x t glob colon e x t quote colon force underscore fignore colon glob asci ranges colon hist append colon interactive underscore comments colon prog comp colon prompt vars colon source path. Line 3: BASH underscore ALIASES equals open parenthesis close parenthesis. Line 4: BASH underscore A R G C equals open parenthesis open bracket 0 close bracket equals double quote 0 double quote close parenthesis. Line 5: BASH underscore A R G V equals open parenthesis close parenthesis. Line 6: BASH underscore C M D S equals open parenthesis close parenthesis. Line 7: BASH underscore COMPLETION underscore VERS INFO equals open parenthesis open bracket 0 close bracket equals double quote 2 double quote open bracket 1 close bracket equals double quote 10 double quote close parenthesis. Line 8: BASH underscore LINE NO equals open parenthesis close parenthesis. Line 9: BASH underscore SOURCE equals open parenthesis close parenthesis. Line 10: BASH underscore VERS INFO equals open parenthesis open bracket 0 close bracket equals double quote 5 double quote open bracket 1 close bracket equals double quote 0 double quote open bracket 2 close bracket equals double quote 17 double quote open bracket 3 close bracket equals double quote 1 double quote open bracket 4 close bracket equals double quote release double quote open bracket 5 close bracket equals double quote x 86 underscore 64 hyphen p c hyphen linux hyphen g n u double quote close parenthesis. Line 11: BASH underscore VERSION equals single quote 5 dot 0 dot 17 open parenthesis 1 close parenthesis hyphen release single quote.

Back to Code

Line 1: dollar test equals testing a long string. Line 2: hyphen bash colon a colon command not found. Line 3: dollar test equals single quote testing a long string single quote. Line 4: dollar echo dollar test. Line 5: testing a long string. Line 6: dollar.

Back to Code

Line 1: dollar space bash. Line 2: dollar space echo space dollar test. Line 3: dollar space exit. Line 4: exit. Line 5: dollar space echo space dollar test. Line 6: testing a long string. Line 7: dollar.

Back to Code

Line 1: dollar space bash. Line 2: dollar space test equals testing. Line 3: dollar space echo space dollar test. Line 4: testing. Line 5: dollar space exit. Line 6: exit. Line 7: dollar space echo space dollar test. Line 8: dollar.

Back to Code

Line 1: dollar space echo space dollar test. Line 2: testing a long string. Line 3: dollar space export space test. Line 4: dollar space bash. Line 5: dollar space echo space dollar test. Line 6: testing a long string. Line 7: dollar.

Back to Code

Line 1: dollar space test equals testing. Line 2: dollar space export space test. Line 3: dollar space bash. Line 4: dollar space echo space dollar test. Line 5: testing. Line 6: dollar space unset space test. Line 7: dollar space echo space dollar test. Line 8: dollar space exit. Line 9: exit. Line 10: dollar space echo space dollar test. Line 11: testing. Line 12: dollar.

Back to Code

Line 1: dollar space dot slash script 1 dot s h. Line 2: Sat 20 Nov 2021 08 colon 56 colon 16 A M E S T. Line 3: rich space colon 0 space 2021 hyphen 11 hyphen 20 space 08 colon 21 space open parenthesis colon 0 close parenthesis. Line 4: dollar.

Back to Code

Line 1: dollar space cat space script 1 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash space This script displays the date and who’s logged in. Line 4: echo The current date and time is colon. Line 5: date. Line 6: echo. Line 7: echo double quote Let’s see who’s logged into the system colon double quote. Line 8: who.

Back to Code

Line 1: dollar space dot slash script 1 dot s h. Line 2: The current date and time is colon. Line 3: Sat Nov 20 09 colon 05 colon 44 E S T 2021. Line 4: Let’s see who’s logged into the system colon. Line 5: rich space colon 0 space 2021 hyphen 11 hyphen 20 space 08 colon 21 space open parenthesis colon 0 close parenthesis. Line 6: dollar.

Back to Code

Line 1: dollar space cat space script 2 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash space display user information from the system dot. Line 4: echo space User space info space for space user i d colon space dollar USER. Line 5: echo space U I D colon space dollar U I D. Line 6: echo space HOME colon space dollar HOME.

Back to Code

Line 1: dollar space c h mod space u plus x space script 2 dot s h. Line 2: dollar space dot slash script 2 dot s h. Line 3: User space info space for space user i d colon space rich. Line 4: U I D colon space 1000. Line 5: HOME colon space slash home slash rich. Line 6: dollar.

Back to Code

Line 1: dollar space cat space script 3 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash space testing space variables. Line 4: days equals 10. Line 5: guest equals Rich. Line 6: echo space dollar guest space checked space in space dollar days space days space ago. Line 7: dollar.

Back to Code

Line 1: dollar space cat space script 4 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash space Testing command line arguments. Line 4: echo space dollar 1 space checked space in space dollar 2 space days space ago. Line 5: dollar space c h mod space u plus x space script 4 dot s h. Line 6: dollar space dot slash script 4 dot s h space Barbara space 4. Line 7: Barbara checked in 4 days ago. Line 8: dollar space dot slash script 4 dot s h space Jessica space 5. Line 9: Jessica checked in 5 days ago. Line 10: dollar.

Back to Code

Line 1: dollar space cat space script 4 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash space Testing command line arguments. Line 4: echo space dollar 1 space checked space in space dollar 2 space days space ago. Line 5: dollar space c h mod space u plus x space script 4 dot s h. Line 6: dollar space dot slash script 4 dot s h space Barbara space 4. Line 7: Barbara checked in 4 days ago. Line 8: dollar space dot slash script 4 dot s h space Jessica space 5. Line 9: Jessica checked in 5 days ago. Line 10: dollar.

Back to Code

Line 1: dollar space var 1 equals backtick date backtick. Line 2: dollar space echo space dollar var 1. Line 3: Sat Nov 20 09 colon 15 colon 38 E S T 2021. Line 4: dollar space var 2 equals dollar open parenthesis who close parenthesis. Line 5: dollar space echo space dollar var 2. Line 6: rich space colon 0 space 2021 hyphen 11 hyphen 20 space 08 colon 21 space open parenthesis colon 0 close parenthesis. Line 7: dollar.

Back to Code

Line 1: dollar cat script 5 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash testing the if condition. Line 4: if open bracket dollar 1 hyphen e q dollar 2 close bracket.

Back to Code

Line 5: then. Line 6: single indent, echo double quote Both values are equal exclamation double quote. Line 7: single indent, exit. Line 8: f i. Line 9: if open bracket dollar 1 hyphen g t dollar 2 close bracket. Line 10: then. Line 11: single indent, echo double quote The first value is greater than the second double quote. Line 12: single indent, exit. Line 13: f i. Line 14: if open bracket dollar 1 hyphen l t dollar 2 close bracket. Line 15: then. Line 16: single indent, echo double quote The first value is less than the second double quote. Line 17: single indent, exit. Line 18: f i.

Back to Code

Line 1: dollar cat script 6 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash iterate through the files in the Home folder. Line 4: for file in dollar open parenthesis l s vertical bar sort close parenthesis semicolon do.

Back to Code

Line 5: single indent, if open bracket hyphen d dollar file close bracket. Line 6: single indent, then. Line 7: double indent, echo double quote dollar file is a directory double quote. Line 8: single indent, f i. Line 9: single indent, if open bracket hyphen f dollar file close bracket. Line 10: single indent, then. Line 11: double indent, echo double quote dollar file is a file double quote. Line 12: single indent, f i. Line 13: done. Line 14: dollar.

Back to Code

Line 1: dollar c h mod 777 script 6 dot s h. Line 2: dollar dot slash script 6 dot s h. Line 3: Desktop is a directory. Line 4: Documents is a directory. Line 5: Downloads is a directory. Line 6: Music is a directory. Line 7: Pictures is a directory. Line 8: Public is a directory. Line 9: Templates is a directory. Line 10: script 1 dot s h is a file. Line 11: script 2 dot s h is a file. Line 12: script 3 dot s h is a file. Line 13: script 4 dot s h is a file. Line 14: script 5 dot s h is a file. Line 15: script 6 dot s h is a file. Line 16: script 7 dot s h is a file. Line 17: today dot t x t is a file. Line 18: Videos is a directory. Line 19: dollar.

Back to Code

Line 1: dollar file my prog dot c. Line 2: my prog dot c colon C source comma ASCII text. Line 3: dollar file my prog. Line 4: my prog colon E L F 64 hyphen bit L S B shared object comma x 86 hyphen 64 comma version 1 open parenthesis S Y S V close parenthesis comma dynamically linked comma interpreter slash lib 64 slash l d hyphen linux hyphen x 86 hyphen 64 dot so dot 2 comma Build I D open bracket sha 1 close bracket equals a 0 7 5 8 1 5 9 d f 7 a 4 7 9 a 5 4 e f 3 8 6 b 9 7 0 a 2 6 f 0 7 6 5 6 1 d f e comma for G N U slash Linux 3 dot 2 dot 0 comma not stripped. Line 5: dollar.

Back to Code

Line 1: dollar space l s. Files are listed in the next four lines and in eight columns, as follows: data 1, data 2, data dot t x t, Desktop, d i r 1, d i r 2, d m e s g dot t x t, Documents, Downloads, file 1, file 2, file dot t x t, Junk, menu 1, menu 3, menu 5, Music, my test, Pictures, Public, snap, temp 1, Templates, test, test 1 dot s h, test 1 dot t x t, test dot s h, test dot t x t, and Videos. Line 6: dollar l s space hyphen a. All files are listed in three columns, as follows: dot, double dot, dot bash underscore history, dot bash underscore logout, dot bash r c, dot cache dot, dot config, data 1, data 2, data dot t x t, Desktop, d i r 1, d i r 2, d m e s g dot t x t, Documents, Downloads, file 1, file 2, file dot t x t, dot g n u p g, Junk, dot less h s t, local, menu 1, menu 3, menu 5, dot mozilla, Music, my test, Pictures, dot profile, Public, snap, dot s s h, dot sudo underscore as underscore admin underscore successful, temp 1, Templates, test, test 1 dot s h, test 1 dot t x t, test dot s h, test dot t x t, dot thunderbird, dot v box client hyphen clipboard dot p i d, dot v box client hyphen display hyphen s v g a hyphen x 11 dot p i d, dot v box client hyphen dragon d drop dot p i d, dot v box client hyphen seamless dot p i d, Videos, and dot z comp dump. Last line: dollar.

Back to Code

Line 1: dollar space l s space hyphen i l. Line 2: total space 32. Line 3: 1 3 5 3 3 7 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 61 space Dec 11 09 colon 34 space copy dot c. Line 4: 1 3 6 7 2 3 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 09 colon 11 space d i r 1. Line 5: 1 3 6 7 3 2 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 09 colon 11 space d i r 2. Line 6: 1 3 6 6 4 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 09 colon 11 space file 1. Line 7: 1 3 6 6 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 09 colon 11 space file 2. Line 8: 1 3 1 8 1 3 space hyphen r w x r w x r hyphen x space 1 space rich space rich space 1 6 6 9 6 space Dec 11 09 colon 34 space my prog. Line 9: 1 3 5 3 3 7 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 61 space Dec 11 09 colon 34 space my prog dot c. Line 10: dollar.

Back to Code

Line 1: dollar space l s. Files are listed in the next four lines and in eight columns, as follows: data 1, data 2, data dot t x t, Desktop, d i r 1, d i r 2, d m e s g dot t x t, Documents, Downloads, file 1, file 2, file dot t x t, Junk, menu 1, menu 3, menu 5, Music, my test, Pictures, Public, snap, temp 1, Templates, test, test 1 dot s h, test 1 dot t x t, test dot s h, test dot t x t, and Videos. Line 6: dollar.

Back to Code

Line 1: dollar space l s space hyphen F. Files are listed in the next five lines and in six columns, as follows: data 1, data 2, data dot t x t, Desktop slash, d i r 1 slash, d i r 2 slash, d m e s g dot t x t, Documents slash, Downloads slash, file 1, file 2, file dot t x t, Junk slash, menu 1 asterisk, menu 3 asterisk, menu 5 asterisk, Music slash, my test asterisk, Pictures slash, Public slash, snap slash, temp 1, Templates slash, test slash, test 1 dot s h asterisk, test 1 dot t x t, test dot s h asterisk, test dot t x t, and Videos slash. Line 6: dollar.

Back to Code

Line 1: dollar space l s space hyphen F space hyphen R. Line 2: dot colon. Line 3: file 1 space test 1 slash space test 2 slash. Line 4: dot slash test 1 colon. Line 5: my prog 1 asterisk space my prog 2 asterisk. Line 6: dot slash test 2 colon. Line 7: dollar.

Back to Code

Line 1: $ space ls space hyphen l. Line 2: total space 156. Line 3: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 32 space Sep 24 2020 space data 1. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 189 space Aug 24 2020 space data 2. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 192 space Jul 27 2020 space data dot t x t. Line 6: d r w x r hyphen x r hyphen x space 2 space rich space rich space 4 0 9 6 space Jul 21 2020 space Desktop. Line 7: d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 19 colon 11 space d i r 1. Line 8: d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 19 colon 11 space d i r 2. Line 9: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 4 9 1 9 2 space Oct 28 19 colon 29 space d m e s g dot t x t. Line 10: d r w x r hyphen x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 15 16 colon 02 space Documents. Line 11: d r w x r hyphen x r hyphen x space 2 space rich space rich space 4 0 9 6 space Jul 21 2020 space Downloads. Line 12: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 19 colon 11 space file 1. Line 13: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 19 colon 11 space file 2. Line 14: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 11 space Jul 27 2020 space file dot t x t. Line 15: ellipsis. Line 16: dollar.

Back to Code

Line 1: dollar space l s space hyphen sail. Line 2: total space 292. Line 3: 1 0 6 2 2 7 4 space 4 space d r w x r hyphen x r hyphen x space 22 space rich space rich space 4 0 9 6 space Dec 13 19 colon 32 dot. Line 4: 1 0 5 0 6 2 5 space 4 space d r w x r hyphen x r hyphen x space 3 space root space root space 4 0 9 6 space Jul 21 2020 space double dot. Line 5: 1 0 6 2 2 7 5 space 16 space hyphen r w hyphen hyphen hyphen hyphen hyphen hyphen hyphen space 1 space rich space rich space 1 6 3 2 1 space Dec 13 19 colon 42 space dot bash underscore history. Line 6: 1 0 6 9 9 9 9 space 4 space hyphen r w hyphen r double hyphen r double hyphen space 1 space rich space rich space 220 space Jul 21 2020 space dot bash underscore logout. Line 7: 1 0 7 0 0 0 7 space 4 space hyphen r w hyphen r double hyphen r double hyphen space 1 space rich space rich space 3 7 7 1 space Jul 21 2020 space dot bash r c. Line 8: 6 7 5 4 0 7 space 4 space d r w x r hyphen x r hyphen x space 16 space rich space rich space 4 0 9 6 space Oct 5 19 colon 31 space dot cache. Line 9: 5 2 8 3 8 3 space 4 space d r w x r hyphen x r hyphen x space 16 space rich space rich space 4 0 9 6 space Oct 5 19 colon 30 space dot config. Line 10: 1 0 5 3 1 5 8 space 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 32 space Sep 24 2020 space data 1. Line 11: 1 0 5 3 4 5 2 space 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 189 space Aug 24 2020 space data 2. Line 12: 1 0 6 5 2 5 7 space 4 space hyphen r w hyphen r w hyphen r double hyphen 1 space rich space rich space 192 space Jul 27 2020 space data dot t x t. Line 13: 6 7 5 4 5 0 space 4 space d r w x r hyphen x r hyphen x space 2 space rich space rich space 4 0 9 6 space Jul 21 2020 space Desktop. Line 14: 1 3 5 3 4 5 space 4 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 19 colon 11 space d i r 1. Line 15: 1 3 5 4 5 8 space 4 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 19 colon 11 space d i r 2. Line 16: 1 0 5 4 7 6 0 space 52 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 4 9 1 9 2 space Oct 28 19 colon 29 space d m e s g dot t x t. Line 17: 6 7 5 4 5 4 space 4 space d r w x r hyphen x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 15 16 colon 02 space Documents. Line 18: 6 7 5 4 5 1 space 4 space d r w x r hyphen x r hyphen x space 2 space rich space rich space 4 0 9 6 space Jul 21 2020 space Downloads. Line 19: 1 0 5 3 8 4 6 space 0 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 09 colon 11 space file 1. Line 20: 1 0 5 5 0 0 0 space 0 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 09 colon 11 space file 2. Line 21: 1 0 6 6 0 8 7 space 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 11 space Jul 27 2020 space file dot t x t. Line 22: ellipsis. Line 23: dollar.

Back to Code

Line 1: dollar space m k d i r space d i r 3. Line 2: dollar space l s space hyphen i l. Line 3: total space 40. Line 4: 1 3 53 3 7 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 61 space Dec 13 19 colon 34 space copy dot c. Line 5: 1 3 6 7 2 3 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 19 colon 11 space d i r 1. Line 6: 1 3 6 7 3 2 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Nov 9 19 colon 11 space d i r 2. Line 7: 3 9 5 0 3 5 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Dec 13 20 colon 04 space d i r 3. Line 8: 1 3 6 6 4 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 19 colon 11 space file 1.

Back to Code

Continue.Line 9: 1 3 6 6 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Nov 9 19 colon 11 space file 2. Line 10: 1 3 1 8 1 3 space hyphen r w x r w x r hyphen x space 1 space rich space rich space 1 6 6 9 6 space Dec 13 19 colon 34 space my prog. Line 11: 1 3 5 3 3 7 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 61 space Dec 13 19 colon 34 space my prog dot c. Line 12: dollar.

Back to Code

Line 1: dollar space r m space hyphen r space d i r 2. Line 2: r m colon space descend into directory space single quote d i r 2 single quote question mark space y. Line 3: r m colon space remove space single quote d i r 2 slash test 1 single quote question mark space y. Line 4: r m colon space remove space single quote d i r 2 slash test 3 single quote question mark space y. Line 5: r m colon space remove space single quote d i r 2 slash test 4 single quote question mark space y. Line 6: r m colon space remove space directory space single quote d i r 2 single quote question mark space y. Line 7: dollar.

Back to Code

Line 1: dollar space touch space test 1. Line 2: dollar space l s space hyphen i l space test 1. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 20 colon 07 space test 1. Line 4: dollar.

Back to Code

Line 1: dollar space touch space test 1. Line 2: dollar space l s space hyphen i l space test 1. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 20 colon 10 space test 1. Line 4: dollar.

Back to Code

Line 1: dollar space touch space hyphen t space 2 0 2 5 1 2 2 5 1 2 0 0 space test 1. Line 2: dollar space l s space hyphen i l space test 1. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 space 2025 space test 1. Line 4: dollar.

Back to Code

Line 1: dollar space c p space test 1 space test 2. Line 2: dollar space l s space hyphen i l. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 space 2025 space test 1. Line 4: 1 3 5 4 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 space 20 colon 13 space test 2. Line 5: dollar.

Back to Code

Line 1: dollar space c p space test 1 space d i r 1. Line 2: dollar space l s space hyphen i l space d i r 1. Line 3: total space 0. Line 4: 1 3 5 5 9 2 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 space 20 colon 16 space test 1. Line 5: dollar.

Back to Code

Line 1: dollar space c p space hyphen p space test 1 space test 3. Line 2: dollar space l s space hyphen i l space test asterisk. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 1.

Back to Code

Line 4: 1 3 5 4 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 20 colon 13 space test 2. Line 5: 1 3 5 8 2 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 3. Line 6: dollar.

Back to Code

Line 1: dollar space c p space hyphen R space d i r 1 space d i r 2. Line 2: dollar space l s space hyphen i l. Line 3: total space 40. Line 4: 1 3 5 3 3 7 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 61 space Dec 13 19 colon 34 space copy dot c. Line 5: 1 3 6 7 2 3 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Dec 13 19 colon 16 space d i r 1. Line 6: 3 9 5 0 9 8 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Dec 13 20 colon 15 space d i r 2. Line 7: 3 9 5 0 3 5 space d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Dec 13 20 colon 04 space d i r 3. Line 8: ellipsis. Line 9: dollar.

Back to Code

Line 1: dollar space c p space hyphen f space test asterisk space d i r 2. Line 2: dollar space l s space hyphen a l space d i r 2. Line 3: total space 8. Line 4: d r w x r w x r hyphen x space 2 space rich space rich space 4 0 9 6 space Dec 14 19 colon 10 space dot. Line 5: d r w x r w x r hyphen x space 5 space rich space rich space 4 0 9 6 space Dec 14 19 colon 05 space double dot. Line 6: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 10 space test 1. Line 7: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 10 space test 2. Line 8: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 10 space test 3. Line 9: dollar.

Back to Code

Line 1: dollar space c p space hyphen l space test 1 space test 4. Line 2: dollar space l s space hyphen i l space test asterisk. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 1. Line 4: 1 3 5 4 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 20 colon 13 space test 2. Line 5: 1 3 5 8 2 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 3. Line 6: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 4. Line 7: dollar.

Back to Code

Line 1: dollar space c p space hyphen s space test 1 space test 5. Line 2: dollar space l s space hyphen i l space test asterisk. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 1. Line 4: 1 3 5 4 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 20 colon 13 space test 2. Line 5: 1 3 5 8 2 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 3. Line 6: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 4. Line 7: 1 3 5 3 3 5 space l r w x r w x r w x space 1 space rich space rich space 5 space Dec 14 19 colon 17 space test 5 space hyphen greater than space test 1. Line 8: dollar.

Back to Code

Line 1: dollar space m v space test 2 space test 6. Line 2: dollar space l s space hyphen i l space test asterisk. Line 3: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 1. Line 4: 1 3 5 8 2 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 3. Line 5: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 4. Line 6: 1 3 5 3 3 5 space l r w x r w x r w x space 1 space rich space rich space 5 space Dec 14 19 colon 17 space test 5 space hyphen greater than space test 1. Line 7: 1 3 5 4 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 20 colon 13 space test 6. Line 8: dollar.

Back to Code

Line 1: dollar space m v space test 1 space test 7. Line 2: dollar space l s space hyphen i l space test asterisk. Line 3: 1 3 5 8 2 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 3. Line 4: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 4.

Back to Code

Line 5: 1 3 5 3 3 5 space l r w x r w x r w x space 1 space rich space rich space 5 space Dec 14 19 colon 17 space test 5 space hyphen greater than space test 1. Line 6: 1 3 5 4 7 6 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 13 20 colon 13 space test 6. Line 7: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 7. Line 8: dollar.

Back to Code

Line 1: dollar space r m space hyphen i space test 6. Line 2: r m colon space remove regular empty file single quote test 6 single quote question mark space y. Line 3: dollar space l s space hyphen i l space test asterisk. Line 4: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 1. Line 5: 1 3 5 8 2 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 3. Line 6: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 2 space rich space rich space 0 space Dec 25 2025 space test 4. Line 7: 1 3 5 3 3 5 space l r w x r w x r w x space 1 space rich space rich space 5 space Dec 14 19 colon 17 space test 5 space hyphen greater than space test 1. Line 8: dollar.

Back to Code

Line 1: dollar space r m space test 1. Line 2: dollar space l s space hyphen i l space test asterisk. Line 3: 1 3 5 8 2 4 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 25 2025 space test 3. Line 4: 1 3 5 4 7 5 space hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 6 space Dec 14 19 colon 25 space test 4. Line 5: 1 3 5 3 3 5 space l r w x r w x r w x space 1 space rich space rich space 5 space Dec 14 19 colon 17 space test 5 space hyphen greater than space test 1. Line 6: dollar space cat space test 4.

Back to Code

Line 7: hello. Line 8: dollar space cat space test 5. Line 9: cat colon space test 5 colon space No such file or directory. Line 10: dollar.

Back to Code

Line 1: dollar space l s space hyphen l. Line 2: total space 0. Line 3: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 27 space file 10 dot t x t.

Back to Code

Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 27 space file 1 dot t x t. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 27 space file 2 dot t x t. Line 6: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 27 space file dot t x t. Line 7: dollar space r m space file question mark dot t x t. Line 8: dollar space l s space hyphen l. Line 9: total space 0. Line 10: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 27 space file 10 dot t x t. Line 11: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 27 space file dot t x t. Line 12: dollar.

Back to Code

Line 1: dollar space l s space hyphen l. Line 2: total space 0. Line 3: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 29 space file 10 dot t x t. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 29 space file 1 dot t x t. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 29 space file 2 dot t x t. Line 6: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 29 space file dot t x t. Line 7: dollar space r m space file asterisk dot t x t. Line 8: dollar space l s space hyphen l. Line 9: total space 0. Line 10: dollar.

Back to Code

Line 1: dollar space l s space hyphen l. Line 2: total space 0. Line 3: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 31 space single quote long file name dot t x t single quote. Line 4: dollar space r m space long space file space name dot t x t. Line 5: r m colon space cannot remove single quote long single quote colon space No such file or directory. Line 6: r m colon space cannot remove single quote file single quote colon space No such file or directory.

Back to Code

Line 7: r m colon space cannot remove single quote name dot t x t single quote colon space No such file or directory. Line 8: dollar.

Back to Code

Line 1: dollar space l s space hyphen l. Line 2: total space 0. Line 3: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 32 space file 1 dot t x t. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 32 space uppercase File 1 dot t x t. Line 5: dollar space r m space uppercase File 1 dot t x t. Line 6: dollar space l s space hyphen l. Line 7: total space 0. Line 8: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space rich space 0 space Dec 14 19 colon 32 space file 1 dot t x t. Line 9: dollar.

Back to Code

Line 1: dollar space locate space touch. Line 2: slash e t c slash b r l t t y slash Input slash a l slash b c hyphen e touch dot k t i. Line 3: slash e t c slash b r l t t y slash Input slash h w slash touch dot k t b. Line 4: slash snap slash core 18 slash 2 2 4 6 slash bin slash touch. Line 5: slash snap slash core 18 slash 2 2 4 6 slash lib slash u d e v slash h w d b dot d slash 70 hyphen touchpad dot h w d b. Line 6: ellipsis. Line 7: dollar.

Back to Code

Line 1: auto space eth 0. Line 2: i face space eth 0 space i net space static. Line 3: address space 192 dot 168 dot 1 dot 77. Line 4: netmask space 255 dot 255 dot 255 dot 0. Line 5: gateway space 192 dot 168 dot 1 dot 254. Line 6: i face space eth 0 space i net 6 space static. Line 7: address space 2003 colon a e f 0 double colon 23 d 1 double colon 0 a 10 colon 0 0 a 1. Line 8: netmask space 64. Line 9: gateway space 2003 colon a e f 0 double colon 23 d 1 double colon 0 a 10 colon 0 0 0 1.

Back to Code

Line 1: TYPE equals Ethernet. Line 2: PROXY underscore METHOD equals none. Line 3: BROWSER underscore ONLY equals no. Line 4: BOOT PROTO equals d h c p. Line 5: DEF ROUTE equals yes. Line 6: I P V 4 underscore FAILURE underscore FATAL equals no. Line 7: I P V 6 INIT equals yes. Line 8: I P V 6 underscore AUTO CONF equals yes. Line 9: I P V 6 underscore DEF ROUTE equals yes. Line 10: I P V 6 underscore FAILURE underscore FATAL equals no. Line 11: I P V 6 underscore A D D R underscore GEN underscore MODE equals stable hyphen privacy. Line 12: NAME equals e n p 0 s 3. Line 13: U U I D equals c 8 7 5 2 3 6 6 hyphen 3 e 1 e hyphen 4 7 e 3 hyphen 8 1 6 2 hyphen c 0 4 3 5 e c 6 d 4 5 1. Line 14: DEVICE equals e n p 0 s 3. Line 15: ON BOOT equals yes. Line 16: I P V 6 underscore PRIVACY equals no.

Back to Code

A column of icons is listed on the left pane of the screen. An empty radio signal icon at top right of the screen is clicked to pop down a menu of options. Two Ethernet networks and Wi-Fi networks are disconnected. Available networks are then listed with their names and radio signal icons. Enable Networking and Enable Wi-Fi options are checked at the bottom.

Back to Figure

Name and last used time are listed in a box. Ethernet and Wi-Fi are the two expanded dropdown options of the box. Wired connection 2 and wired connection 1 are listed under Ethernet and Test is indicated under Wi-Fi. Add, edit, and delete buttons are to the right of the box and close button is at bottom right of the window.

Back to Figure

The window is titled rich at local host. File, edit, view, search, terminal, and help are the menus at the top of the window. A dialog box in the forefront represents Network Manager T U I. Under please select an option, Edit a connection, Activate a connection, and Set system hostname are the options listed in which Edit a connection option is selected. Quit option is at bottom left and Ok option is at bottom right of the dialog box.

Back to Figure

Line 1: dollar space n m c l i. Line 2: e n p 0 s 3 colon space connected to e n p 0 s 3. Line 3: double quote Intel 8 2 5 4 0 E M Gigabit Ethernet Controller open parenthesis PRO slash 1000 M T Desktop Adapter close parenthesis. Line 4: ethernet space open parenthesis e 1000 close parenthesis comma space 08 colon 00 colon 27 colon 73 colon 1 C colon 6 D comma space h w comma space m t u 1500. Line 5: i p 4 space default. Line 6: i net 4 space 10 dot 0 dot 2 dot 15 slash 24. Line 7: route 4 space 0 dot 0 dot 0 dot 0 slash 0. Line 8: route 4 space 10 dot 0 dot 2 dot 0 slash 24. Line 9: i net 6 space f e 80 double colon 5 4 3 2 colon e d d b colon 5 1 e a colon f b 44 slash 64. Line 10: route 6 space f f 0 0 double colon slash 8. Line 11: route 6 space f e 80 double colon slash 64. Line 12: route 6 space f e 80 double colon slash 64.

Back to Code

Line 1: hash space n m c l i space con space add space type space ethernet space conname space eth 1 space if name space e n p 0 s 3 space i p 4. Line 2: 10 dot 0 dot 2 dot 10 slash 24 space g w 4 space 192 dot 168 dot 1 dot 254.

Back to Code

Line 1: dollar space i p space address space show. Line 2: 1 colon space lo colon space open angle bracket LOOPBACK comma UP comma LOWER underscore UP close angle bracket space m t u space 6 5 5 3 6 space q disc space no queue space state space UNKNOWN space group. Line 3: default space q len space 1000. Line 4: single indent, link slash loopback space 0 0 colon 0 0 colon 0 0 colon 0 0 colon 0 0 colon 0 space b r d space 0 0 colon 0 0 colon 0 0 colon 0 0 colon 0 0 colon 0 0. Line 5: single indent, i net space 127 dot 0 dot 0 dot 1 slash 8 space scope space host space lo. Line 6: double indent, valid underscore l f t space forever space preferred underscore l f t space forever. Line 7: single indent, i net 6 space double colon 1 slash 128 space scope space host. Line 8: double indent, valid underscore l f t space forever space preferred underscore l f t space forever. Line 9: 2: e n p 0 s 3 colon space open angle bracket BROADCAST comma MULTICAST comma UP comma LOWER underscore UP close angle bracket space m t u space 1500 space q disc space p f i f o underscore fast. Line 10: state space UP space group space default space q len 1000. Line 11: single indent, link slash ether space 0 8 colon 0 0 colon 2 7 colon 7 3 colon 1 c colon 6 d space b r d space f f colon f f colon f f colon f f colon f f colon f f. Line 12: single indent, i net space 10 dot 0 dot 2 dot 15 slash 24 space b r d space 10 dot 0 dot 2 dot 255 space scope space global. Line 13: no prefix route space dynamic. Line 14: e n p 0 s 3. Line 15: double indent, valid underscore l f t space 8 4 4 1 1 sec space preferred underscore l f t space 8 4 4 1 1 sec. Line 16: single indent, i net 6 space f e 80 double colon 5 4 3 2 colon e d d b colon 51 e a colon f b 44 slash 64 space scope space link space no prefix route. Line 17: double indent, valid underscore l f t space forever space preferred underscore l f t space forever. Line 18: dollar.

Back to Code

Line 1: dollar space eth tool space e n p 0 s 3. Line 2: Settings for e n p 0 s 3 colon. Line 3: Supported ports colon open bracket T P close bracket. Line 4: Supported link modes colon 10 base T slash Half space 10 base T slash Full. Line 5: 100 base T slash Half space 100 base T slash Full. Line 6: 1000 base T slash Full. Line 7: Supported pause frame use colon No. Line 8: Supports auto-negotiation colon Yes. Line 9: Supported F E C modes colon Not reported. Line 10: Advertised link modes colon 10 base T slash Half space 10 base T slash Full. Line 11: 100 base T slash Half space 100 base T slash Full. Line 12: 1000 base T slash Full. Line 13: Advertised pause frame use colon No. Line 14: Advertised auto-negotiation colon Yes. Line 15: Advertised F E C modes colon Not reported. Line 16: Speed colon 1000 M b slash s. Line 17: Duplex colon Full. Line 18: Port colon Twisted Pair. Line 19: P H Y A D colon 0. Line 20: Transceiver colon internal. Line 21: Auto hyphen negotiation colon on. Line 22: M D I hyphen X colon off open parenthesis auto close parenthesis. Line 23: Cannot get wake hyphen on hyphen lan settings colon Operation not permitted. Line 24: Current message level colon 0 x 0 0 0 0 0 0 0 7 space open parenthesis 7 close parenthesis. Line 25: d r v probe link. Line 26: Link detected colon yes. Line 27: dollar.

Back to Code

Line 1: dollar space if config. Line 2: e n p 0 s 3 colon space flags equals 4 1 6 3 open angle bracket UP comma BROADCAST comma RUNNING comma MULTICAST close angle bracket space m t u space 1500. Line 3: i net space 10 dot 0 dot 2 dot 15 space net mask space 255 dot 255 dot 255 dot 0 space broadcast space 10 dot 0 dot 2 dot 255. Line 4: i net 6 space f e 80 double colon a 0 0 colon 2 7 f f colon f e 5 5 colon d f b d space prefix len space 64 space scope i d space 0 x 20 open angle bracket link close angle bracket. Line 5: ether space 08 colon 00 colon 27 colon 55 colon d f colon b d space t x queue len space 1000 space open parenthesis Ethernet close parenthesis. Line 6: R X space packets space 1 9 0 6 7 space bytes space 2 8 0 9 2 7 6 2 space open parenthesis 26 dot 7 M i B close parenthesis. Line 7: R X space errors space 0 space dropped space 0 space overruns space 0 space frame space 0. Line 8: T X space packets space 6 4 3 1 space bytes space 4 1 4 1 5 3 space open parenthesis 404 dot 4 K i B close parenthesis. Line 9: T X space errors space 0 space dropped space 0 space overruns space 0 space carrier space 0 space collisions space 0. Line 10: lo colon space flags equals 73 open angle bracket UP comma LOOPBACK comma RUNNING close angle bracket space m t u space 6 5 5 3 6. Line 11: i net space 127 dot 0 dot 0 dot 1 space net mask space 255 dot 0 dot 0 dot 0. Line 12: i net 6 space double colon 1 space prefix len space 128 space scope i d space 0 x 10 open angle bracket host open angle bracket. Line 13: loop space t x queue len space 1000 space open parenthesis Local Loopback close parenthesis. Line 14: R X space packets space 4 space bytes space 240 space open parenthesis 240 dot 0 B close parenthesis. Line 15: R X space errors space 0 space dropped space 0 space overruns space 0 space frame space 0. Line 16: T X space packets space 4 space bytes space 240 space open parenthesis 240 dot 0 B close parenthesis. Line 17: T X space errors space 0 space dropped space 0 space overruns space 0 space carrier space 0 space collisions space 0. Line 18: v i r b r 0 colon space flags equals 4 0 9 9 open angle bracket UP comma BROADCAST comma MULTICAST close angle bracket space m t u space 1500. Line 19: i net space 192 dot 168 dot 122 dot 1 space net mask space 255 dot 255 dot 255 dot 0 space broadcast space 192 dot 168 dot 122 dot 255. Line 20: ether space 52 colon 54 colon 00 colon 10 colon 7 a colon b 8 space t x queue len space 1000 space open parenthesis Ethernet close parenthesis. Line 21: R X space packets space 0 space bytes space 0 space open parenthesis 0 dot 0 B close parenthesis. Line 22: R X space errors space 0 space dropped space 0 space overruns space 0 space frame space 0. Line 23: T X space packets space 0 space bytes space 0 space open parenthesis 0 dot 0 B close parenthesis. Line 24: T X space errors space 0 space dropped space 0 space overruns space 0 space carrier space 0 space collisions space 0. Line 25: dollar.

Back to Code

Line 1: dollar space route. Line 2: Kernel space I P space routing space table. Line 3: Destination space Gateway space Genmask space Flags space Metric space Ref space Use.

Back to Code

Line 4: I face default e n p 0 s 3 space 192 dot 168 dot 1 dot 254 space 0 dot 0 dot 0 dot 0 space U G space 0 space 0 space 0. Line 5: 192 dot 168 dot 1 dot 0 e n p 0 s 3 space asterisk space 255 dot 255 dot 255 dot 0 space U space 1 space 0 space 0. Line 6: dollar.

Back to Code

Line 1: subnet 10 dot 0 dot 2 dot 0 space netmask 255 dot 255 dot 255 dot 0 open brace. Line 2: double indent, option routers space 192 dot 168 dot 1 dot 254 semicolon. Line 3: double indent, option subnet hyphen mask space 255 dot 255 dot 255 dot 0 semicolon. Line 4: double indent, option domain hyphen name space double quote my network dot com double quote semicolon. Line 5: double indent, option domain hyphen name hyphen servers space 192 dot 168 dot 1 dot 254 semicolon. Line 6: double indent, option time hyphen offset space negative 18000 semicolon. Line 7: hash Eastern Standard Time. Line 8: single indent, range 10 dot 0 dot 2 dot 1 space 10 dot 0 dot 2 dot 100 semicolon. Line 9: close brace.

Back to Code

Line 1: dollar ping space 10 dot 0 dot 2 dot 2. Line 2: PING space 10 dot 0 dot 2 dot 2 space open parenthesis 10 dot 0 dot 2 dot 2 close parenthesis space 56 open parenthesis 84 close parenthesis bytes of data.

Back to Code

Line 3: 64 bytes from 10 dot 0 dot 2 dot 2 colon space i c m p underscore seq equals 1 space t t l equals 63 space time equals 14 dot 6 m s. Line 4: 64 bytes from 10 dot 0 dot 2 dot 2 colon space i c m p underscore seq equals 2 space t t l equals 63 space time equals 3 dot 82 m s. Line 5: 64 bytes from 10 dot 0 dot 2 dot 2 colon space i c m p underscore seq equals 3 space t t l equals 63 space time equals 2 dot 05 m s. Line 6: 64 bytes from 10 dot 0 dot 2 dot 2 colon space i c m p underscore seq equals 4 space t t l equals 63 space time equals 0 dot 088 m s. Line 7: 64 bytes from 10 dot 0 dot 2 dot 2 colon space i c m p underscore seq equals 5 space t t l equals 63 space time equals 3 dot 54 m s. Line 8: 64 bytes from 10 dot 0 dot 2 dot 2 colon space i c m p underscore seq equals 6 space t t l equals 63 space time equals 3 dot 97 m s. Line 9: 64 bytes from 10 dot 0 dot 2 dot 2 colon space i c m p underscore seq equals 7 space t t l equals 63 space time equals 0 dot 040 m s. Line 10: cap C. Line 11: triple dash 10 dot 0 dot 2 dot 2 ping statistics triple dash. Line 12: 7 packets transmitted comma 7 received comma 0 percent packet loss comma time 6020 m s. Line 13: r t t space min slash a v g slash max slash m d e v equals 0 dot 040 slash 4 dot 030 slash 14 dot 696 slash 4 dot 620 m s. Line 14: dollar.

Back to Code

Line 1: dollar space ping 6 space dash c space 4 space f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e percent e n p 0 s 3. Line 2: PING space f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e percent e n p 0 s 3 open parenthesis f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e close parenthesis. Line 3: 56 data bytes. Line 4: 64 bytes from f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e colon space i c m p underscore seq equals 1 space t t l equals 128 space time equals 1 dot 47 m s. Line 5: 64 bytes from f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e colon space i c m p underscore seq equals 2 space t t l equals 128 space time equals 0 dot 478 m s. Line 6: 64 bytes from f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e colon space i c m p underscore seq equals 3 space t t l equals 128 space time equals 0 dot 777 m s. Line 7: 64 bytes from f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e colon space i c m p underscore seq equals 4 space t t l equals 128 space time equals 0 dot 659 m s. Line 8: triple dash f e 8 0 double colon c 4 1 8 colon 2 e d 0 colon a e a d colon c b c e percent e n p 0 s 3 space ping space statistics triple dash. Line 9: 4 packets transmitted comma 4 received comma 0 percent packet loss comma time 3003 m s. Line 10: r t t min slash a v g slash max slash m d e v equals 0 dot 478 slash 0 dot 847 slash 1 dot 475 slash 0 dot 378 m s. Line 11: dollar.

Back to Code

The window is titled rich at local host colon tilde. File, edit, view, search, terminal, and help are the menus on the top. My trace route open bracket v 0 dot 92 close bracket is indicated at top center of the content pane. Line 1: local host dot local domain open parenthesis 10 dot 0 dot 2 dot 15 close parenthesis space 2021 hyphen 12 hyphen 06 T 11 colon 54 colon 33 hyphen 0500. Line 2: Keys colon Help, H in bold; Display mode, D in bold; Restart statistics, R in bold; Order of fields, O in bold; quit, q in bold. Host, packets, and pings are the three column heads of the table. Packets column is further subdivided into two columns, loss percent and S n t. Pings column is further subdivided into five columns, last, average, best, worst, and standard deviation. The row entries are as follows: Row 1. Underscore gateway, 0.0 percent, 47, 0.7, 0.9, 0.4, 6.9, and 1.0. Row 2. home portal, 4.3 percent, 47, 5.0, 69.3, 3.8, 2398., and 357.1. Row 3. 75 hyphen 27 hyphen 164 hyphen 1 dot light speed dot i p l s i n dot s b, 4.3 percent, 47, 21.7, 27.5, 20.9, 91.4, and 15.8. Row 4. 71 dot 152 dot 230 dot 45, 4.3 percent, 47, 22.7, 24.0, 20.6, 48.9, and 4.5. Row 5. Three question marks and other columns are blank. Row 6. 32 dot 130 dot 17 dot 213, 4.3 percent, 47, 33.5, 32.7, 27.7, 42.7, and 2.9. Row 7. a e 16 dot c r 7 hyphen c h i l dot i p 4 dot g t t dot net, 8.5 percent, 47, 46.3, 35.5, 26.5, 58.8, and 8.3. Row 8. a e 21 dot c r 9 hyphen c h i l dot i p 4 dot g t t dot net, 6.4 percent, 47, 29.5, 30.9, 26.8, 44.7, and 4.5. Row 9. i p 4 dot g t t dot net, 8.5 percent, 47, 78.9, 49.6, 27.2, 127.9, and 25.9. Row 10. 141 dot 101 dot 73 dot 22, 6.4 percent, 47, 73.3, 80.7, 30.0, 223.8, and 45.2. Row 11. 172 dot 67 dot 201 dot 246, 6.4 percent, 47, 29.4, 37.9, 27.4, 192.0, and 28.5.

Back to Figure

Line 1: dollar host w w w dot linux dot o r g. Line 2: w w w dot linux dot o r g is an alias for linux dot o r g. Line 3: linux dot o r g has address 107 dot 170 dot 40 dot 56. Line 4: linux dot o r g mail is handled by 20 m x dot i q email dot net. Line 5: dollar.

Back to Code

Line 1: dollar host w w w dot yahoo dot com. Line 2: w w w dot yahoo dot com is an alias for a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com. Line 3: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has address 98 dot 138 dot 219 dot 231. Line 4: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has address 72 dot 30 dot 35 dot 9. Line 5: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has address 72 dot 30 dot 35 dot 10. Line 6: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has address 98 dot 138 dot 219 dot 232. Line 7: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has I P v 6 address 2001 colon 4 9 9 8 colon 5 8 colon 1 8 3 6 double colon 10. Line 8: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has I P v 6 address 2001 colon 4 9 9 8 colon 5 8 colon 1 8 3 6 double colon 11. Line 9: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has I P v 6 address 2001 colon 4 9 9 8 colon 4 4 colon 4 1 d double colon 3. Line 10: a t s v 2 hyphen f p hyphen shed dot w g 1 dot b dot yahoo dot com has I P v 6 address 2001 colon 4 9 9 8 colon 4 4 colon 4 1 d double colon 4. Line 11: dollar.

Back to Code

Line 1: dollar host 98 dot 138 dot 219 dot 231. Line 2: 231 dot 219 dot 138 dot 98 dot in hyphen a d d r dot a r p a domain name pointer media hyphen router hyphen f p 1 dot prod 1 dot media dot v i p dot n e 1 dot yahoo dot com. Line 3: dollar.

Back to Code

Line 1: dollar dig w w w dot linux dot o r g. Line 2: semicolon open double angle bracket close double angle bracket DiG space 9 dot 9 dot 4 hyphen Red Hat hyphen 9 dot 9 dot 4 hyphen 18 dot e l 7 underscore 1 dot 5 open double angle bracket close double angle bracket w w w dot linux dot o r g. Line 3: double semicolon global options colon plus c m d. Line 4: double semicolon Got answer colon. Line 5: double semicolon hyphen close double angle bracket HEADER open double angle bracket hyphen o p code colon QUERY comma status colon NO ERROR comma i d colon 4 5 3 1 4. Line 6: double semicolon flags colon q r r d r a semicolon QUERY colon 1 comma ANSWER colon 2 comma AUTHORITY colon 0 comma ADDITIONAL colon 1. Line 7: double semicolon OPT PSEUDOSECTION colon. Line 8: semicolon E D N S colon version colon 0 comma flags colon semicolon u d p colon 4 0 9 6. Line 9: double semicolon QUESTION SECTION colon. Line 10: semicolon w w w dot linux dot o r g dot space I N space A. Line 11: double semicolon ANSWER SECTION colon. Line 12: w w w dot linux dot org dot space 1 4 4 0 0 space I N space C NAME space linux dot o r g. Line 13: linux dot o r g dot space 3 6 0 0 space I N space A space 107 dot 170 dot 40 dot 56. Line 14: double semicolon Query time colon 75 m sec. Line 15: double semicolon SERVER colon 192 dot 168 dot 1 dot 254 hash 53 open parenthesis 192 dot 168 dot 1 dot 254 close parenthesis. Line 16: double semicolon WHEN colon Sat Feb 0 6 17 colon 44 colon 29 E S T 2016. Line 17: double semicolon M S G SIZE r c v d colon 72. Line 18: dollar.

Back to Code

Line 1: dollar dig space linux dot o r g space M X. Line 2: semicolon open double angle bracket close double angle bracket DiG space 9 dot 9 dot 5 hyphen 3 ubuntu 0 dot 5 hyphen Ubuntu open double angle bracket close double angle bracket linux dot o r g space M X. Line 3: double semicolon global options colon plus c m d. Line 4: double semicolon Got answer colon. Line 5: double semicolon hyphen close double angle bracket HEADER open double angle bracket hyphen o p code colon QUERY comma status colon NO ERROR comma i d colon 1 6 2 0 2. Line 6: double semicolon flags colon q r space r d space r a semicolon QUERY colon 1 comma ANSWER colon 1 comma AUTHORITY colon 0 comma ADDITIONAL colon 1.

Back to Code

Line 7: double semicolon O P T space PSEUDOSECTION colon. Line 8: semicolon E D N S colon version colon 0 comma flags colon semicolon u d p colon 4 0 9 6. Line 9: double semicolon QUESTION SECTION colon. Line 10: semicolon linux dot o r g dot space I N space M X. Line 11: double semicolon ANSWER SECTION colon. Line 12: linux dot o r g dot space 3600 space I N space M X space 20 space m x dot i q email dot net. Line 13: double semicolon Query time colon 75 m sec. Line 14: double semicolon SERVER colon 127 dot 0 dot 1 dot 1 hash 53 open parenthesis 127 dot 0 dot 1 dot 1 close parenthesis. Line 15: double semicolon WHEN colon Tue Feb 09 space 12 colon 35 colon 43 E S T 2016. Line 16: double semicolon M S G SIZE r c v d colon 68. Line 17: dollar.

Back to Code

Line 1: dollar n s lookup. Line 2: close angle bracket w w w dot google dot com. Line 3: Server colon 192 dot 168 dot 1 dot 254. Line 4: Address colon 192 dot 168 dot 1 dot 254 hash 53. Line 5: Non hyphen authoritative answer colon. Line 6: Name colon w w w dot google dot com. Line 7: Address colon 172 dot 217 dot 2 dot 228. Line 8: close angle bracket w w w dot wikipedia dot o r g. Line 9: Server colon 192 dot 168 dot 1 dot 254. Line 10: Address colon 192 dot 168 dot 1 dot 254 hash 53. Line 11: Non hyphen authoritative answer colon. Line 12: Name colon w w w dot wikipedia dot o r g. Line 13: Address colon 208 dot 80 dot 153 dot 224. Line 14: close angle bracket exit. Line 15: dollar.

Back to Code

Line 1: dollar who is space linux dot com. Line 2: Domain Name colon LINUX dot COM. Line 3: Registry Domain I D colon 4 2 4 5 5 4 0 underscore DOMAIN underscore COM V R S N. Line 4: Registrar WHO IS Server colon who is dot 1 a p i dot net. Line 5: Registrar U R L colon h t t p colon double slash w w w dot 1 a p i dot net. Line 6: Updated Date colon 2021 hyphen 03 hyphen 18 T 15 colon 40 colon 08 Z. Line 7: Creation Date colon 1994 hyphen 06 hyphen 02 T 04 colon 00 colon 00 Z. Line 8: Registry Expiry Date colon 2022 hyphen 06 hyphen 01 T 04 colon 00 colon 00 Z. Line 9: Registrar colon 1 A P I space G m b H. Line 10: Registrar I A N A space I D colon 1 3 8 7. Line 11: Registrar Abuse Contact Email colon abuse at 1 a p i dot net. Line 12: Registrar Abuse Contact Phone colon plus 49 dot 6 8 9 4 9 3 9 6 8 5 0. Line 13: Domain Status colon client Transfer Prohibited. Line 14: h t t p s colon double slash i c a n n dot o r g slash e p p hash client Transfer Prohibited. Line 15: Name Server colon N S 1 dot D N SIMPLE dot COM. Line 16: Name Server colon N S 2 dot D N SIMPLE dot COM. Line 17: Name Server colon N S 3 dot D N SIMPLE dot COM. Line 18: Name Server colon N S 4 dot D N SIMPLE dot COM. Line 19: ellipsis.

Back to Code

Line 1: hash space net stat. Line 2: Active Internet connections open parenthesis w slash o servers close parenthesis. Line 3: Proto space R e c v hyphen Q space Send hyphen Q space Local Address space Foreign Address space State. Line 4: Active UNIX domain sockets open parenthesis w slash o servers close parenthesis.

Back to Code

Line 5: Proto space Ref C n t space Flags space Type space State space I hyphen Node space Path. Line 6: unix space 2 space open bracket close bracket space D G RAM space blank space 1 0 8 2 5 space blank. Line 7: at slash o r g slash free desktop slash system d 1 slash notify. Line 8: unix space 2 space open bracket close bracket space D G RAM space blank space 1 0 9 3 3 space blank. Line 9: slash run slash system d slash shut down d. Line 10: unix space 6 space open bracket close bracket space D G RAM space blank space 6 6 0 9 space blank. Line 11: slash run slash system d slash journal slash socket. Line 12: unix space 25 space open bracket close bracket space D G RAM space blank space 6 6 1 1 space slash dev slash log. Line 13: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 2 5 6 9 3 space blank. Line 14: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 2 0 7 7 0 space blank. Line 15: slash var slash run slash d bus slash system underscore bus underscore socket. Line 16: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 1 9 5 5 6 space blank. Line 17: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 1 9 5 1 1 space blank. Line 18: unix space 2 space open bracket close bracket space D G RAM space blank space 2 4 1 2 5 space blank. Line 19: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 1 9 5 3 5 space blank. Line 20: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 1 8 0 6 7 space blank. Line 21: slash var slash run slash d bus slash system underscore bus underscore socket. Line 22: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 3 2 3 5 8 space blank. Line 23: unix space 3 space open bracket close bracket space STREAM space CONNECTED space 2 4 8 1 8 space blank. Line 24: slash var slash run slash d bus slash system underscore bus underscore socket. Line 25: ellipsis.

Back to Code

Line 1: dollar space net stat space hyphen t. Line 2: Active Internet connections open parenthesis w slash o servers close parenthesis. Line 3: Proto space R e c v hyphen Q space Send hyphen Q space Local Address space Foreign Address space State. Line 4: t c p space 1 space 0 space 10 dot 0 dot 2 dot 15 colon 5 8 6 3 0 space product search dot ubu colon h t t p s space CLOSE underscore WAIT. Line 5: t c p 6 space 1 space 0 space i p 6 hyphen local host colon 5 7 7 8 2 space i p 6 hyphen local host colon i p p space CLOSE underscore WAIT. Line 6: dollar.

Back to Code

Line 1: dollar space net stat space hyphen l. Line 2: Active Internet connections open parenthesis only servers close parenthesis. Line 3: Proto space R e c v hyphen Q space Send hyphen Q space Local Address space Foreign Address space State. Line 4: t c p space 0 space 0 space Ubuntu 02 colon domain space asterisk colon asterisk space LISTEN. Line 5: t c p space 0 space 0 space local host colon i p p space asterisk colon asterisk space LISTEN. Line 6: t c p 6 space 0 space 0 space i p 6 hyphen local host colon i p p space open bracket double colon close bracket colon asterisk space LISTEN.

Back to Code

Line 7: u d p space 0 space 0 space asterisk colon i p p space asterisk colon asterisk space blank. Line 8: u d p space 0 space 0 space asterisk colon m d n s space asterisk colon asterisk space blank. Line 9: u d p space 0 space 0 space asterisk colon 3 6 3 5 5 space asterisk colon asterisk space blank. Line 10: u d p space 0 space 0 space Ubuntu 02 colon domain space asterisk colon asterisk space blank. Line 11: u d p space 0 space 0 space asterisk colon boot p c space asterisk colon asterisk space blank. Line 12: u d p space 0 space 0 space asterisk colon 1 2 4 6 1 space asterisk colon asterisk space blank. Line 13: u d p 6 space 0 space 0 space open bracket double colon close bracket colon 6 4 2 9 4 space open bracket double colon close bracket colon asterisk space blank. Line 14: u d p 6 space 0 space 0 space open bracket double colon close bracket colon 6 0 2 5 9 space open bracket double colon close bracket colon asterisk space blank. Line 15: u d p 6 space 0 space 0 space open bracket double colon close bracket colon m d n s space open bracket double colon close bracket colon asterisk space blank. Line 16: ellipsis.

Back to Code

Line 1: hash net stat hyphen s. Line 2: I p colon. Line 3: single indent, 240762 total packets received. Line 4: single indent, 0 forwarded. Line 5: single indent, 0 incoming packets discarded. Line 6: single indent, 240747 incoming packets delivered. Line 7: single indent, 206940 requests sent out. Line 8: single indent, 32 dropped because of missing route. Line 9: I c m p colon. Line 10: single indent, 57 I C M P messages received. Line 11: single indent, 0 input I C M P message failed. Line 12: single indent, I C M P input histogram colon. Line 13: double indent, destination unreachable colon 12. Line 14: double indent, timeout in transit colon 38. Line 15: double indent, echo replies colon 7. Line 16: single indent, 7 I C M P messages sent. Line 17: single indent, 0 I C M P messages failed. Line 18: single indent, I C M P output histogram colon. Line 19: double indent, echo request colon 7. Line 20: I c m p M s g colon. Line 21: single indent, In Type 0 colon 7. Line 22: single indent, In Type 3 colon 12. Line 23: single indent, In Type 11 colon 38. Line 24: single indent, Out Type 8 colon 7. Line 25: T c p colon. Line 26: single indent, 286 active connections openings. Line 27: single indent, 0 passive connection openings. Line 28: single indent, 0 failed connection attempts. Line 29: single indent, 0 connection resets received.

Back to Code

Line 30: single indent, 0 connections established. Line 31: single indent, 239933 segments received. Line 32: single indent, 206091 segments send out. Line 33: single indent, 0 segments retransmitted. Line 34: single indent, 0 bad segments received. Line 35: single indent, 0 resets sent. Line 36: U d p colon. Line 37: single indent, 757 packets received. Line 38: single indent, 0 packets to unknown port received. Line 39: single indent, 0 packet receive errors. Line 40: single indent, 840 packets sent. Line 41: single indent, 0 receive buffer errors. Line 42: single indent, 0 send buffer errors. Line 43: U d p Lite colon. Line 44: T c p E x t colon. Line 45: single indent, 219 T C P sockets finished time wait in fast timer. Line 46: single indent, 15 delayed acks sent. Line 47: single indent, 26 delayed acks further delayed because of locked socket. Line 48: single indent, Quick ack mode was activated 1 times. Line 49: single indent, 229343 packet headers predicted. Line 50: single indent, 289 acknowledgments not containing data payload received. Line 51: single indent, 301 predicted acknowledgments. Line 52: single indent, T C P R c v Coal e s c e colon 72755. Line 53: I p E x t colon. Line 54: single indent, In No Routes colon 2. Line 55: single indent, In M cast P k t s colon 13. Line 56: single indent, Out M cast P k t s colon 15. Line 57: single indent, In Octets colon 410722578. Line 58: single indent, Out Octets colon 8363083. Line 59: single indent, In M cast Octets colon 2746. Line 60: single indent, Out M cast Octets colon 2826. Line 61: hash.

Back to Code

Line 1: dollar space s s space hyphen a n p t. Line 2: State space R e c v hyphen Q space Send hyphen Q space Local Address colon Port space Peer Address colon Port. Line 3: LISTEN space 0 space 100 space 127 dot 0 dot 0 dot 1 colon 25 space asterisk colon asterisk. Line 4: LISTEN space 0 space 128 space asterisk colon 111 space asterisk colon asterisk. Line 5: LISTEN space 0 space 5 space 192 dot 168 dot 122 dot 1 colon 53 space asterisk colon asterisk. Line 6: LISTEN space 0 space 128 space asterisk colon 22 space asterisk colon asterisk. Line 7: LISTEN space 0 space 128 space 127 dot 0 dot 0 dot 1 colon 631 space asterisk colon asterisk. Line 8: LISTEN space 0 space 100 space double colon 1 colon 25 space triple colon asterisk. Line 9: LISTEN space 0 space 128 space triple colon 111 space triple colon asterisk. Line 10: LISTEN space 0 space 128 space triple colon 22 space triple colon asterisk. Line 11: LISTEN space 0 space 128 space double colon 1 colon 631 space triple colon asterisk. Line 12: ESTAB space 0 space 0 space double colon 1 colon 22 space double colon 1 colon 4 0 4 9 0. Line 13: ESTAB space 0 space 0 space double colon 1 colon 4 0 4 9 0 space double 1 colon 22. Line 14: users colon open parenthesis open parenthesis double quote s s h double quote comma p i d equals 1 5 1 7 6 comma f d equals 3 close parenthesis close parenthesis. Line 15: dollar.

Back to Code

Line 1: dollar space p s. Line 2: P I D space T T Y space T I M E space C M D. Line 3: 2 7 9 7 space p t s slash 0 space 0 0 colon 0 0 colon 0 0 space bash. Line 4: 2 8 8 4 space p t s slash 0 space 0 0 colon 0 0 colon 0 0 space p s. Line 5: dollar.

Back to Code

Line 1: dollar space p s space hyphen e f. Line 2: U I D space P I D space P P I D space C space S TIME space T T Y space TIME space C M D. Line 3: root space 1 space 0 space 1 space 18 colon 25 space question mark space 00 colon 00 colon 03 space slash s bin slash init may be hyphen ubiquity. Line 4: root space 2 space 0 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket k thread d close bracket. Line 5: root space 3 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket r c u underscore g p close bracket. Line 6: root space 4 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket r c u underscore par underscore g p close bracket. Line 7: root space 5 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket k worker slash 0 colon 0 hyphen c group underscore destroy close bracket. Line 8: root space 6 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket k worker slash 0 colon 0 H hyphen k block d close bracket. Line 9: root space 7 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket k worker slash 0 colon 1 hyphen events close bracket. Line 10: root space 8 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket k worker slash u 2 colon 0 hyphen events underscore unbound close bracket. Line 11: root space 9 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket m m underscore per c p u underscore w q close bracket. Line 12: root space 10 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket k soft i r q d slash 0 close bracket. Line 13: root space 11 space 2 space 0 space 18 colon 25 space question mark space 00 colon 00 colon 00 space open bracket r c u underscore s c h e d close bracket. Line 14: ellipsis. Line 15: dollar.

Back to Code

The window is titled rich at Ubuntu 20. The content pane of the window reads as follows: Line 1: top hyphen 10 colon 28 colon 28 up 4 min comma 1 user comma load average colon 0.23 comma 0.19 comma 0.09. Line 2: Tasks colon 204 total comma 1 running comma 203 sleeping comma 0 stopped comma 0 zombie. Line 3: percentage C p u open parenthesis s close parenthesis colon 2 dot 0 u s comma 0 dot 3 s y comma 0 dot 0 n i comma 97 dot 7 i d comma 0 dot 0 w a comma 0 dot 0 h i comma 0 dot 0 s i comma 0 dot 0 s t. Line 4: M i B Men colon 7955 dot 1 total comma 5486 dot 7 free comma 709 dot 7 used comma 1758 dot 8 buff slash cache. M i B Swap colon 929 dot 4 total comma 929 dot 4 free comma 0 dot 0 used comma 6981 dot 2 avail Mem. The column heads of the table underneath are as follows: P I D, user, P R, N I, V I R T, R E S, S H R, S, percentage C P U, percentage MEM, time plus, and command. The row entries are as follows: Row 1: 1516, rich, 20, 0, 4006836, 360012, 123208, S, 1.7, 4.4, 0 colon 19 dot 67, and gnome hyphen shell. Row 2: 1803, rich, 20, 0, 155364, 2696, 2328, S, 0.3, 0.0, 0 colon 00 dot 66, and V Box Client. Row 3: 2317, rich, 20, 0, 405100, 53704, 40520, S, 0.3, 0.7, 0 colon 01 dot 40, and gnome hyphen terminal hyphen. Row 4: 2694, rich, 20, 0, 11884, 3940, 3264, R, 0.3, 0.0, 0 colon 00 dot 01, and top. Row 4 is in bold. Row 5: 1, root, 20, 0, 102036, 11572, 8392, S, 0.0, 0.1, 0 colon 01 dot 28, and system d. Row 6: 2, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and k thread d. Row 7: 3, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and r c u underscore g p. Row 8: 4, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and r c u underscore par underscore g p. Row 9: 5, root, 20, 0, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and k worker slash 0 colon 0 hyphen events. Row 10: 6, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and k worker slash 0 colon 0 H hyphen events underscore high pri. Row 11: 7, root, 20, 0, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 03, and k worker slash 0 colon 1 hyphen events. Row 12: 8, root, 20, 0, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 15, and k worker slash u 2 colon 0 hyphen events underscore freezable underscore power underscore. Row 13: 9, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and m m underscore per c p u underscore w q. Row 14: 10, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and r c u underscore tasks underscore rude underscore. Row 15: 11, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and r c u underscore tasks underscore trace. Row 16: 12, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 24, and k soft i r q d slash 0. Row 17: 13, root, 20, 0, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 69, and r c u underscore s c h e d. Row 18: 14, root, r t, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and migration slash 0. Row 19: 15, root, negative 51, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and idle underscore inject slash 0. Row 20: 16, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and c p u h p slash 0. Row 21: 17, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and k dev t m p f s. Row 22: 18, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and net n s. Row 23: 19, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and i net underscore frag underscore w q. Row 24: 20, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and k audit d. Row 25: 21, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and k hung task d. Row 26: 22, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and oom underscore reaper. Row 27: 23, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and write back. Row 28: 24, root, 20, 0, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 02, and k compact d 0. Row 29: 25, root, 25, 5, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and k s m d. Row 30: 26, root, 39, 19, 0, 0, 0, S, 0.0, 0.0, 0 colon 00 dot 00, and k huge page d. Row 31: 72, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and k integrity d. Row 32: 73, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and k block d. Row 33: 74, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and b l k c g underscore punt underscore bio. Row 34: 75, root, 0, negative 20, 0, 0, 0, I, 0.0, 0.0, 0 colon 00 dot 00, and t p m underscore dev underscore w q.

Back to Figure

Line 1: dollar space dot slash test 1 dot s h space ampersand. Line 2: open bracket 1 close bracket space 1976. Line 3: dollar space This is Test Program 1. Line 4: Loop space hash 1. Line 5: Loop space hash 2. Line 6: l s. Line 7: test 1 dot s h space test 2 dot s h space test 3 dot s h space test 4 dot s h. Line 8: dollar space Loop space hash 3. Line 9: Loop space hash 4. Line 10: ellipsis. Line 11: open bracket 1 close bracket plus space Done space dot slash test 1 dot s h. Line 12: dollar.

Back to Code

Line 1: dollar space dot slash test 1 dot s h space ampersand. Line 2: open bracket 3 close bracket space 2174. Line 3: dollar space This is Test Program 1. Line 4: dollar space dot slash test 2 dot s h space ampersand. Line 5: open bracket 4 close bracket space 2176. Line 6: dollar space I am Test Program 2. Line 7: dollar space dot slash test 3 dot s h space ampersand. Line 8: open bracket 5 close bracket space 2178. Line 9: dollar space Well this is Test Program 3. Line 10: dollar space dot slash test 4 dot s h space ampersand. Line 11: open bracket 6 close bracket space 2180. Line 12: dollar space This is Test Program 4. Line 13: dollar.

Back to Code

Line 1: dollar space p s space a u. Line 2: USER space P I D space percentage C P U space percentage MEM space V S Z space R S S space T T Y space STAT space START space TIME space COMMAND. Line 3: ellipsis. Line 4: user space 1826 space 0.0 space 0.3 space 6704 space 3408 space p t s slash 0 space S s space 14 colon 07 space 0 colon 00 space bash. Line 5: user space 2174 space 0.0 space 0.1 space 4860 space 1076 space p t s slash 0 space S space 15 colon 23 space 0 colon 00 space slash bin slash bash. Line 6: dot slash test 1 dot s h.

Back to Code

Line 7: user space 2175 space 0.0 space 0.0 space 3884 space 504 space p t s slash 0 space S space 15 colon 23 space 0 colon 00 space sleep 300. Line 8: user space 2176 space 0.0 space 0.1 space 4860 space 1068 space p t s slash space S space 15 colon 23 space 0 colon 00 space slash bin slash bash. Line 9: dot slash test 2 dot s h. Line 10: user space 2177 space 0.0 space 0.0 space 3884 space 508 space p t s slash 0 space S space 15 colon 23 space 0 colon 00 space sleep 300. Line 11: user space 2178 space 0.0 space 0.1 space 4860 space 1068 space p t s slash 0 space S space 15 colon 23 space 0 colon 00 space slash bin slash bash. Line 12: dot slash test 3 dot s h. Line 13: user space 2179 space 0.0 space 0.0 space 3884 space 504 space p t s slash 0 space S space 15 colon 23 space 0 colon 00 space sleep 300. Line 14: user space 2180 space 0.0 space 0.1 space 4860 space 1068 space p t s slash 0 space S space 15 colon 23 space 0 colon 00 space slash bin slash bash. Line 15: dot slash test 4 dot s h. Line 16: user space 2181 space 0.0 space 0.0 space 3884 space 504 space p t s slash 0 space S space 15 colon 23 space 0 colon 00 space sleep 300. Line 17: user space 2182 space 0.0 space 0.1 space 4592 space 1100 space p t s slash 0 space R plus space 15 colon 24 space 0 colon 00 space p s a u. Line 18: dollar.

Back to Code

Line 1: dollar space no hup space dot slash test 1 dot s h space ampersand. Line 2: open bracket 1 close bracket space 1 9 8 3 1. Line 3: dollar space no hup colon ignoring input and appending output to single quote no hup dot out single quote. Line 4: dollar.

Back to Code

Line 1: dollar space cat space no hup dot out. Line 2: This is Test Program 1. Line 3: Loop space hash 1.

Back to Code

Line 4: Loop space hash 2. Line 5: Loop space hash 3. Line 6: Loop space hash 4. Line 7: Loop space hash 5. Line 8: Loop space hash 6. Line 9: Loop space hash 7. Line 10: Loop space hash 8. Line 11: Loop space hash 9. Line 12: Loop space hash 10. Line 13: This is the end of the test program. Line 14: dollar.

Back to Code

Line 1: dollar space cat space test 5 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash space testing job control. Line 4: echo space double quote This is a test program running on P I D dollar dollar double quote. Line 5: count equals 1. Line 6: while space open bracket dollar count hyphen l e 10 close bracket. Line 7: do. Line 8: single indent, echo space double quote Loop space hash dollar count double quote. Line 9: single indent, sleep space 10. Line 10: single indent, count equals dollar open bracket dollar count plus 1 close bracket. Line 11: done. Line 12: echo space double quote This is the end of the test program double quote. Line 13: dollar. Line 14: dollar space dot slash test 5 dot s h. Line 15: This is a test program running on P I D 2 9 0 1 1. Line 16: Loop space hash 1. Line 17: cap Z. Line 18: open bracket 1 close bracket plus space Stopped space dot slash test 5 dot s h. Line 19: dollar. Line 20: dollar space dot slash test 5 dot s h space greater than space test 5 out space ampersand.

Back to Code

Line 21: open bracket 2 close bracket space 2 8 8 6 1. Line 22: dollar. Line 23: dollar space jobs. Line 24: open bracket 1 close bracket plus space Stopped space dot slash test 5 dot s h. Line 25: open bracket 2 close bracket minus space Running space dot slash test 5 dot s h space greater than test 5 out space ampersand. Line 26: dollar.

Back to Code

Line 1: dollar space dot slash test 5 dot s h. Line 2: This is a test program running on P I D 2 9 0 7 5. Line 3: Loop space hash 1. Line 4: cap Z. Line 5: open bracket 1 close bracket plus space Stopped space dot slash test 5 dot s h. Line 6: dollar.

Back to Code

Line 7: dollar space dot slash test 5 dot s h. Line 8: This is a test program running on P I D 2 9 0 9 0. Line 9: Loop space hash 1. Line 10: cap Z. Line 11: open bracket 2 close bracket plus space Stopped space dot slash test 5 dot s h. Line 12: dollar. Line 13: dollar space dot slash test 5 dot s h. Line 14: This is a test program running on P I D 2 9 1 0 5. Line 15: Loop space hash 1. Line 16: cap Z. Line 17: open bracket 3 close bracket plus space Stopped space dot slash test 5 dot s h. Line 18: dollar. Line 19: dollar space jobs space hyphen l. Line 20: open bracket 1 close bracket space 2 9 0 7 5 space Stopped space dot slash test 5 dot s h. Line 21: open bracket 2 close bracket minus space 2 9 0 9 0 space Stopped space dot slash test 5 dot s h. Line 22: open bracket 3 close bracket plus space 2 9 1 0 5 space Stopped space dot slash test 5 dot s h. Line 23: dollar. Line 24: dollar kill space hyphen 9 space 2 9 1 0 5. Line 25: dollar. Line 26: dollar jobs space hyphen l. Line 27: open bracket 1 close bracket hyphen space 2 9 0 7 5 space Stopped space dot slash test 5 dot s h. Line 28: open bracket 2 close bracket plus space 2 9 0 9 0 space Stopped space dot slash test 5 dot s h. Line 29: dollar.

Back to Code

Line 1: dollar space b g space 2. Line 2: open bracket 2 close bracket plus space dot slash test 5 dot s h space ampersand. Line 3: Loop space hash 2. Line 4: dollar Loop space hash 3. Line 5: Loop space hash 4. Line 6: dollar jobs. Line 7: open bracket 1 close bracket plus space Stopped space dot slash test 5 dot s h. Line 8: open bracket 2 close bracket minus space Running space dot slash test 5 dot s h space ampersand.

Back to Code

Line 9: dollar space Loop space hash 6. Line 10: Loop space hash 7. Line 11: Loop space hash 8. Line 12: Loop space hash 9. Line 13: Loop space hash 10. Line 14: This is the end of the test program. Line 15: open bracket 2 close bracket minus space Done space dot slash test 5 dot s h. Line 16: dollar.

Back to Code

Line 1: dollar space jobs. Line 2: open bracket 1 close bracket plus space Stopped space dot slash test 5 dot s h. Line 3: dollar space f g space 1. Line 4: dot slash test 5 dot s h. Line 5: Loop space hash 2. Line 6: Loop space hash 3.

Back to Code

Line 1: dollar cat space test 6 dot s h. Line 2: hash exclamation slash bin slash bash. Line 3: hash.

Back to Code

Line 4: hash testing the at command. Line 5: hash. Line 6: echo space This script ran at single quote date single quote. Line 7: echo space This is the end of the script greater than ampersand 2. Line 8: dollar. Line 9: dollar date. Line 10: Sat Dec 18 14 colon 38 colon 17 E D T 2021. Line 11: dollar. Line 12: dollar at space hyphen f space test 6 dot s h space 14 colon 39. Line 13: warning colon commands will be executed using slash bin slash s h. Line 14: job 57 at Sat Dec 18 14 colon 39 colon 00 2021. Line 15: dollar. Line 16: dollar mail. Line 17: double quote slash var slash mail slash user double quote colon 1 message space 1 new. Line 18: greater than N space 1 user space Sat Dec 18 14 colon 39 space 15 slash 538 space Output from your job. Line 19: ampersand space 1. Line 20: Date colon Sat comma 18 Dec 2021 14 colon 39 colon 00 space hyphen 0400. Line 21: Subject colon Output from your job space 57. Line 22: To colon rich at Ubuntu hyphen server. Line 23: From colon rich open angle bracket rich at Ubuntu hyphen server close angle bracket. Line 24: This script ran at Sat Dec 18 14 colon 39 colon 00 E D T 2021. Line 25: This is the end of the script. Line 26: ampersand space exit. Line 27: dollar.

Back to Code

Line 1: dollar. Line 2: dollar space at space hyphen f space test 6 dot s h space 15 colon 05. Line 3: warning colon commands will be executed using slash bin slash s h. Line 4: job space 58 at Sat Dec 18 15 colon 05 colon 00 2021. Line 5: dollar. Line 6: dollar space at space hyphen f space test 6 dot s h space 15 colon 10. Line 7: warning colon commands will be executed using slash bin slash s h.

Back to Code

Line 8: job space 59 at Sat Dec 18 15 colon 10 colon 00 2021. Line 9: dollar. Line 10: dollar space at space hyphen f space test 6 dot s h space 15 colon 15. Line 11: warning colon commands will be executed using slash bin slash s h. Line 12: job space 60 at Sat Dec 18 15 colon 15 colon 00 2021. Line 13: dollar. Line 14: dollar space at space hyphen f space test 6 dot s h space 15 colon 20. Line 15: warning colon commands will be executed using slash bin slash s h. Line 16: job space 61 at Sat Dec 18 15 colon 20 colon 00 2021. Line 17: dollar dollar space a t q. Line 18: 61 space Sat Dec 18 15 colon 20 colon 00 2021 a user. Line 19: 58 space Sat Dec 18 15 colon 05 colon 00 2021 a user. Line 20: 59 space Sat Dec 18 15 colon 10 colon 00 2021 a user. Line 21: 60 space Sat Dec 18 15 colon 15 colon 00 2021 a user. Line 22: dollar.

Back to Code

Line 1: dollar. Line 2: dollar a t q. Line 3: 59 space Sat Dec 18 15 colon 10 colon 00 2021 a user. Line 4: 60 space Sat Dec 18 15 colon 15 colon 00 2021 a user. Line 5: dollar. Line 6: dollar a t r m space 59. Line 7: dollar. Line 8: dollar a t q. Line 9: 60 space Sat Dec 18 15 colon 15 colon 00 2021 a user. Line 10: dollar.

Back to Code

Line 1: dollar space l s space slash e t c slash cron dot asterisk l y. Line 2: slash e t c slash cron dot daily colon. Line 3: apport space b s d main utils space log rotate space m locate space update hyphen notifier hyphen common. Line 4: apt hyphen compat space d p k g space man hyphen d b space popularity hyphen contest. Line 5: slash e t c slash cron dot hourly colon. Line 6: slash e t c slash cron dot monthly colon. Line 7: slash e t c slash cron dot weekly colon. Line 8: man hyphen d b space update hyphen notifier hyphen common. Line 9: dollar.

Back to Code

Line 1: dollar space sudo space cat space slash e t c slash shadow. Line 2: open bracket sudo close bracket space password for rich colon. Line 3: root colon exclamation colon 1 6 4 8 0 colon 0 colon 9 9 9 9 9 colon 7 triple colon. Line 4: daemon colon asterisk colon 1 6 2 7 3 colon 0 colon 9 9 9 9 9 colon 7 triple colon. Line 5: bin colon asterisk colon 1 6 2 7 3 colon 0 colon 9 9 9 9 9 colon 7 triple colon. Line 6: sys colon asterisk colon 1 6 2 7 3 colon 0 colon 9 9 9 9 9 colon 7 triple colon. Line 7: dollar.

Back to Code

Line 1: dollar space sudo space pass w d space test 1. Line 2: Enter new UNIX password colon. Line 3: Retype new UNIX password colon. Line 4: pass w d colon password updated successfully. Line 5: dollar.

Back to Code

Line 1: dollar space l s space hyphen l. Line 2: total space 12. Line 3: hyphen r w hyphen r w hyphen r double hyphen space 1 space rich space sales space 1521 space Jan 15 space 15 colon 38 space customers dot t x t. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 479 space Jan 15 space 15 colon 37 space research dot t x t. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 696 space Jan 15 space 15 colon 37 space sales data dot t x t. Line 6: dollar.

Back to Code

Line 1: dollar space sudo space chown space barbara space customers dot t x t. Line 2: dollar space l s space hyphen l. Line 3: total space 12. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 1521 space Jan 15 space 15 colon 38 space customers dot t x t. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 479 space Jan 15 space 15 colon 37 space research dot t x t. Line 6: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 696 space Jan 15 space 15 colon 37 space sales data dot t x t. Line 7: dollar.

Back to Code

Line 1: dollar space sudo space c h g r p space marketing space customers dot t x t. Line 2: dollar space l s space hyphen l. Line 3: total space 12. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space marketing space 1521 space Jan 15 space 15 colon 38 space customers dot t x t. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 479 space Jan 15 space 15 colon 37 space research dot t x t. Line 6: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 696 space Jan 15 space 15 colon 37 space sales data dot t x t. Line 7: dollar.

Back to Code

The following are shown in boxes from left to right: hyphen, r, w, x, r, w, hyphen, r, hyphen, and hyphen. r, w, and x together on the left represent owner; r, w, and hyphen at the center represent group, and r, hyphen, and hyphen on the right represent others. Read, write, and execute are indicated for each of the boxes from left to right, as follows: r, read; w, write; x, execute; r, read; w, write; hyphen, execute; r, read; hyphen, write; and hyphen, execute.

Back to Figure

Line 1: dollar space c h m o d space g hyphen w space customers dot t x t. Line 2: dollar space l s space hyphen a l. Line 3: total space 12. Line 4: hyphen r w hyphen r hyphen hyphen r double hyphen space 1 space barbara space marketing space 1521 space Jan 15 space 15 colon 38 space customers dot t x t. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 479 space Jan 15 space 15 colon 37 space research dot t x t. Line 6: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 696 space Jan 15 space 15 colon 37 space sales data dot t x t. Line 7: dollar.

Back to Code

Line 1: dollar space c h m o d space u g equals r w x space sales data dot t x t space research dot t x t. Line 2: dollar space l s space hyphen l. Line 3: total space 12. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space Christine space marketing space 1521 space Jan 15 space 15 colon 38 space customers dot t x t. Line 5: hyphen r w x r w x r double hyphen space 1 space Christine space sales space 479 space Jan 15 space 15 colon 37 space research dot t x t. Line 6: hyphen r w x r w x r double hyphen space 1 space Christine space sales space 696 space Jan 15 space 15 colon 37 space sales data dot t x t. Line 7: dollar.

Back to Code

Line 1: dollar space c h m o d space 6 6 4 space research dot t x t. Line 2: dollar space l s space hyphen l. Line 3: total space 12. Line 4: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space marketing space 1521 space Jan 15 space 15 colon 38 space customers dot t x t. Line 5: hyphen r w hyphen r w hyphen r double hyphen space 1 space barbara space sales space 479 space Jan 15 space 15 colon 37 space research dot t x t. Line 6: hyphen r w x r w x r double hyphen space 1 space barbara space sales space 696 space Jan 15 space 15 colon 37 space sales data dot t x t. Line 7: dollar.

Back to Code

Line 1: dollar space m k d i r space test 1. Line 2: dollar space touch space test 2. Line 3: dollar space l s space hyphen l. Line 4: total space 4. Line 5: d r w x r hyphen x r hyphen x space 2 space rich space rich space 4 0 9 6 space Jan 15 space 17 colon 08 space test 1. Line 6: hyphen r w hyphen r double hyphen r double hyphen space 1 space rich space rich space 0 space Jan 15 space 17 colon 08 space test 2. Line 7: dollar.

Back to Code

Line 1: dollar space u mask space 0 2 7. Line 2: dollar space touch space test 3. Line 3: dollar space l s space hyphen l space test 3. Line 4: hyphen r w hyphen r quintuple hyphen space rich space rich space 0 space Jan 15 space 17 colon 12 space test 3. Line 5: dollar.

Back to Code

Line 1: dollar space touch space test dot t x t. Line 2: dollar space l s space hyphen l. Line 3: total space 0. Line 4: hyphen r w hyphen r quintuple hyphen space 1 space rich space rich space 0 space Jan 15 space 17 colon 33 space test dot t x t. Line 5: dollar space get f a c l space test dot t x t. Line 6: hash space file colon space test. Line 7: hash space owner colon space rich. Line 8: hash space group colon space rich. Line 9: user double colon r w hyphen. Line 10: group double colon r double hyphen. Line 11: other double colon triple hyphen. Line 12: dollar.

Back to Code

Line 1: dollar space set f a c l space hyphen m space g colon sales colon r w space test dot t x t. Line 2: dollar space l s space hyphen l. Line 3: total space 0. Line 4: hyphen r w hyphen r w quadruple hyphen plus space 1 space rich space rich space 0 space Jan 15 space 17 colon 33 space test dot t x t. Line 5: dollar.

Back to Code

Line 1: dollar space get f a c l space test dot t x t. Line 2: hash space file colon space test dot t x t. Line 3: hash space owner colon space rich. Line 4: hash space group colon space rich. Line 5: user double colon r w hyphen. Line 6: group double colon r double hyphen. Line 7: group colon sales colon r w hyphen. Line 8: mask double colon r w hyphen. Line 9: other double colon triple hyphen. Line 10: dollar.

Back to Code

Line 1: dollar space set f a c l space hyphen x space g colon sales space test dot t x t. Line 2: dollar space get f a c l space test dot t x t. Line 3: hash space file colon space test dot t x t. Line 4: hash space owner colon space rich. Line 5: hash space group colon space rich. Line 6: user double colon r w hyphen. Line 7: group double colon r double hyphen. Line 8: mask double colon r double hyphen. Line 9: other double colon triple hyphen. Line 10: dollar.

Back to Code

Line 1: dollar system c t l status system d hyphen time sync d dot service. Line 2: system d hyphen time sync d dot service hyphen Network Time Synchronization. Line 3: Loaded colon loaded open parenthesis slash lib slash system d slash system slash system d hyphen time hyphen sync d dot service semicolon enabled semicolon v e close angle bracket. Line 4: Active colon active open parenthesis running close parenthesis since Sat 2022 hyphen 0 1 hyphen 15 13 colon 45 colon 22 E S T semicolon 3 min 12 s ago. Line 5: Docs colon man colon system d hyphen time sync d dot service open parenthesis 8 close parenthesis. Line 6: Main P I D colon 540 open parenthesis system d hyphen time syn close parenthesis. Line 7: Status colon double quote Initial synchronization to time server 91 dot 189 dot 89 dot 198 colon 123 open parenthesis n t p dot ubu close angle bracket. Line 8: Tasks colon 2 open parenthesis limit colon 9 4 6 9 close parenthesis. Line 9: Memory colon 1.5 M. Line 10: C Group colon slash system dot slice slash system d hyphen time sync d dot service box drawing symbol 540 slash lib slash system d slash system d hyphen time sync d. Line 11: Jan 15 13 colon 45 colon 22 ubuntu 20 system d open bracket 1 close bracket colon Starting Network Time Synchronization ellipsis. Line 12: Jan 15 13 colon 45 colon 22 ubuntu 20 system d open bracket 1 close bracket colon Started Network Time Synchronization dot. Line 13: Jan 15 13 colon 45 colon 54 ubuntu 20 system d hyphen time sync d open bracket 540 close bracket colon Initial synchronization to tim close angle bracket. Line 14: dollar.

Back to Code

The tab on the top represents Home hyphen CUPS 2 dot 3 dot 1. The address bar is indicated as local host colon 6 3 1. CUPS dot o r g, home, administration, classes, help, jobs, and printers are the menus on the top in which Home is selected. CUPS 2 dot 3 dot 1 is the heading of the content pane. The description under the heading is as follows: CUPS is the standards based, open source printing system developed by Apple Incorporation for mac O S and other UNIX like operating systems. CUPS for users, CUPS for administrators, and CUPS for developers are the next level headings from left to right. Overview of CUPS, command line printing and options, and user forum are the titles listed under CUPS for users. Adding printers and classes, managing operation policies, using network printers, firewalls, and cups d dot conf reference are the titles listed under CUPS for administrators. CUPS programming manual, filter and backend programming, and developer forum are the titles listed under CUPS for developers. The following text is indicated at the bottom of the window: CUPS and the CUPS logo are trademarks of Apple Incorporation. Copyright 2007 to 2019 Apple Incorporation. All rights reserved.

Back to Figure

A larger box represents Linux server. A smaller box representing mail transfer agent (M T A), within the Linux server, is connected with another smaller box representing mail delivery agent (M D A), within the server. An arrow from M T A leads to Remote M T As outside the server. Arrows from M T A and M D A both lead to a cylinder in the server representing email database, which in turn leads to another smaller box in the server representing Mail user agent (M U A). M U A is connected with another smaller box representing Workstation, outside the Linux server.

Back to Figure

Home screen of Mozilla Thunderbird is shown in the backdrop with Set Up Your Existing Email Address dialog box in the forefront. Use your current email address is indicated on the top of the dialog box. Your name, email address, and password textboxes are shown in the dialog box. Get a new email address option is shown below the Email address textbox. Remember password checkbox is checked below the password textbox. Cancel, configure manually, and continue are the buttons at the bottom in which Cancel button is active.

Back to Figure

Line 1: dollar space mail. Line 2: double quote slash var slash mail slash rich double quote colon space 1 message 1 new. Line 3: greater than N space 1 space Rich Blum space Sat space Jan 15 space 13 colon 57 space 14 slash 490. Line 4: Test. Line 5: question mark.

Back to Code

Line 1: s s h hyphen key gen space hyphen q space hyphen t space r s a l space hyphen f space slash e t c slash s s h slash s s h underscore host underscore key space hyphen C space double quote space hyphen N space double quote. Line 2: s s h hyphen key gen space hyphen q space hyphen t space r s a space hyphen f space slash e t c slash s s h slash s s h underscore host underscore r s a underscore key space hyphen C space double quote space hyphen N space double quote. Line 3: s s h hyphen key gen space hyphen q space hyphen t space d s a space hyphen f space slash e t c slash s s h slash s s h underscore host underscore d s a underscore key space hyphen C space double space hyphen N.

Back to Code

Line 1: rich at host 1 colon tilde dollar space s s h space rich at host 2. Line 2: The authenticity of host single quote host 2 open parenthesis 192 dot 168 dot 1 dot 76 close parenthesis single quote can’t be established. Line 3: E C D S A key fingerprint is S H A 2 5 6 colon 9 N M h O 3 I M x z B u 8 Q 1 S F O W i B P 1 o a N i C T K I plus E h m O y m j k h d k. Line 4: Are you sure you want to continue connecting open parenthesis yes slash no slash open bracket fingerprint close bracket close parenthesis question mark yes. Line 5: Warning colon Permanently added single quote localhost single quote open parenthesis E C D S A close parenthesis to the list of known hosts. Line 6: rich at localhost’s password colon. Line 7: Welcome to Ubuntu 20 dot 04 dot 3 L T S open parenthesis G N U slash Linux 5 dot 11 dot 0 hyphen 46 hyphen generic x 86 underscore 64 close parenthesis. Line 8: asterisk Documentation colon h t t p s colon double slash help dot ubuntu dot com. Line 9: asterisk Management colon h t t p s colon double slash landscape dot canonical dot com. Line 10: asterisk Support colon h t t p s colon double slash ubuntu dot com slash advantage. Line 11: 12 updates can be applied immediately. Line 12: 7 of these updates are standard security updates. Line 13: To see these additional updates run colon apt space list space double hyphen upgradable. Line 14: Your Hardware Enablement Stack open parenthesis H W E close parenthesis is supported until April 2025. Line 15: Last login colon Thu Jan 13 18 colon 57 colon 20 2022. Line 16: rich at host 2 colon tilde dollar.

Back to Code

Line 1: s s h hyphen key gen space hyphen q space hyphen t space r s a space hyphen f space tilde slash dot s s h slash. Line 2: i d underscore r s a space hyphen C space double quote space hyphen N space double quote.

Back to Code

logger space open bracket hyphen i s d close bracket space open bracket hyphen f space file close bracket space open bracket hyphen p space p r i close bracket space open bracket hyphen t space tag close bracket space open bracket hyphen u space socket close bracket space open bracket message close bracket.

Back to Code

Line 1: dollar space sudo space get ent space shadow space root. Line 2: root colon dollar 6 dollar P 9 2 P dot w j W G e r p M 8 Z z 4 P q Y c S f I n 6 U q S 1 h L Y dot K 7 a N E d p E s s j K 8 E S 6 C 1 double colon 0 colon 9 9 9 9 9 colon 7 triple colon. Line 3: dollar.

Back to Code

Line 1: dollar space sudo space cat space slash e t c slash sudoers. Line 2: hash. Line 3: hash This file MUST be edited with the single quote visudo single quote command as root. Line 4: hash. Line 5: hash Please consider adding local content in slash e t c slash sudoers dot d slash open bracket ellipsis close bracket. Line 6: hash directly modifying this file. Line 7: hash. Line 8: hash See the man page for details on how to write a sudoers file. Line 9: hash. Line 10: Defaults space e n v underscore reset. Line 11: Defaults space mail underscore bad pass. Line 12: Defaults space secure underscore path equals double quote slash u s r slash local slash s bin colon slash u s r slash local slash bin colon slash u s r slash s bin colon slash u s r slash bin colon slash s bin colon slash bin colon slash snap slash bin double quote. Line 13: hash Host alias specification. Line 14: hash User alias specification. Line 15: hash C m n d alias specification. Line 16: hash User privilege specification. Line 17: root space ALL equals open parenthesis ALL colon ALL close parenthesis space ALL. Line 18: hash Members of the admin group may gain root privileges. Line 19: percentage admin space ALL equals open parenthesis ALL close parenthesis space ALL. Line 20: hash Allow members of group sudo to execute any command. Line 21: percentage sudo space ALL equals open parenthesis ALL colon ALL close parenthesis space ALL. Line 22: hash See sudoers open parenthesis 5 close parenthesis for more information on double quote hash include double quote directives colon. Line 23: hash include d i r space slash e t c slash sudoers dot d. Line 24: dollar.

Back to Code

Line 1: dollar space sudo space cat space slash e t c slash sudoers. Line 2: ellipsis. Line 3: hash Allow members of group sudo to execute any command.

Back to Code

Line 4: percentage sudo space ALL equals open parenthesis ALL colon ALL close parenthesis space ALL. Line 5: ellipsis. Line 6: dollar.

Back to Code

Line 1: dollar space sudo space aulast space vertical bar space grep space root. Line 2: root space t t y 1 space unknown 0 8 0 0 2 7 D 8 4 space Sat space Jan 15 space 19 colon 04 hyphen 09 colon 12 space open parenthesis 00 colon 07 close parenthesis. Line 3: root space p t s slash 0 space 192 dot 168 dot 1 dot 71 space Sat space Jan 15 space 19 colon 13 hyphen 11 colon 20 space open parenthesis 02 colon 06 close parenthesis. Line 4: root space t t y 1 space unknown 0 8 0 0 2 7 D 8 4 space Sat space Jan 15 space 19 colon 12 hyphen 11 colon 30 space open parenthesis 02 colon 17 close parenthesis. Line 5: root space t t y 1 space DESKTOP hyphen 1 N P 6 J 2 S space Sat space Jan 15 space 21 colon 04 hyphen 16 colon 04 space open parenthesis 00 colon 00 close parenthesis. Line 6: root space p t s slash 0 space 192 dot 168 dot 1 dot 71 space Sat space Jan 22 space 15 colon 46 hyphen 15 colon 49 space open parenthesis 00 colon 03 close parenthesis. Line 7: root space p t s slash 0 space 192 dot 168 dot 1 dot 71 space Sat space Jan 22 space 15 colon 49 hyphen 15 colon 49 space open parenthesis 00 colon 00 close parenthesis. Line 8: root space t t y 1 space unknown 0 8 0 0 2 7 D 8 4 space Sat space Jan 22 space 15 colon 31 hyphen 16 colon 06 space open parenthesis 00 colon 34 close parenthesis. Line 9: root space p t s slash 0 space 192 dot 168 dot 1 dot 71 space Mon space Jan 24 space 08 colon 52 hyphen 18 colon 52 space open parenthesis 00 colon 00 close parenthesis. Line 10: root space t t y 1 space unknown 0 8 0 0 2 7 D 8 4 space Mon space Jan 24 space 08 colon 51 space still logged in. Line 11: dollar.

Back to Code

Line 1: dollar space s s h space root at local host. Line 2: root at local host's password colon. Line 3: Last login colon Sat Mar 13 10 colon 34 colon 55 2021 from double colon 1. Line 4: This account is currently not available. Line 5: Connection to localhost closed. Line 6: dollar.

Back to Code

Line 1: dollar space s s h space root at local host. Line 2: root at local host's password colon. Line 3: Last login colon Sat Mar 13 10 colon 36 colon 21 2021 from double colon 1. Line 4: The root account is not available. Please use sudo to gain root privileges. Line 5: Connection to localhost closed. Line 6: dollar.

Back to Code

Line 1: dollar space sudo space s e status. Line 2: S E Linux status colon enabled. Line 3: S E Linux f s mount colon slash sys slash f s slash s e linux. Line 4: S E Linux root directory colon slash e t c slash s e linux. Line 5: Loaded policy name colon targeted. Line 6: Current mode colon enforcing. Line 7: Mode from config file colon enforcing. Line 8: Policy M L S status colon enabled. Line 9: Policy deny underscore unknown status colon allowed. Line 10: Memory protection checking space actual open parenthesis secure close parenthesis. Line 11: Max kernel policy version colon 33. Line 12: dollar.

Back to Code

Line 1: dollar space i d space hyphen Z. Line 2: unconfined underscore u colon unconfined underscore r colon unconfined underscore t colon s 0 hyphen s 0 colon c 0 dot c 1 0 2 3. Line 3: dollar.

Back to Code

Line 1: dollar space l s space hyphen Z space test 1 dot t x t. Line 2: unconfined underscore u colon object underscore r colon user underscore home underscore t colon s 0 space test 1 dot t x t. Line 3: dollar.

Back to Code

Line 1: dollar space p s space hyphen a x Z space vertical bar space grep space s s h d. Line 2: system underscore u colon system underscore r colon s s h d underscore t colon s 0 hyphen s 0 colon c 0 dot c 1 0 2 3 space 1 0 2 9 space question mark space S s space 0 colon 0 0. Line 3: slash u s r slash s bin slash s s h d space open bracket ellipsis close bracket. Line 4: dollar.

Back to Code

Line 1: dollar space getsebool space antivirus underscore can underscore scan underscore system. Line 2: antivirus underscore can underscore scan underscore system double hyphen close angle bracket off. Line 3: dollar.

Back to Code

Line 1: dollar space sudo space getsebool space hyphen a. Line 2: a b r t underscore anon underscore write double hyphen close angle bracket off. Line 3: a b r t underscore handle underscore event double hyphen close angle bracket off. Line 4: a b r t underscore upload underscore watch underscore anon underscore write double hyphen close angle bracket on. Line 5: antivirus underscore can underscore scan underscore system double hyphen close angle bracket off. Line 6: antivirus underscore use underscore jit double hyphen close angle bracket off. Line 7: audit a d m underscore exec underscore content double hyphen close angle bracket on. Line 8: auth login underscore n s switch underscore use underscore l d a p double hyphen close angle bracket off. Line 9: auth login underscore radius double hyphen close angle bracket off. Line 10: auth login underscore yubikey double hyphen close angle bracket off. Line 11: a w stats underscore purge underscore apache underscore log underscore files double hyphen close angle bracket off. Line 12: b o i n c underscore exec mem double hyphen close angle bracket on. Line 13: c d record underscore read underscore content double hyphen close angle bracket off. Line 14: cluster underscore can underscore network underscore connect double hyphen close angle bracket off. Line 15: cluster underscore manage underscore all underscore files double hyphen close angle bracket off. Line 16: cluster underscore use underscore exec mem double hyphen close angle bracket off. Line 17: cobbler underscore anon underscore write double hyphen close angle bracket off. Line 18: cobbler underscore can underscore network underscore connect double hyphen close angle bracket off. Line 19: cobbler underscore use underscore c i f s double hyphen close angle bracket off. Line 20: cobbler underscore use underscore n f s double hyphen close angle bracket off. Line 21: collect d underscore t c p underscore network underscore connect double hyphen close angle bracket off. Line 22: condor underscore t c p underscore network underscore connect double hyphen close angle bracket off. Line 23: conman underscore can underscore network double hyphen close angle bracket off. Line 24: conman underscore use underscore n f s double hyphen close angle bracket off. Line 25: ellipsis.

Back to Code

Line 1: dollar space sudo space setsebool space antivirus underscore can underscore scan underscore system space on. Line 2: dollar space getsebool space antivirus underscore can underscore scan underscore system. Line 3: antivirus underscore can underscore scan underscore system double hyphen close angle bracket on. Line 4: dollar.

Back to Code

Line 1: dollar space sudo space a a hyphen status. Line 2: apparmor module is loaded. Line 3: 63 profiles are loaded. Line 4: 42 profiles are in enforce mode. Line 5: single indent, slash snap slash snap d slash 1 4 0 6 6 slash u s r slash lib slash snap d slash snap hyphen confine. Line 6: single indent, slash snap slash snap d slash 1 4 0 6 6 slash u s r slash lib slash snap d slash snap hyphen confine double slash mount hyphen namespace hyphen capture hyphen helper. Line 7: single indent, slash snap slash snap d slash 1 4 2 9 5 slash u s r slash lib slash snap d slash snap hyphen confine. Line 8: single indent, slash snap slash snap d slash 1 4 2 9 5 slash u s r slash lib slash snap d slash snap hyphen confine double slash mount hyphen namespace hyphen capture hyphen helper. Line 9: single indent, slash u s r slash bin slash evince. Line 10: single indent, slash u s r slash bin slash evince hyphen previewer. Line 11: single indent, slash u s r slash bin slash evince hyphen previewer double slash sanitized underscore helper. Line 12: ellipsis. Line 13: 21 profiles are in complain mode. Line 14: single indent, slash u s r slash s bin slash d n s masq. Line 15: single indent, slash u s r slash s bin slash d n s masq double slash lib virt underscore leases helper. Line 16: single indent, avahi hyphen daemon. Line 17: single indent, chromium underscore browser. Line 18: single indent, chromium underscore browser double slash chromium underscore browser underscore sandbox. Line 19: single indent, chromium underscore browser double slash l s b underscore release. Line 20: single indent, chromium underscore browser double slash x d g settings. Line 21: single indent, identd. Line 22: ellipsis. Line 23: 3 processes have profiles defined. Line 24: 3 processes are in enforce mode. Line 25: single indent, slash u s r slash s bin slash cups hyphen browsed open parenthesis 6 8 7 close parenthesis. Line 26: single indent, slash u s r slash s bin slash cups d open parenthesis 6 7 9 close parenthesis. Line 27: single indent, slash snap slash snap hyphen store slash 5 5 8 slash u s r slash bin slash snap hyphen store open parenthesis 1 7 9 5 close parenthesis snap dot snap hyphen store. Line 28: Ubuntu hyphen software. Line 29: 0 processes are in complain mode. Line 30: 0 processes are unconfined but have a profile defined. Line 31: dollar.

Back to Code

Line 1: dollar space sudo space a a hyphen unconfined. Line 2: 465 space slash lib slash system d slash system d hyphen resolved not confined. Line 3: 747 space slash u s r slash s bin slash avahi hyphen daemon not confined. Line 4: 748 space slash u s r slash s bin slash cups d confined by single quote slash u s r slash s bin slash cups d open parenthesis enforce close parenthesis single quote. Line 5: 804 space slash u s r slash s bin slash cups hyphen browsed confined by single quote slash u s r slash s bin slash cups hyphen browsed open parenthesis enforce close parenthesis single quote. Line 6: 885 space slash u s r slash s bin slash x r d p hyphen sesman not confined. Line 7: 912 space slash s bin slash d h client confined by single quote slash s bin slash d h client open parenthesis enforce close parenthesis single quote. Line 8: 935 space slash u s r slash s bin slash x r d p not confined. Line 9: 982 space slash s bin slash d h client confined by single quote slash s bin slash d h client open parenthesis enforce close parenthesis single quote. Line 10: 992 space slash u s r slash s bin slash apache 2 not confined. Line 11: 993 space slash u s r slash s bin slash apache 2 not confined. Line 12: 994 space slash u s r slash s bin slash apache 2 not confined.

Back to Code

Line 13: 1094 space slash u s r slash s bin slash my s q l d confined by single quote slash u s r slash s bin slash my s q l d open parenthesis enforce close parenthesis single quote. Line 14: dollar.

Back to Code

Line 1: dollar space sudo space crypt setup space hyphen y space hyphen v space luks Format space slash dev slash s d b 1. Line 2: WARNING exclamation. Line 3: This will overwrite data on slash dev slash s d b 1 irrevocably. Line 4: Are you sure question mark open parenthesis Type single quote yes single quote in capital letters close parenthesis colon YES. Line 5: Enter passphrase for slash dev slash s d b 1 colon. Line 6: Verify passphrase colon. Line 7: Key slot 0 created.

Back to Code

Line 1: dollar space sudo space crypt setup space hyphen y space hyphen v space luks Format space slash dev slash s d b 1. Line 2: WARNING exclamation. Line 3: This will overwrite data on slash dev slash s d b 1 irrevocably. Line 4: Are you sure question mark open parenthesis Type single quote yes single quote in capital letters close parenthesis colon YES. Line 5: Enter passphrase for slash dev slash s d b 1 colon. Line 6: Verify passphrase colon. Line 7: Key slot 0 created.

Back to Code

Line 8: Command successful. Line 9: dollar.

Back to Code

Line 1: dollar space sudo space crypt setup space hyphen v space luks Open space slash dev slash s d b 1 space safe data. Line 2: Enter passphrase for slash dev slash s d b 1 colon. Line 3: Key slot 0 unlocked. Line 4: Command successful. Line 5: dollar.

Back to Code

Line 1: dollar space l s space slash dev slash mapper space hyphen l. Line 2: total space 0. Line 3: c r w septuple hyphen dot space 1 space root space root space 10,236 space Jan 22 space 08 colon 29 space control. Line 4: l r w x r w x r w x dot space 1 space root space root space 7 space Jan 22 space 08 colon 29 space r l hyphen root hyphen close angle bracket double dot slash d m hyphen 0. Line 5: l r w x r w x r w x dot space 1 space root space root space 7 space Jan 22 space 08 colon 29 space r l hyphen swap hyphen close angle bracket double dot slash d m hyphen 1. Line 6: l r w x r w x r w x dot space 1 space root space root space 7 space Jan 22 space 09 colon 02 space safe data hyphen close angle bracket double dot slash d m hyphen 2. Line 7: dollar.

Back to Code

Line 1: dollar space sudo space m k f s space hyphen t space ext 4 space slash dev slash mapper slash safe data. Line 2: m k e 2 f s space 1 dot 45 dot 6 space open parenthesis 20 hyphen Mar hyphen 2020 close parenthesis. Line 3: Creating filesystem with 257792 4 k blocks and 64512 inodes. Line 4: Filesystem U U I D colon e 2 f 0 3 5 9 7 hyphen 0 1 0 8 hyphen 4 8 b 3 hyphen a 6 6 b hyphen d 5 8 f d d 9 c 4 2 7 f. Line 5: Superblock backups stored on blocks colon. Line 6: 32768 comma 98304 comma 163840 comma 229376. Line 7: Allocating group tables colon done. Line 8: Writing inode tables colon done. Line 9: Creating journal open parenthesis 4096 blocks close parenthesis colon done. Line 10: Writing superblocks and filesystem accounting information colon done. Line 11: dollar space sudo space mount space slash dev slash mapper slash safe data space slash m n t slash my data. Line 12: dollar.

Back to Code

Line 1: dollar space sudo space crypt setup space hyphen v space luks Close space slash dev slash mapper slash safe data. Line 2: Command successful. Line 3: dollar space l s space slash dev slash mapper space hyphen l. Line 4: total space 0. Line 5: c r w septuple hyphen dot space 1 space root space root space 10,236 space Jan 22 space 08 colon 29 space control. Line 6: l r w x r w x r w x dot space 1 space root space root space 7 space Jan 22 space 08 colon 29 space r l hyphen root hyphen close angle bracket double dot slash d m hyphen 0. Line 7: l r w x r w x r w x dot space 1 space root space root space 7 space Jan 22 space 08 colon 29 space r l hyphen swap hyphen close angle bracket double dot slash d m hyphen 1. Line 8: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen get hyphen active hyphen zones. Line 2: public. Line 3: single indent, interfaces colon e n p 0 s 3 comma e n p 0 s 8. Line 4: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen zone equals public space double hyphen list hyphen all. Line 2: public open parenthesis active close parenthesis. Line 3: single indent, target colon default. Line 4: single indent, target colon default. Line 5: single indent, i c m p hyphen block hyphen inversion colon no. Line 6: single indent, interfaces colon e n p 0 s 8. Line 7: single indent, sources colon. Line 8: single indent, services colon cockpit d h c p v 6 hyphen client s s h. Line 9: single indent, ports colon 6 3 1 slash t c p. Line 10: single indent, protocols colon. Line 11: single indent, masquerade colon no. Line 12: single indent, forward hyphen ports colon. Line 13: single indent, source hyphen ports colon. Line 14: single indent, i c m p hyphen blocks colon. Line 15: single indent, rich rules colon. Line 16: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen get hyphen zones. Line 2: block d m z drop external home internal my test n m hyphen shared. Line 3: public trusted work. Line 4: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen list hyphen all. Line 2: my test. Line 3: single indent, target colon default. Line 4: single indent, i c m p hyphen block hyphen inversion colon no. Line 5: single indent, interfaces colon. Line 6: single indent, sources colon. Line 7: single indent, services colon. Line 8: single indent, ports colon. Line 9: single indent, protocols colon. Line 10: single indent, masquerade colon no. Line 11: single indent, forward hyphen ports colon. Line 12: single indent, source hyphen ports colon. Line 13: single indent, i c m p hyphen blocks colon. Line 14: single indent, rich rules colon. Line 15: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen add hyphen service equals h t t p s space double hyphen permanent. Line 2: success. Line 3: dollar space sudo space firewall hyphen c m d space double hyphen reload. Line 4: success. Line 5: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen list hyphen all. Line 6: my test. Line 7: single indent, target colon default. Line 8: single indent, i c m p hyphen block hyphen inversion colon no. Line 9: single indent, interfaces colon. Line 10: single indent, sources colon. Line 11: single indent, services colon h t t p s. Line 12: single indent, ports colon. Line 13: single indent, protocols colon. Line 14: single indent, masquerade colon no. Line 15: single indent, forward hyphen ports colon. Line 16: single indent, source hyphen ports colon. Line 17: single indent, i c m p hyphen blocks colon. Line 18: single indent, rich rules colon. Line 19: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen add hyphen port equals 631 slash t c p space double hyphen permanent. Line 2: success. Line 3: dollar space sudo space firewall hyphen c m d space double hyphen reload. Line 4: success. Line 5: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen list hyphen all. Line 6: my test. Line 7: single indent, target colon default. Line 8: single indent, i c m p hyphen block hyphen inversion colon no. Line 9: single indent, interfaces colon. Line 10: single indent, sources colon. Line 11: single indent, services colon h t t p s. Line 12: single indent, ports colon 631 slash t c p. Line 13: single indent, protocols colon. Line 14: single indent, masquerade colon no. Line 15: single indent, forward hyphen ports colon. Line 16: single indent, source hyphen ports colon. Line 17: single indent, i c m p hyphen blocks colon. Line 18: single indent, rich rules colon. Line 19: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen permanent space double hyphen add hyphen rich hyphen rule equals single quote rule space family equals i p v 4 space source address equals 192 dot 168 dot 1 dot 70 space port space port equals 22 space protocol equals t c p accept single quote. Line 2: success. Line 3: dollar space sudo space firewall hyphen c m d space double hyphen reload. Line 4: success. Line 5: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen list hyphen all. Line 2: my test. Line 3: single indent, target colon default. Line 4: single indent, i c m p hyphen block hyphen inversion colon no. Line 5: single indent, interfaces colon. Line 6: single indent, sources colon. Line 7: single indent, services colon. Line 8: single indent, ports colon 631 slash t c p. Line 9: single indent, protocols colon. Line 10: single indent, masquerade colon no. Line 11: single indent, forward hyphen ports colon. Line 12: single indent, source hyphen ports colon. Line 13: single indent, i c m p hyphen blocks colon. Line 14: single indent, rich rules colon rule space family equals double quote i p v 4 double quote space source address equals double quote 192 dot 168 dot 1 dot 70 double quote space port space port equals double quote 22 double quote space protocol equals double quote t c p double quote accept. Line 15: dollar.

Back to Code

Line 1: dollar space sudo space firewall hyphen c m d space double hyphen zone equals my test space double hyphen list hyphen all. Line 2: my test. Line 3: single indent, target colon default. Line 4: single indent, i c m p hyphen block hyphen inversion colon no. Line 5: single indent, interfaces colon. Line 6: single indent, sources colon. Line 7: single indent, services colon. Line 8: single indent, ports colon 631 slash t c p. Line 9: single indent, protocols colon. Line 10: single indent, masquerade colon no. Line 11: single indent, forward hyphen ports colon. Line 12: single indent, source hyphen ports colon. Line 13: single indent, i c m p hyphen blocks colon. Line 14: single indent, rich rules colon rule space family equals double quote i p v 4 double quote space source address equals double quote 192 dot 168 dot 1 dot 70 double quote space port space port equals double quote 22 double quote space protocol equals double quote t c p double quote accept. Line 15: dollar.

Back to Code

A cloud placed in a larger box and consisting of two smaller boxes represents private cloud. Another cloud consisting of five smaller boxes which are interconnected with one another represents public cloud. A box in private cloud and another box in public cloud are connected representing hybrid cloud.

Back to Figure

A box representing operating system is placed below three boxes with each of the boxes representing V N V application from left to right. The boxes representing V N V application and operating system represent the customer. Below the boxes representing the customer, another box representing server hardware is placed in an oval representing Infrastructure as a service (I a a S) Host. The box and the oval represent the cloud.

Back to Figure

Three boxes on the top with each of them representing V N V application from left to right represent the customer. At the bottom, two boxes representing operating system and server hardware are placed in an oval representing Platform as a service (P a a S) host with the oval and the boxes representing the cloud.

Back to Figure

Three boxes representing application, operating system, and server hardware are placed in an oval representing Software as a service (S a a S) host with the boxes and the oval representing the cloud. The box representing application is connected with five other boxes outside the oval representing customers.

Back to Figure

A cloud representing clients is connected to a box representing web server, which in turn is connected to another box representing application server, which in turn is connected to another box representing database server from left to right.

Back to Figure

A cloud is connected to a box representing web server, which in turn is connected to another box representing application server, which in turn is connected to another box representing database server from left to right. The boxes representing web server, application server, and database server are placed in a larger box representing physical server.

Back to Figure

Four boxes from left to right with each of them representing Guest O S are placed above a box representing Type 1 hypervisor, which in turn is placed above another box representing server hardware.

Back to Figure

Four boxes from left to right with each of them representing Guest O S are placed above a box representing Type 2 hypervisor, which in turn is placed above another box representing Host O S, which in turn is placed above another box representing server hardware.

Back to Figure

Four boxes from left to right with each of them representing container are placed above a box representing host operating system. Each of the four boxes is divided into two halves with the upper half representing app files and the lower half representing support files.

Back to Figure

The flow diagram flows one after the other as follows: Design app container configuration. Document app container configuration. Store container configuration in registry. Deploy or replicate production app container. Monitor production app container or containers. Remove production app container or containers.

Back to Figure

The window is titled slash dev slash s d a hyphen G Parted. G Parted, Edit, View, Device, Partition, and Help are the menus on the top. A spin button at top right is set as slash dev slash s d a (14 point 56 G i B). On the top, slash dev slash s d a 2 11 point 76 G i B is indicated in the box at top center and slash dev slash s d a 3 1 point 86 G i B is indicated in the box at top right. A table is shown in the content pane. Partition, file system, mount point, size, used, unused, and flags are the column heads of the table. The row entries of the table are as follows: Row 1: slash dev slash s d a 1 key symbol, fat 32, slash boot slash e f i, 953 point 00 M i B, 7 point 96 M i B, 945 point 04 M i B, and boot comma e s p. Row 2: slash dev slash s d a 2 key symbol, e x t 4, slash, 11 point 76 G i B, 5 point 07 G i B, 6 point 70 G i B, and blank. Row 3: slash dev slash s d a 3 key symbol, linux hyphen swap, blank, 1 point 86 G i B, 0 point 00 B, 1 point 86 G i B, and blank.

Back to Figure

Two cylinders represent Hard drive 1 and Hard drive 2. In Hard drive 1, four horizontal lines emerging from a vertical line represent bin, e t c, home, and m n t. The line representing home in Hard drive 1 extends up to the vertical line in Hard drive 2. Four horizontal lines emerging from the vertical line in Hard drive 2 represent barbara, katie, jessica, and rich.

Back to Figure

Three boxes representing physical volume 1, physical volume 2, and physical volume 3, from left to right, are placed in a larger box representing volume group 1. A cylinder in each of the three boxes represents slash dev slash s d a, slash dev slash s d b, and slash dev slash s d c. Three smaller boxes in the cylinder slash dev slash s d a represent slash dev slash s d a 1, slash dev slash s d a 2, and slash dev slash s d a 3. Three smaller boxes in the cylinder slash dev slash s d b represent slash dev slash s d b 1, slash dev slash s d b 2, and slash dev slash s d b 3. Three smaller boxes in the cylinder slash dev slash s d c represent slash dev slash s d c 1, slash dev slash s d c 2, and slash dev slash s d c 3. Three boxes representing logical volume 1, logical volume 2, and logical volume 3 cover the boxes in the cylinders and extend beyond the box representing volume group 1. The box representing logical volume 1 covers two boxes, slash dev slash s d a 1 and slash dev slash s d a 2. The box representing logical volume 2 covers three boxes, slash dev slash s d a 3, slash dev slash s d b 1, and slash dev slash s d b 2. The box representing logical volume 3 covers three boxes, slash dev slash s d b 3, slash dev slash s d c 1, and slash dev slash s d c 2.

Back to Figure

Line 1: Rocky Linux 8 point 5 open parenthesis Green Obsidian close parenthesis. Line 2: Kernel 4 dot 18 dot 0 hyphen 348 dot 2 dot 1 dot e 18 underscore 5 dot x 86 underscore 64 on an x 86 underscore 64. Line 3: Activate the web console with colon system c t l enable double hyphen now cockpit dot socket. Line 4: local host space login colon.

Back to Figure

Terminal, File, Edit, View, Search, Terminal, and Help are the menus on the top of the desktop. Icons are shown in the left pane of the desktop from top to bottom. A window in the desktop is titled rich at Ubuntu 02. rich at Ubuntu 02 colon hyphen dollar is entered in the content pane of the window.

Back to Figure

The window is titled rich at Ubuntu 02. The content pane of the window reads as follows: Line 1: rich at Ubuntu 02 colon tilde dollar help. Line 2: G N U bash comma version 4 dot 3 dot 11 open parenthesis 1 close parenthesis hyphen release open parenthesis x 86 underscore 64 hyphen p c hyphen linux hyphen g n u close parenthesis. Line 3: These shell commands are defined internally. Type single quote help single quote to see this list. Line 4: Type single quote help name single quote to find out more about the function single quote name single quote. Line 5: Use single quote info bash single quote to find out more about the shell in general. Line 6: Use single quote man hyphen k single quote or single quote info single quote to find out more about commands not in this list. Line 7: A star open parenthesis asterisk close parenthesis next to a name means that the command is disabled. Commands are then listed in alphabetical order with their syntax format in two columns.

Back to Figure

The window is titled rich at Ubuntu 02. The content pane of the window reads as follows: Line 1: File colon grep dot info comma Node colon Top comma Next colon Introduction comma Up colon open parenthesis d i r. Line 2: grep. Line 3: four asterisks. Line 4: single quote grep single quote prints lines that contain a match for a pattern. Line 5: This manual is for version 2 point 16 of G N U Grep. Line 6: This manual is for single quote grep single quote comma a pattern matching engine. Line 7: Copyright open parenthesis C close parenthesis 1999 hyphen 2002 comma 2005 comma 2008 hyphen 2014 Free Software Foundation comma Inc. Line 8: Permission is granted to copy, distribute and slash or modify this document under the terms of the G N U Free Documentation License comma Version 1 dot 3 or any later version published by the Free Software Foundation semicolon with no Invariant Sections comma with no Front hyphen Cover Texts comma and with no Back hyphen Cover Texts. A copy of the license is included in the section entitled double quote G N U Free Documentation License double quote. Line 9: asterisk Menu colon. Line 10: asterisk Introduction double colon Introduction. Line 11: asterisk Invoking double colon Command hyphen line options comma environment comma exit status. Line 12: asterisk Regular Expressions double colon Regular Expressions. Line 13: asterisk Usage double colon Examples. Line 14: asterisk Reporting Bugs double colon Reporting Bugs. Line 15: asterisk Copying double colon License terms for this manual. Line 16: asterisk Index double colon Combined index. The following content is shown at the bottom ribbon of the window: z z Info colon open parenthesis grep dot info dot g z close parenthesis Top comma 31 lines hyphen All.

Back to Figure

Two cylinders represent Hard disk 1 and Hard disk 2. In Hard disk 1, four horizontal lines emerging from a vertical line represent e t c, bin, home, and m n t. The line representing home in Hard disk 1 extends up to the vertical line in Hard disk 2. Three horizontal lines emerging from the vertical line in Hard disk 2 represent rich, katie, and jessica.

Back to Figure

In the window shown, Home is selected in the dropdown button at top left. In the left pane, Home icon is selected. In the dropdown menu at top right, Show Hidden Files and Show Sidebar checkboxes are checked. Folders and files are listed in the content pane.

Back to Figure