CramX Logo
CompTIA Linux+ XK0-005 Cert Guide (2024) - Document preview page 1

CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 1

Document preview content for CompTIA Linux+ XK0-005 Cert Guide (2024)

CompTIA Linux+ XK0-005 Cert Guide (2024)

CompTIA Linux+ XK0-005 Cert Guide (2024) provides everything you need to pass your certification test.

David Rodriguez
Contributor
5.0
37
over 1 year ago
Preview (31 of 906 Pages)
100%
Log in to unlock
Page 1 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 1 preview image
Page 2 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 2 preview image
Page 3 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 3 preview imageCompTIA®Linux+ XK0-005 Cert GuideCompanion Website and Pearson Test Prep Access CodeAccess interactive study tools on this book’s companion website, includingpractice test software, review exercises, Key Term flash card application, a studyplanner, and more!To access the companion website, simply follow these steps:1.Go towww.pearsonitcertification.com/register.2.Enter theprint book ISBN: 9780137866885.3.Answer the security question to validate your purchase.4.Go to your account page.5.Click on theRegistered Productstab.6.Under the book listing, click on theAccess Bonus Contentlink.When you register your book, your Pearson Test Prep practice test access codewill automatically be populated with the book listing under the RegisteredProducts tab. You will need this code to access the practice test that comes withthis book. You can redeem the code atPearsonTestPrep.com. Simply choosePearson IT Certification as your product group and log in to the site with thesame credentials you used to register your book. Click theActivate NewProductbutton and enter the access code. More detailed instructions on how toredeem your access code for both the online and desktop versions can be foundon the companion website.If you have any issues accessing the companion website or obtaining yourPearson Test Prep practice test access code, you can contact our support teamby going topearsonitp.echelp.org.
Page 4 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 4 preview imageThis page intentionally left blank
Page 5 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 5 preview imageCompTIA®Linux+XK0-005 Cert GuideRoss BrunsonHoboken, New Jersey
Page 6 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 6 preview imageCompTIA®Linux+ XK0-005 Cert GuideCopyright © 2024 by Pearson Education, Inc.All rights reserved. This publication is protected by copyright, andpermission must be obtained from the publisher prior to any prohibitedreproduction, storage in a retrieval system, or transmission in any form orby any means, electronic, mechanical, photocopying, recording, or likewise.For information regarding permissions, request forms, and the appropri-ate contacts within the Pearson Education Global Rights & PermissionsDepartment, please visit www.pearson.com/permissions.No patent liability is assumed with respect to the use of the informationcontained herein. Although every precaution has been taken in thepreparation of this book, the publisher and author assume no responsibilityfor errors or omissions. Nor is any liability assumed for damages resultingfrom the use of the information contained herein.ISBN-13: 978-0-13-786688-5ISBN-10: 0-13-786688-7Library of Congress Control Number: 2023913510$PrintCodeTrademarksAll terms mentioned in this book that are known to be trademarks orservice marks have been appropriately capitalized. Pearson IT Certificationcannot attest to the accuracy of this information. Use of a term in this bookshould not be regarded as affecting the validity of any trademark or servicemark.Warning and DisclaimerEvery effort has been made to make this book as complete and as accurateas possible, but no warranty or fitness is implied. The information providedis on an “as is” basis. The author and the publisher shall have neitherliability nor responsibility to any person or entity with respect to any lossor damages arising from the information contained in this book.Special SalesFor information about buying this title in bulk quantities, or for specialsales opportunities (which may include electronic versions; custom coverdesigns; and content particular to your business, training goals, marketingfocus, or branding interests), please contact our corporate sales departmentat corpsales@pearsoned.com or (800) 382-3419.For government sales inquiries, please contactgovernmentsales@pearsoned.com.For questions about sales outside the U.S., please contactintlcs@pearson.com.Vice President,IT ProfessionalMark TaubDirector, ITP ProductLine ManagementBrett BartowExecutive EditorNancy DavisDevelopment EditorEllie BruManaging EditorSandra SchroederSenior Project EditorMandie FrankCopy EditorBill McManusIndexerKen JohnsonProofreaderJennifer HinchliffeTechnical EditorCasey BoylesPublishing CoordinatorCindy TeetersDesignerChuti PrasertsithCompositorcodeMantra
Page 7 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 7 preview imagePearson’s Commitment to Diversity, Equity, andInclusionPearson is dedicated to creating bias-free content that reflects the diversity of alllearners. We embrace the many dimensions of diversity, including but not limitedto race, ethnicity, gender, socioeconomic status, ability, age, sexual orientation, andreligious or political beliefs.Education is a powerful force for equity and change in our world. It has the poten-tial to deliver opportunities that improve lives and enable economic mobility. As wework with authors to create content for every product and service, we acknowledgeour responsibility to demonstrate inclusivity and incorporate diverse scholarship sothat everyone can achieve their potential through learning. As the world’s leadinglearning company, we have a duty to help drive change and live up to our purpose tohelp more people create a better life for themselves and to create a better world.Our ambition is to purposefully contribute to a world whereEveryone has an equitable and lifelong opportunity to succeed throughlearningOur educational products and services are inclusive and represent the richdiversity of learnersOur educational content accurately reflects the histories and experiences of thelearners we serveOur educational content prompts deeper discussions with learners and motivatesthem to expand their own learning (and worldview)While we work hard to present unbiased content, we want to hear from you aboutany concerns or needs with this Pearson product so that we can investigate andaddress them.Please contact us with concerns about any potential bias athttps://www.pearson.com/report-bias.html.
Page 8 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 8 preview imageThis page intentionally left blank
Page 9 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 9 preview imageContents at a GlanceIntroductionxliiiPart I: System Management (Obj. 1.1 - 1.7)CHAPTER 1Understanding Linux Fundamentals3CHAPTER 2Managing Files and Directories43CHAPTER 3Configuring and Managing Storage101CHAPTER 4Managing Processes and Services139CHAPTER 5Using Network Tools and Configuration Files185CHAPTER 6Building and Installing Software225CHAPTER 7Managing Software Configurations281Part II: Security (Obj. 2.1 - 2.5)CHAPTER 8Understanding Linux Security Best Practices321CHAPTER 9Implementing Identity Management353CHAPTER 10Implementing and Configuring Firewalls379CHAPTER 11Using Remote Connectivity for System Management405CHAPTER 12Understanding and Applying Access Controls427Part III: Scripting, Containers, and Automation (Obj. 3.1 - 3.5)CHAPTER 13Automating Tasks via Shell Scripting463CHAPTER 14Perform Basic Container Operations523CHAPTER 15Performing Basic Version Control Using Git539CHAPTER 16Understanding Infrastructure as Code573CHAPTER 17Understanding Containers, Cloud, and Orchestration597Part IV: Troubleshooting (Obj. 4.1 - 4.5)CHAPTER 18Analyzing and Troubleshooting Storage Issues619CHAPTER 19Analyzing and Troubleshooting Network Resource Issues667CHAPTER 20Analyzing and Troubleshooting CPU and Memory Issues701
Page 10 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 10 preview imageviiiCompTIA®Linux+ XK0-005 Cert GuideCHAPTER 21Analyzing and Troubleshooting User and File Permissions725CHAPTER 22Analyzing and Troubleshooting Common Problems UsingSystemd743CHAPTER 23Final Preparation765APPENDIX AAnswers to the “Do I Know This Already?” Quizzes and ReviewQuestions773Glossary790Index809Online ElementsAPPENDIX BStudy Planner
Page 11 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 11 preview imageTable of ContentsIntroductionxliiiPart I: System Management (Obj. 1.1 - 1.7)Chapter 1Understanding Linux Fundamentals3“Do I Know This Already?” Quiz3Foundation Topics6Filesystem Hierarchy Standard6What Goes Where in the FHS6The Root of the Filesystem6Where to Put Programs7Basic Boot Process8What Is the Boot Process?8System Boot Options9initrd and initramfs9Booting with UEFI10Booting via PXE11Booting via NFS12Booting via ISO13Boot Loaders and Files14GRUB Legacy15GRUB215Changes Made for GRUB215GRUB2 Command Names16Installing GRUB217Using the GRUB2 Command Line18Demystifying Kernel Images19Configuring GRUB220Common Commands at Boot Time21When Kernels Panic22Identifying a Kernel Panic22Getting More Information22Kernel Panic Causes23
Page 12 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 12 preview imagexCompTIA®Linux+ XK0-005 Cert GuideDevice Types in /dev23Installing Software from Source24Components of a Source Code Install26The Makefile26Example of a Compilation of Source Code27Storage Concepts28Partitions28MBR29GPT29Data Storage Methods29Block Storage30File Storage30Object Storage31FUSE (Filesystem in Userspace)31Why Use a FUSE?31Handling FUSE User Requests32Possible FUSE Applications/Uses32RAID32RAID Levels33Mirroring34Striping34Parity35Listing Your Hardware Info35The Proc Filesystem36Notable ls* Commands36Friends of procfs37The dmidecode Command37Displaying DMI Table Information37Summary38Exam Preparation Tasks39Review All Key Topics39Define Key Terms40Review Questions40
Page 13 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 13 preview imagexiContentsChapter 2Managing Files and Directories43“Do I Know This Already?” Quiz43Foundation Topics46File and Directory Operations46Tips for Working with Linux Files46Basic Navigation47Advanced Navigation48Listing Files and Directories49Touching Files50Copying Files and Directories51Moving Objects54Creating and Removing Directories56Removing Objects57File Metadata and File Types57Determining File Types57The file Command57Displaying File Metadata58The stat Command58Soft and Hard Links60Linking Files60Symbolic Links61Hard Links62File Compression, Archiving, and Backup63Using tar64Using Compression Utilities66Using tar with Compression Utilities67Taking Pity on the Unarchiver70Useful Creation Options71Listing Archive Files71Using cpio72Using the dd Command73Compression Tools75Backing Up Is Hard to Do76Backup Types76Other Backup Types77
Page 14 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 14 preview imagexiiCompTIA®Linux+ XK0-005 Cert GuideCopying Objects Between Systems78Using the scp Command78Everything and the Kitchen rsync79The nc Command81File Editing82The Message Line83Editing in vim83Opening a File for Editing84Navigating Within a File85Force Multipliers86Undo Operations86Saving Files87Quitting vim87Changing or Replacing Text88Deleting Text and Lines88Searching in vim89Searching and Replacing89nano, nano90Why nano and Not Pico?90nano’s Interface91That’s a Wrap92Feeling a Bit (awk)ward92The printf Function94Summary95Exam Preparation Tasks96Review All Key Topics96Define Key Terms97Review Questions97Chapter 3Configuring and Managing Storage101“Do I Know This Already?” Quiz101Foundation Topics104Determining Storage Hardware104Viewing SCSI Device Information104Viewing Partition and Filesystem Device File Information105The lsblk Command105
Page 15 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 15 preview imagexiiiThe blkid Command106The (Non-Linux) fcstat Command108Performing Disk Partitioning108fdisk108Partitioning with parted112partprobe113Inspecting and Managing Software RAID114Creating and Inspecting a Software RAID114Inspecting a Software RAID Device114Using Logical Volume Manager (LVM)114Overview of LVM115Understanding Multipath116Managing LVM117Mounting Local and Remote Devices118The Filesystem Table119Manually Mounting Filesystems121Unmounting Filesystems121Using systemd to Mount122Linux Unified Key Setup (LUKS)123Monitoring Storage Space and Disk Usage123Using iostat123Using du124Using df125Filesystem Management126Filesystem Checker126EXT2/3/4 Tools Overview127Tuning ext Filesystems128Btrfs Tools128XFS Commands130Storage Area Networks/Network-Attached Storage131SAN vs. NAS131Multipathing with multipathd132Typical Network Filesystems Used by SAN/NAS133Samba vs. SMB and CIFS133Summary134Exam Preparation Tasks135Contents
Page 16 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 16 preview imagexivCompTIA®Linux+ XK0-005 Cert GuideReview All Key Topics135Define Key Terms136Review Questions136Chapter 4Managing Processes and Services139“Do I Know This Already?” Quiz139Foundation Topics142Managing Processes142Viewing Processes142What’s the Diff?143The htop Command144The free Command145Blocks and Buffers146Pages, Slabs, and Caches146Interpreting Displayed Information from free147Sending Signals to Processes148Killing Processes by PID149Using pgrep and pkill to Send Signals150Killing Processes Using Other Criteria152Finding What Is Using a Resource153Introducing lsof153Using lsof154Job Control155Managing Process Priorities157systemd159What’s Different About systemd?159Units in systemd161Unit File Directory Locations161systemd Environment Variables162systemd Targets and Runlevels163Wants and Requires163Booting with systemd164Commands to Manage systemd165The State of Services/Units165Listing Services166Enabling and Disabling Services166
Page 17 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 17 preview imagexvService Start, Stop, Restart, and Status167Masking Services169Scheduling Services170Configuring crontabs170Using the crontab Command170Matching Times171Spelling Out Month and Day Names172Making Multiple Matches172Step Values172Putting Together the crontab173Issues About PATH173Dealing with Output174Nicknames175Other Files175System crontabs176Convenience crontabs176Restricting Access177Running ad hoc Jobs178The at Command 178The batch Command 179Summary180Exam Preparation Tasks181Review All Key Topics181Define Key Terms182Review Questions182Chapter 5Using Network Tools and Configuration Files185“Do I Know This Already?” Quiz186Foundation Topics188Interface Management188iproute2188Interface Management Commands188The ip Command189Examples of the ip Command190The ss Command191NetworkManager192Contents
Page 18 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 18 preview imagexviCompTIA®Linux+ XK0-005 Cert GuideThe nmtui Command192The nmcli Command192The net-tools Suite194The ifconfig Command195Configuring via ifcfg-* files and network-scripts195On Debian-Based Systems196The hostname Command197The arp Command198The route Command199Name Resolution199Configuring Name Resolution200Controlling Resolution202Setting Hostnames on systemd Systems204The host, dig, and nslookup Commands204The whois Command206Network Monitoring207Is the Remote Host Reachable?207The ping Command207The traceroute Command208The mtr Command210Is the Data Flowing Properly?211Using netstat211Swimming with Wireshark214The tcpdump Command216Remote Networking Tools217SSH (Secure Shell)217Using curl and wget218The nc Command219Using rsync221Using scp221Summary221Exam Preparation Tasks222Review All Key Topics222Define Key Terms223Review Questions223
Page 19 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 19 preview imagexviiChapter 6Building and Installing Software225“Do I Know This Already?” Quiz226Foundation Topics228Package Management228The Most Common Package Types228Package Managers229Debian Package Management229Managing Local Debian Packages230Installing Packages with dpkg231Removing Packages231Dependency Issues232Querying Packages233Reconfiguring Packages234Using Repositories235What Is a Repository?236Viewing Configured Repositories236Adding Repositories238Installing Remote Packages239Working with the Cache241Upgrading the System241Removing Packages242Graphical Managers242RPM and YUM Package Management243The RPM Database243RPM Package Files244Package Name Conventions244The rpm Command245Validation of Packages246Installation of Packages246Additional Installation Options247Verifying a Package’s Integrity248Freshening vs. Upgrading249Removing Packages250Other Removal Options251Contents
Page 20 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 20 preview imagexviiiCompTIA®Linux+ XK0-005 Cert GuideQuerying Packages252Package Management with YUM255Installing Packages255Fetching Updates257Finding Packages to Install258Configuring YUM259Dandified YUM262ZYpp262Installing Software Packages with zypper263Removing a Package with zypper265Managing Repositories265Sandboxed Applications268What Is a Sandboxed App?268App Sandbox Applications269Flatpak269AppImage269Snapd270System Updates270Updating the Kernel270Choosing an Update Method271Reboot Methods271Manual Update271Update with Package Manager272Linux Kernel Utilities272No Reboot Method273Live Kernel Patching Overview274Issues with Live Patching274The Live Patch Process274Summary275Exam Preparation Tasks276Review All Key Topics276Define Key Terms277Review Questions277
Page 21 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 21 preview imagexixChapter 7Managing Software Configurations281“Do I Know This Already?” Quiz281Foundation Topics283Updating Configuration Files283Restart or Reload?283Restarting a Service283Reloading a Service283Grace Under Pressure284Dealing with RPM Configurations284Rage About Your Machine285Two Methods to Retain the Original Configuration File285Handling .rpmsave and .rpmnew Files286Repository Configuration Files287Repository Configuration File Overview288The APT Configuration File288The YUM Configuration File288The DNF Configuration File289Actual Repository Files289The YUM Repo Files289The APT Repo Files289Configuring Kernel Options289Viewing Kernel Parameters290Doing It the Manual Way290Getting Used to Using sysctl291Ways to Set Kernel Parameters291Using the sysctl.conf File291Using the sysctl Command Directly291Using /etc/sysctl.conf292Using the sysctl Command to Load Parameters292Understanding Kernel Modules293Managing Kernel Modules294Loading and Unloading Modules Manually296The modprobe Command298Configuring Common System Services300Secure Shell (SSH)301Contents
Page 22 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 22 preview imagexxCompTIA®Linux+ XK0-005 Cert GuideNetwork Time Protocol (NTP)301NTP Expressed Through Chrony302The timedatectl Command303System Logging with Syslog304Representing Locales304Fallback Locales306Contents of a Locale306The localectl Command307How Linux Uses the Locale307systemd and syslog308syslog309The logger Command312Configuring syslogd312Key File Locations313Other syslog Implementations314Summary315Exam Preparation Tasks316Review All Key Topics316Define Key Terms317Review Questions317Part II: Security (Obj. 2.1 - 2.5)Chapter 8Understanding Linux Security Best Practices321“Do I Know This Already?” Quiz321Foundation Topics323Public Key Infrastructure323Purpose of Certificates323Certificate Authentication323Self-Signed Certificates323Certificate Authorities323Private Keys324Public Keys324Encryption and Hashing324Digital Signatures325Certificate Use Cases325
Page 23 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 23 preview imagexxiAuthentication326Multifactor Authentication326Tokens326OTP327Biometrics327LDAP327Pluggable Authentication Modules (PAMs)327Password Policies328Password Length329LDAP Integration329User Lockouts329The /etc/pam.d Directory330pam_tally2 and faillock330System Security Services Daemon331Single Sign-On (SSO)332Linux Hardening333The nmap Command333The nc Command338Secure Boot and UEFI340System Logging Configurations340Using umask340Disabling/Removing Insecure Services342Enforcing Password Strength343Setting Password Parameters343Aging Your Passwords344No Wire Hangers (Group Passwords)345Removing Unused Packages345Tuning Kernel Parameters347Securing Service Accounts347Configuring the Host Firewall348Summary348Exam Preparation Tasks349Review All Key Topics349Define Key Terms350Review Questions350Contents
Page 24 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 24 preview imagexxiiCompTIA®Linux+ XK0-005 Cert GuideChapter 9Implementing Identity Management353“Do I Know This Already?” Quiz353Foundation Topics355Account Creation and Deletion355User Account Fundamentals355What Accounts Are What?355Regular User Accounts356User Entries in /etc/passwd357Special Login Files357pam_tally2 and faillock358Group Accounts358Group Entries in /etc/group360Group Passwords360Adding Users and Groups361Adding Users with useradd361useradd Defaults362skel Templates362Adding Groups with groupadd364Modifying Users and Groups364Modifying User Accounts with usermod364Modifying Groups with groupmod365Removing Users and Groups366Removing Users366Removing Groups367The Shadow Suite368Encrypted Passwords and Shadow Fields368/etc/shadow File Permissions369Changing Passwords370Aging Passwords370A Login Shell Session371A Non-Login Shell Session372User Identity Query Options372Summary374Exam Preparation Tasks375
Page 25 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 25 preview imagexxiiiReview All Key Topics375Define Key Terms375Review Questions376Chapter 10Implementing and Configuring Firewalls379“Do I Know This Already?” Quiz379Foundation Topics382Common Firewall Technologies382iptables: Old and Reliable, but Complicated383nftables: Newer, Tighter, More Dynamic383firewalld: Newer, Flexible, Easier to Use384UFW: Uncomplicated Indeed384Understanding iptables385Overview of Filtering Packets385Important Terms388Using iptables to Filter Incoming Packets389Filtering by Protocol391Multiple Criteria392Filtering Based on Destination392Changing the Default Policy393Revisiting the Original Rules394Saving the Rules394Using iptables to Filter Outgoing Packets395Stateful Rules396Logging Rules396Implementing NAT397Additional Firewall Technologies398The fail2ban Service398DenyHosts400IPset400Summary400Exam Preparation Tasks401Review All Key Topics401Define Key Terms401Review Questions402Contents
Page 26 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 26 preview imagexxivCompTIA®Linux+ XK0-005 Cert GuideChapter 11Using Remote Connectivity for System Management405“Do I Know This Already?” Quiz405Foundation Topics408SSH (Secure Shell)408SSH Components408Tunneling414X11 Forwarding414Port Forwarding415Executing Commands as Another User416The sudo Command416The sudoedit Command417User Privilege Escalation418The su Command419PolicyKit420The pkexec Command420Summary421Exam Preparation Tasks422Review All Key Topics422Define Key Terms423Review Questions423Chapter 12Understanding and Applying Access Controls427“Do I Know This Already?” Quiz427Foundation Topics429File Permissions429Permission Trio Bits429Manipulating Permissions432Octal Mode432Symbolic Mode433File and Directory Ownership434Changing File Ownership435Changing Group Ownership436Understanding and Using umask437Permission Granularity Issues437Special Bit Permissions438
Page 27 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 27 preview imagexxvSetting the SUID Bit on Files439Setting the SGID Bit on Files440Setting the SGID Bit on Directories441Setting the Sticky Bit442Viewing and Changing File Attributes442Displaying File Attributes442Key File Attributes443Setting File Attributes443Removing File Attributes443Finding Files by Permission444Access Control Lists445Not Enough Granularity445ACLs to the Rescue445Viewing ACLs446Setting an ACL446We All Wear Masks447Context-Based Access448Security-Enhanced Linux (SELinux)449SELinux Mode450SELinux Policy451SELinux Booleans452SELinux Contexts454The audit2allow Command455AppArmor456aa-disable Command456aa-complain Command457aa-unconfined Command457/etc/apparmor.d/ Directory457/etc/apparmor.d/tunables Directory457Command-Line Utilities457Summary457Exam Preparation Tasks458Review All Key Topics458Define Key Terms458Review Questions459Contents
Page 28 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 28 preview imagexxviCompTIA®Linux+ XK0-005 Cert GuidePart III: Scripting, Containers and Automation (Obj. 3.1 - 3.5)Chapter 13Automating Tasks via Shell Scripting463“Do I Know This Already?” Quiz463Foundation Topics466Shell Script Elements466Globbing467Environment Variables and Settings469The PATH Variable471The SHELL Variable472Variable Expansion472Running a Script473Good Script Design474Working with Input/Output Streams475Standard In475Standard Out475Standard Error476Find Errors on Demand476Here Documents477Redirection of Streams478Redirecting Standard Input478Redirecting Standard Output478Redirecting Standard Error479Redirection Redux480Understanding /dev/tty480Pipes481Executing Multiple Commands483Multiple Command Operators483Command Substitution484Splitting Streams with the tee Command485Processing Output with the xargs Command485Shell Script Elements487Using the Output of Another Command487Conditionals488Testing Files490An Easier Test Syntax490
Page 29 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 29 preview imagexxviiTesting Strings491Testing Integers492Combining Multiple Tests493case Statements493switch Statements495Loops496For Loops496Sequences497while and until Loops498Interacting with Other Programs498Returning an Error Code499Accepting Arguments499Feeling a Bit (awk)ward500Translating Files502Cutting Columns502He sed, She sed503Using grep and Friends505Getting a grep505Examples of Using grep506Expanding grep with egrep and fgrep510Using Regular Expressions and grep511Pasting and Joining514Finding Files515Summary517Exam Preparation Tasks518Review All Key Topics518Define Key Terms519Review Questions519Chapter 14Performing Basic Container Operations523“Do I Know This Already?” Quiz523Foundation Topics525Container Management525Installing and Verifying the Container Tools525Installing the Container-Tools Package and Dependencies525Verifying the Podman and Skopeo Tool Installation526Contents
Page 30 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 30 preview imagexxviiiCompTIA®Linux+ XK0-005 Cert GuideFinding and Pulling a Container Image526Finding a Suitable Image526Pulling an Image527Viewing and Inspecting Images528Viewing Local Images528Inspecting a Local Image529Running an Image as a Container529Assigning a Container-Friendly Name529Detaching from and Attaching to Containers530Exiting and Ending Execution of a Container530Removing a Container531Viewing Container Logs531Exposing and Mapping Ports532Container Image Operations533build Command533push Command533pull Command534list Command534rmi Command534Summary534Exam Preparation Tasks535Review All Key Topics535Define Key Terms535Review Questions536Chapter 15Performing Basic Version Control Using Git539“Do I Know This Already?” Quiz539Foundation Topics541Version Control Concepts541The First Generation541The Second Generation542What Is a Merge?542The Third Generation543Using Git for Version Control546Installing Git546
Page 31 of 31
CompTIA Linux+ XK0-005 Cert Guide (2024) - Page 31 preview imagexxixGit Concepts and Features547Git Stages548Choosing Your Git Repository Host549Configuring Git549Using git tag552Getting the Status of Files553The .git Directory555Telling Git to Ignore a File555Handling Branches556Executing Diffs558Comparing Versions560Dealing with Whitespace560Comparing Branches561Merging Files562Summary568Exam Preparation Tasks569Review All Key Topics569Define Key Terms569Review Questions570Chapter 16Understanding Infrastructure as Code573“Do I Know This Already?” Quiz573Foundation Topics576File Formats576YAML576Key Characteristics of YAML576YAML Stream Examples576JSON577Key Characteristics of JSON578JSON Examples578Infrastructure as Code Concepts579Just Making a Config Change579Using Source Control580Getting Started with IaC580Utilities: Infrastructure as Code580Contents
Preview Mode

This document has 906 pages. Sign in to access the full document!