04-Tools Linux

<< ---------------------------------------------------------------- >>

--- Last Modified: $= dv.current().file.mtime

<< ---------------------------------------------------------------- >>

CompTIA Linux+ XK0-006 — Exam Objectives Quick Reference

Exam Number: XK0-006 V8 | Questions: Max 90 | Time: 90 min | Format: Multiple-choice & Performance-based


Domain 1.0 — System Management (23%)

1.1 Basic Linux Concepts

Boot Process

ItemDescriptionExample
BootloaderFirst software that runs after firmware, loads the kernelgrub2-mkconfig -o /boot/grub2/grub.cfg
Configuration filesGRUB config files that control boot menu and kernel optionscat /etc/default/grub
KernelCore of Linux — manages hardware, memory, and processesuname -r
ParametersOptions passed to the kernel at boot timecat /proc/cmdline
initrdTemporary RAM-based filesystem loaded before root FS mountsdracut --force /boot/initramfs-$(uname -r).img $(uname -r)
PXEBoot a machine over the network instead of local diskdhclient -v eth0 (client requests PXE boot info)

Filesystem Hierarchy Standard (FHS)

DirectoryDescriptionExample
/Root of the entire filesystem — top of the directory treels /
/binEssential user binaries needed in single-user models /bin
/bootKernel images, initramfs, and bootloader filesls /boot
/devDevice files representing hardware componentsls /dev/sda*
/etcSystem-wide configuration files (text-based)ls /etc
/homeHome directories for regular usersls /home
/libShared libraries needed by /bin and /sbin binariesls /lib64
/procVirtual filesystem exposing live kernel and process infocat /proc/cpuinfo
/sbinSystem/admin binaries intended for root usels /sbin
/tmpTemporary files — usually cleared on rebootls /tmp
/usrSecondary hierarchy — most installed software lives herels /usr/bin
/varVariable data that changes during operation (logs, mail, cache)ls /var/log

Server Architectures

ItemDescriptionExample
AArch6464-bit ARM architecture — used in servers, phones, Apple Siliconuname -m (outputs aarch64)
RISC-VOpen, royalty-free instruction set architectureuname -m (outputs riscv64)
x86Classic 32-bit Intel architecture — limited to 4 GB RAMfile /bin/bash
x86_64/AMD64Dominant 64-bit extension of x86 — used in most modern serversuname -m (outputs x86_64)

Distributions

ItemDescriptionExample
RPM-basedUses .rpm packages and dnf/yum — RHEL, Fedora, AlmaLinuxdnf install nginx
dpkg-basedUses .deb packages and apt — Debian, Ubuntu, Kaliapt install nginx

GUI

ItemDescriptionExample
Display managersGraphical login screen (GDM, SDDM, LightDM)systemctl status gdm
Window managersControls how windows are drawn and arrangedwhich openbox
X ServerTraditional display system for Linux (Xorg/X11)echo $DISPLAY
WaylandModern replacement for X11 — more secure, fasterecho $WAYLAND_DISPLAY

Software Licensing

ItemDescriptionExample
Opensource softwareSource code is publicly available and modifiablecat /usr/share/licenses/bash/COPYING
Free softwareFSF-defined four freedoms — free as in freedom, not pricegrep -r "GPL" /usr/share/licenses/
Proprietary softwareSource is closed; usage governed by a restrictive EULArpm -qi package (check license field)
CopyleftLicense requiring derivatives to use the same license (GPL)cat /usr/share/licenses/kernel/COPYING

1.2 Linux Device Management

Kernel Modules

CommandDescriptionExample
depmodBuilds the kernel module dependency mapdepmod -a
insmodInserts a module by file path — no dependency resolutioninsmod /lib/modules/$(uname -r)/kernel/drivers/net/e1000.ko
lsmodLists all currently loaded kernel moduleslsmod | grep usb
modinfoShows metadata about a kernel modulemodinfo e1000
modprobeLoads a module and all its dependencies automaticallymodprobe e1000
rmmodRemoves a loaded kernel modulermmod e1000

Device Management

CommandDescriptionExample
dmesgPrints the kernel ring buffer — hardware and driver eventsdmesg -T | tail -20
dmidecodeReads firmware SMBIOS/DMI table for hardware infodmidecode -t memory
ipmitoolInterfaces with IPMI/BMC for out-of-band server managementipmitool -I lanplus -H mgmt-ip -U admin -P pass power status
lm_sensorsReads hardware sensor data — temps, voltages, fan speedssensors
lscpuDisplays detailed CPU architecture informationlscpu
lshwComprehensive hardware inventory toollshw -short
lsmemShows memory blocks and their online/offline statelsmem
lspciLists all PCI/PCIe devices and their driverslspci -k
lsusbLists all connected USB deviceslsusb -t

initrd Management

CommandDescriptionExample
dracutModern tool for building initramfs images on RHEL systemsdracut --force
mkinitrdOlder initramfs builder — often a wrapper for dracut todaymkinitrd /boot/initrd-$(uname -r).img $(uname -r)

Custom Hardware

ItemDescriptionExample
Embedded systemsLinux on purpose-built hardware with custom kernelsfile /boot/zImage
GPU use casesGPUs used for display, compute (ML/AI), and virtualizationlspci | grep -i vga
nvtopInteractive GPU process monitor — like htop for GPUsnvtop

1.3 Storage Management

Logical Volume Manager (LVM) — Logical Volumes

CommandDescriptionExample
lvchangeChanges attributes of a logical volume (activate/deactivate)lvchange -ay /dev/vg0/lv_data
lvcreateCreates a new logical volume in a volume grouplvcreate -L 20G -n mylv myvg
lvdisplayShows detailed information about logical volumeslvdisplay /dev/vg0/mylv
lvremoveRemoves a logical volumelvremove /dev/vg0/mylv
lvresize/lvextendResizes or grows a logical volumelvextend -L +10G /dev/vg0/mylv
lvsShows a concise table of all logical volumeslvs

LVM — Volume Groups

CommandDescriptionExample
vgchangeActivates or deactivates a volume groupvgchange -ay myvg
vgcreateCreates a volume group from one or more physical volumesvgcreate myvg /dev/sdb /dev/sdc
vgdisplayShows detailed volume group informationvgdisplay myvg
vgexportPrepares a VG to be moved to another systemvgexport myvg
vgextendAdds a new PV to an existing volume groupvgextend myvg /dev/sdd
vgimportImports a volume group exported from another systemvgimport myvg
vgremoveRemoves a volume groupvgremove myvg
vgsShows a concise table of all volume groupsvgs
vgscanScans all disks for volume groupsvgscan

LVM — Physical Volumes

CommandDescriptionExample
pvcreateInitializes a disk or partition as a physical volumepvcreate /dev/sdb
pvdisplayShows detailed physical volume informationpvdisplay /dev/sdb
pvmoveMigrates data off a physical volume to others in the VGpvmove /dev/sdb
pvremoveRemoves LVM metadata from a physical volumepvremove /dev/sdb
pvresizeResizes a PV after its underlying partition has grownpvresize /dev/sdb
pvsShows a concise table of all physical volumespvs
pvscanScans all disks for physical volumespvscan

Partitions

CommandDescriptionExample
blkidShows UUID, filesystem type, and label for block devicesblkid /dev/sdb1
fdisk/gdiskInteractive MBR/GPT partition editorsfdisk /dev/sdb
growpartGrows a partition to fill available spacegrowpart /dev/sda 1
lsblkTree view of all block devices, partitions, and mount pointslsblk -o NAME,SIZE,TYPE,MOUNTPOINT
partedScriptable partition tool supporting both MBR and GPTparted /dev/sdb print

Filesystems

FormatDescriptionExample
xfsHigh-performance journaling filesystem — default on RHELmkfs.xfs /dev/sdb1
ext4Mature, battle-tested default Linux filesystemmkfs.ext4 /dev/sdb1
btrfsModern CoW filesystem with built-in snapshots and checksumsmkfs.btrfs /dev/sdb1
tmpfsVirtual filesystem that exists entirely in RAMmount -t tmpfs tmpfs /mnt/ram

Filesystem Utilities

CommandDescriptionExample
dfShows disk space usage by filesystemdf -h
duShows disk usage of a file or directorydu -sh /var/log
fioFlexible I/O benchmarking tool for storage performance testingfio --name=test --rw=randread --bs=4k --size=1G
fsckChecks and repairs a filesystem (run on unmounted FS)fsck -y /dev/sdb1
mkfsCreates a new filesystem on a partition or devicemkfs.ext4 /dev/sdb1
resize2fsGrows or shrinks an ext4 filesystemresize2fs /dev/vg0/mylv
xfs_growfsGrows an XFS filesystem (must be mounted)xfs_growfs /mnt/data
xfs_repairChecks and repairs an XFS filesystemxfs_repair /dev/sdb1

RAID

ItemDescriptionExample
/proc/mdstatLive kernel view of all software RAID arrayscat /proc/mdstat
mdadmTool for creating and managing Linux software RAID arraysmdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc

Mounted Storage — Mounting

ItemDescriptionExample
/etc/fstabDefines filesystems to mount at boot (use UUIDs)cat /etc/fstab
/etc/mtabTracks currently mounted filesystems (often symlink to /proc/mounts)cat /etc/mtab
/proc/mountsAuthoritative live kernel view of all mounted filesystemscat /proc/mounts
autofsMounts filesystems on demand when a path is accessedsystemctl enable --now autofs
mountAttaches a filesystem to the directory treemount /dev/sdb1 /mnt/data
umountDetaches a mounted filesystemumount /mnt/data

Mount Options

OptionDescriptionExample
noatimeDon’t update access time on reads — improves performancemount -o noatime /dev/sdb1 /mnt/data
nodevDon’t interpret device files — security hardeningmount -o nodev /dev/sdb1 /mnt/data
nodiratimeDon’t update directory access timesmount -o nodiratime /dev/sdb1 /mnt/data
noexecPrevent execution of binaries — security hardening for /tmpmount -o noexec /dev/sdb1 /mnt/data
nofailDon’t halt boot if this filesystem fails to mountmount -o nofail /dev/sdb1 /mnt/data
nosuidIgnore setuid bits — prevents privilege escalationmount -o nosuid /dev/sdb1 /mnt/data
remountRe-apply options to an already-mounted filesystemmount -o remount,ro /mnt/data
roMount read-onlymount -o ro /dev/sdb1 /mnt/data
rwMount read-write (default)mount -o rw /dev/sdb1 /mnt/data

Network Mounts

ItemDescriptionExample
NFSNative Linux network filesystem — shares directories over networkmount -t nfs server:/export /mnt/nfs
SMB/SambaWindows-compatible file sharing protocolmount -t cifs //server/share /mnt/smb -o username=user

Inodes

ItemDescriptionExample
InodesData structure storing all metadata about a file except its namestat /etc/passwd
Inode usageCheck inode usage — can exhaust even with free disk spacedf -i

1.4 Network Services & Configuration

Network Configuration Files

FileDescriptionExample
/etc/hostsStatic local hostname-to-IP mapping tablecat /etc/hosts
/etc/resolv.confConfigures DNS servers and search domainscat /etc/resolv.conf
/etc/nsswitch.confControls the order of name resolution sourcesgrep hosts /etc/nsswitch.conf

NetworkManager

CommandDescriptionExample
nmcliFull-featured command-line interface for NetworkManagernmcli connection show
nmconnectSimplified interactive connection tool for NetworkManagernmcli device connect eth0

Netplan

CommandDescriptionExample
netplan applyApply Netplan configuration changes immediatelynetplan apply
netplan statusShow current applied network statenetplan status
netplan tryApply changes with automatic rollback after 120 secondsnetplan try
/etc/netplanDirectory containing YAML network configuration filesls /etc/netplan/

Common Network Tools

CommandDescriptionExample
arpView and manage the ARP cache (IP-to-MAC mappings)arp -n
curlTransfer data using HTTP, HTTPS, FTP and many protocolscurl -I https://example.com
digPreferred full-featured DNS query tooldig google.com @8.8.8.8
ethtoolQuery and configure NIC hardware settings and statisticsethtool eth0
hostnameView or set the system’s hostnamehostname -f
ip addressView and manage IP addresses on interfacesip address show
ip linkView and manage network interface state and propertiesip link show
ip routeView and manage the routing tableip route show
iperf3Network bandwidth benchmark tooliperf3 -c server-ip
mtrCombines ping and traceroute into a live path monitormtr --report google.com
ncNetcat — creates raw TCP/UDP connections for testingnc -zv host 22
nmapNetwork port scanner and host discovery toolnmap -sV 192.168.1.0/24
nslookupBasic interactive DNS query toolnslookup google.com
ping/ping6Send ICMP echo requests to test basic reachabilityping -c 4 8.8.8.8
ssModern replacement for netstat — shows socket statisticsss -tulnp
tcpdumpPacket capture tool for live traffic analysistcpdump -i eth0 port 80
tracepathTraces network path and discovers MTU (no root required)tracepath google.com
tracerouteShows hop-by-hop path packets take to a destinationtraceroute google.com

1.5 Common Shell Operations

Environmental Variables

VariableDescriptionExample
DISPLAYIdentifies the X11 display server for GUI applicationsecho $DISPLAY
HOMECurrent user’s home directory pathecho $HOME
PATHColon-separated list of directories searched for commandsecho $PATH
PS1Primary prompt string — defines what your shell prompt looks likeecho $PS1
SHELLPath to the user’s default shellecho $SHELL
USERCurrent logged-in usernameecho $USER

Paths

ItemDescriptionExample
~Shorthand for the current user’s home directorycd ~
/Filesystem root — the top of the entire directory treels /
.Current directory./script.sh
..Parent directory — one level upcd ..
-Previous working directory — toggles between last two locationscd -

Shell Environment Configurations

FileDescriptionExample
.bashrcRuns for interactive non-login shells (new terminal window)source ~/.bashrc
.bash_profileRuns for login shells only (SSH login, console login)cat ~/.bash_profile
.profileLogin shell config used when .bash_profile doesn’t existcat ~/.profile

Channel Redirection

OperatorDescriptionExample
<Redirect file to stdinsort < names.txt
>Redirect stdout to file (overwrite)ls > files.txt
<<Here document — feed multi-line text as stdincat << EOF
>>Redirect stdout to file (append)echo "line" >> log.txt
|Pipe stdout of one command into stdin of the nextls | grep conf
Standard outputStream 1 — default output destination of a commandecho "hello" > /dev/stdout
Standard errorStream 2 — where error messages are writtencmd 2> errors.txt
Standard inputStream 0 — default input source for a commandread name < /dev/stdin
Here docs <<<Here string — feed a single string as stdinbc <<< "5 * 8"

Basic Shell Utilities

CommandDescriptionExample
!Repeat a command from history by number or string!42
!!Repeat the last commandsudo !!
aliasCreate a shorthand name for a longer commandalias ll='ls -lah'
awkPattern scanning and field-based text processing toolawk -F: '{print $1}' /etc/passwd
bcCommand-line arbitrary precision calculatorecho "5 * 8" | bc
catConcatenate and display file contentscat /etc/hosts
cutExtract fields or character ranges from linescut -d: -f1 /etc/passwd
echoPrint text to stdoutecho "Hello World"
grepSearch for patterns in textgrep -i "error" /var/log/syslog
headShow the first N lines of a filehead -n 20 /var/log/syslog
historyShow the command history listhistory | tail -20
lessPage through output interactively (supports forward/backward)less /var/log/syslog
moreOlder forward-only file pagermore /etc/passwd
printfFormatted output — more precise than echoprintf "%-10s %5d\n" "Alice" 42
sedStream editor for non-interactive text transformationsed 's/old/new/g' file.txt
sortSort lines of text inputsort -n numbers.txt
sourceExecute a script in the current shell (not a subshell)source ~/.bashrc
tailShow the last N lines of a filetail -f /var/log/syslog
teeWrite to both stdout and a file simultaneouslycommand | tee output.txt
trTranslate or delete charactersecho "hello" | tr 'a-z' 'A-Z'
unamePrint system information (kernel, arch, hostname)uname -a
uniqFilter or count duplicate adjacent linessort file.txt | uniq -c
wcCount lines, words, and characterswc -l /etc/passwd
xargsBuild and execute commands from stdinfind . -name "*.log" | xargs rm

Text Editors

EditorDescriptionExample
vi/vimModal terminal text editor — universal on all Unix/Linuxvim /etc/nginx/nginx.conf
nanoBeginner-friendly modeless terminal text editornano /etc/hosts

1.6 Backup & Restore Operations

Archiving

CommandDescriptionExample
cpioCopy-in/copy-out archiver — used internally by RPM and initramfsfind /home -type f | cpio -ov > backup.cpio
tarStandard Linux archiving tool — bundles files into a single archivetar -czvf backup.tar.gz /home/alice

Compression Tools

CommandDescriptionExample
7-ZipCross-platform archiver with excellent compression ratio7z a archive.7z /home/alice
bzip2Better compression than gzip, slower — common in source tarballsbzip2 file.txt
gzipFast, widely supported compression — most common on Linuxgzip file.txt
unzipExtract .zip files — the format native to Windowsunzip archive.zip -d /target/
xzBest compression ratio of standard tools — used for kernel tarballsxz -k file.txt

Other Tools

CommandDescriptionExample
ddRaw block-level copying — disk imaging, cloning, wipingdd if=/dev/sda of=/backup/disk.img bs=4M status=progress
ddrescueData recovery tool that handles read errors and supports resumeddrescue -r 3 /dev/sdb /backup/rescue.img rescue.log
rsyncEfficient incremental file synchronization locally or over networkrsync -avzh /home/ user@server:/backup/home/
zcatPrint contents of a gzip-compressed file without decompressingzcat /var/log/syslog.2.gz
zgrepRun grep against gzip-compressed files directlyzgrep "error" /var/log/syslog.2.gz
zlessPage through a gzip-compressed file interactivelyzless /var/log/syslog.1.gz

1.7 Virtualization

Linux Hypervisors

ItemDescriptionExample
QEMUFull system emulator — handles device emulation for VMsqemu-img info vm.qcow2
KVMKernel module that enables near-native CPU virtualizationlsmod | grep kvm

Virtual Machines

ItemDescriptionExample
Paravirtualized driversDrivers that know they’re virtualized for better performancelspci | grep -i virtio
VirtIOStandard paravirtualization framework for KVM guestslsblk (shows vda for VirtIO disk)
ConvertConvert disk images between formats (qcow2, raw, vmdk)qemu-img convert -f vmdk -O qcow2 vm.vmdk vm.qcow2
ResizeResize a VM disk imageqemu-img resize vm.qcow2 +20G
Image propertiesView VM disk image metadata and informationqemu-img info vm.qcow2
VM statesRunning, Paused, Saved, Shut off, Crashed states of a VMvirsh list --all
Nested virtualizationRunning a hypervisor inside a VMcat /sys/module/kvm_intel/parameters/nested

VM Operations

ItemDescriptionExample
StorageAttaching disks and volumes to virtual machinesvirsh attach-disk myvm /dev/sdb vdb
RAMAllocating memory to virtual machinesvirsh setmem myvm 4G --live
CPUAssigning virtual CPUs to VMsvirsh setvcpus myvm 4 --live
NetworkConfiguring virtual NICs for VMsvirsh attach-interface myvm bridge br0
Baseline image templatesPre-built, generalized images for rapid VM deploymentvirt-clone --original base-vm --name new-vm --auto-clone
CloningCreating a full independent copy of a VMvirt-clone --original base-vm --name new-vm --auto-clone
MigrationsMoving a running or stopped VM to another physical hostvirsh migrate --live myvm qemu+ssh://dest/system
SnapshotsCapturing the complete state of a VM at a point in timevirsh snapshot-create-as myvm snap1 "Before upgrade"

Bare Metal vs. Virtual Machines

ItemDescriptionExample
Bare metalFull hardware access — no virtualization overheaddmidecode -s system-product-name
Virtual machinesShared hardware via hypervisor — flexible but with overheadsystemd-detect-virt

Network Types

TypeDescriptionExample
BridgedVM appears as a full peer on the physical LAN with own IPvirsh net-info default
NATVMs on private network; host translates traffic to outsidefirewall-cmd --zone=libvirt --list-all
Host-only/isolatedVMs can only communicate with host and each othervirsh net-define isolated.xml
RoutedHost routes traffic between VM network and external networksvirsh net-create routed.xml
OpenVirtual switch with no firewall rules applied by libvirtvirsh net-define open.xml

Virtual Machine Tools

ToolDescriptionExample
libvirtManagement API and daemon for KVM/QEMU VMssystemctl status libvirtd
virshPrimary command-line interface to libvirtvirsh list --all
virt-managerGraphical desktop application for managing KVM/libvirt VMsvirt-manager

Domain 2.0 — Services and User Management (20%)

2.1 File & Directory Management

Utilities

CommandDescriptionExample
cdChange the current working directorycd /etc/nginx
cpCopy files and directoriescp -a /source /dest
diffShow line-by-line differences between two filesdiff -u file1.txt file2.txt
fileDetermine file type by inspecting magic bytesfile /bin/bash
findSearch the live filesystem with rich criteriafind / -name "*.log" -mtime +30
lnCreate hard or symbolic links between filesln -s /etc/nginx/nginx.conf nginx.conf
locateFast filename search using a pre-built databaselocate passwd
lsList directory contentsls -lah
lsofList open files — shows which processes have files openlsof -i :80
mkdirCreate directoriesmkdir -p /opt/app/logs
mvMove or rename files and directoriesmv old.txt new.txt
pwdPrint the current working directorypwd
rmRemove files and directoriesrm -rf /tmp/old_dir
rmdirRemove empty directories onlyrmdir emptydir
sdiffSide-by-side diff display of two filessdiff file1.txt file2.txt
statShow detailed file metadata — permissions, timestamps, inodestat /etc/passwd
touchCreate empty files or update timestampstouch newfile.txt
TypeDescriptionExample
Symbolic linkA file containing a path to another file — can cross filesystemsln -s /var/www/html /opt/webroot
Hard linkA second directory entry pointing to the same inodeln source.txt hardlink.txt

Device Types in /dev

TypeDescriptionExample
Block devicesTransfer data in fixed-size blocks — support random access (disks)ls -l /dev/sda
Character devicesTransfer data one byte at a time as a sequential streamls -l /dev/tty
Special character devicesKernel-provided virtual devices (/dev/null, /dev/zero, /dev/random)cat /dev/null

2.2 Local Account Management

Adding Accounts

CommandDescriptionExample
adduserHigh-level interactive user creation wrapper (Debian/Ubuntu)adduser alice
groupaddCreate a new groupgroupadd -g 1500 developers
useraddLow-level user creation with explicit optionsuseradd -m -s /bin/bash alice

Deleting Accounts

CommandDescriptionExample
deluserHigh-level user removal wrapper (Debian/Ubuntu)deluser --remove-home alice
groupdelRemove a groupgroupdel developers
userdelRemove a user accountuserdel -r alice

Modifying Accounts

CommandDescriptionExample
chshChange a user’s login shellchsh -s /bin/zsh alice
groupmodModify group attributes (name, GID)groupmod -n newname developers
passwdManage passwords — set, lock, unlock, expirepasswd alice
usermodModify user attributes — groups, shell, home, expiryusermod -aG wheel alice

Locking Accounts

CommandDescriptionExample
chageManage password aging — also expires accountschage -E 2025-12-31 alice
passwd -lLock an account by prepending ! to the password hashpasswd -l alice
usermod -LLock an account (same mechanism as passwd -l)usermod -L alice

Expiration

ItemDescriptionExample
Configuration files/etc/login.defs defines system-wide password aging defaultsgrep PASS_MAX_DAYS /etc/login.defs
chageSet and view password and account expiration dateschage -l alice

Listing Accounts

CommandDescriptionExample
getent passwdQuery account databases including LDAP/NISgetent passwd alice
groupsList group memberships for a usergroups alice
idShow UID, GID, and all group membershipsid alice
lastShow login history from /var/log/wtmplast -n 20
lastlogShow most recent login time for every accountlastlog -u alice
wWho is logged in and what they are doing (detailed)w
whoList currently logged-in userswho
whoamiPrint the effective current usernamewhoami

User Profile Templates

ItemDescriptionExample
/etc/profileSystem-wide shell initialization script for all login shellscat /etc/profile
/etc/skelSkeleton directory — contents copied to new user home dirsls -la /etc/skel

Account Files

FileDescriptionExample
/etc/groupGroup database — name, GID, and member listcat /etc/group
/etc/passwdUser account database — username, UID, GID, home, shellcat /etc/passwd
/etc/shadowPassword hashes and aging information (root-readable only)sudo cat /etc/shadow

Attributes

ItemDescriptionExample
UIDUnique numeric user identifier used by the kernelid -u alice
GIDUnique numeric group identifierid -g alice
EUIDEffective UID used for permission checks (changes with setuid)python3 -c "import os; print(os.geteuid())"
EGIDEffective GID used for permission checks (changes with setgid)python3 -c "import os; print(os.getegid())"

Account Types

TypeDescriptionExample
User accountsHuman interactive accounts — UID 1000+ — have home dirsuseradd -m alice
System accountsOS-created accounts for kernel subsystems — UID 1–999useradd -r sysaccount
Service accountsCreated by packages to run daemons with minimal privilegeuseradd -r -s /sbin/nologin nginx
UID rangeUID ranges define account type — configured in /etc/login.defsgrep UID_MIN /etc/login.defs

2.3 Process & Job Management

Process Verification

CommandDescriptionExample
/proc/<PID>Virtual directory exposing live kernel data about a processcat /proc/1234/status
atopAdvanced system monitor that records historical performanceatop
htopEnhanced interactive process viewer with mouse supporthtop -u alice
lsofList open files and network connections per processlsof -p 1234
mpstatReports CPU utilization per corempstat -P ALL 1 5
pidstatPer-process CPU, memory, and I/O statisticspidstat -u 1 5
psStatic snapshot of running processesps aux --sort=-%cpu | head -15
pstreeShows processes in a visual parent-child hierarchy treepstree -p
straceTraces every system call a process makesstrace -p 1234
topReal-time continuously updating process monitortop -u alice

Process ID

ItemDescriptionExample
PPIDParent Process ID — the PID of the process that spawned this oneecho $PPID
PIDUnique numeric Process ID assigned by the kernelecho $$

Process States

StateDescriptionExample
RunningActively executing on a CPU or in the run queueps aux | awk '$8=="R"'
BlockedWaiting on a resource — encompasses D and S statesps aux | awk '$8=="D"'
SleepingWaiting for an event — can be woken by a signalps aux | awk '$8=="S"'
StoppedExecution suspended by SIGSTOP or Ctrl+Zps aux | awk '$8=="T"'
ZombieFinished but exit status not collected by parent yetps aux | awk '$8=="Z"'

Priority

CommandDescriptionExample
niceLaunch a process with a specified priority level (-20 to +19)nice -n 10 ./backup.sh
reniceChange the priority of an already-running processrenice 10 -p 1234

Process Limits

ItemDescriptionExample
Process limitsResource limits per process via ulimit and /etc/security/limits.confulimit -a

Job & Process Management

CommandDescriptionExample
&Run a command immediately in the background./backup.sh &
bgResume a stopped job in the backgroundbg %1
Ctrl+CSend SIGINT to the foreground process — requests termination(keyboard shortcut)
Ctrl+DSend EOF on stdin — closes shells and interactive programs(keyboard shortcut)
Ctrl+ZSend SIGTSTP to foreground process — suspends it(keyboard shortcut)
execReplace the current shell process with a new commandexec /bin/bash
fgBring a background or stopped job to the foregroundfg %1
jobsList all jobs in the current shell sessionjobs
killSend a signal to a process by PIDkill -15 1234
killallKill all processes matching an exact namekillall nginx
nohupMake a process immune to SIGHUP so it survives logoutnohup ./script.sh &
pkillKill processes by pattern matchpkill -f "python app.py"
Signal 1 HUPSIGHUP — reload config without restart; hangup signalkill -1 $(pgrep nginx)
Signal 9 KILLSIGKILL — immediate unconditional kill — cannot be caughtkill -9 1234
Signal 15 TERMSIGTERM — polite termination request — default kill signalkill -15 1234

Scheduling

CommandDescriptionExample
anacronCron for systems that aren’t always on — runs missed jobs on bootanacron -n
atSchedule a command to run once at a specific future timeecho "/opt/backup.sh" | at 2:00 AM
crontabSchedule recurring jobs using cron expression syntaxcrontab -e

2.4 Software Management

Installation, Update & Removal

ItemDescriptionExample
RepositoryCurated collection of packages served by a package managerdnf repolist
SourceBuilding software from source code using make/cmake./configure && make && make install
Package dependenciesLibraries and tools a package requires to functiondnf deplist nginx
Package managersTools managing install/update/remove (dnf, apt, rpm, dpkg)dnf install nginx
pipPython package managerpip3 install requests
cargoRust package manager and build toolcargo install ripgrep
npmNode.js package managernpm install -g pm2

Repository Management

ItemDescriptionExample
Enabling/disablingTurn individual repositories on or offdnf config-manager --disable nginx-stable
Third partyRepositories provided by vendors outside the OS distributiondnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
GPG signaturesCryptographic signatures verifying package authenticityrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Other Software Configuration Items

ItemDescriptionExample
Package exclusionsPrevent specific packages from being installed or updateddnf install nginx --exclude="nginx-module-*"
Update alternativesManage multiple versions of the same toolupdate-alternatives --config java
Software configurationPost-install configuration of installed servicesvim /etc/nginx/nginx.conf
Sandboxed applicationsApps bundled with dependencies running in isolation (Flatpak, Snap)flatpak install flathub org.gimp.GIMP

Common Service Configurations

ServiceDescriptionExample
DNSResolves domain names to IP addressesnamed-checkconf
NTP/PTPSynchronizes system time across the networkchronyc sources -v
DHCPDynamically assigns IP addresses to network clientssystemctl enable --now dhcpd
Apache httpdOpen-source web server — widely used on Linuxapachectl configtest
NginxHigh-performance web server and reverse proxynginx -t
SMTPProtocol for sending email between serverspostfix check
IMAP4Protocol allowing email clients to access server mailboxessystemctl enable --now dovecot

2.5 systemd Management

systemd Units

TypeDescriptionExample
ServicesDescribe a daemon or one-shot process managed by systemdsystemctl status nginx.service
TimersSchedule service activation — systemd’s replacement for cronsystemctl list-timers
MountsManage filesystem mounts as systemd unitssystemctl status mnt-data.mount
TargetsSynchronization points and grouping mechanisms (like runlevels)systemctl get-default

Utilities

CommandDescriptionExample
hostnamectlView and set the system hostname and machine identityhostnamectl set-hostname webserver01
resolvectlManage and query systemd-resolved DNS resolverresolvectl status
sysctlRead and write live kernel runtime parameterssysctl -w net.ipv4.ip_forward=1
systemctlPrimary command-line interface to systemdsystemctl list-units --state=failed
systemd-analyzeAnalyze boot performance and unit startup timessystemd-analyze blame
systemd-blameList units sorted by initialization time (part of systemd-analyze)systemd-analyze blame | head -10
systemd-resolvedLocal DNS stub resolver daemon with cachingsystemctl status systemd-resolved
timedatectlManage system time, timezone, and NTP synchronizationtimedatectl set-timezone America/New_York

Managing Unit States

CommandDescriptionExample
daemon-reloadRe-read all unit files from disk after editingsystemctl daemon-reload
disableRemove boot symlink — don’t start at bootsystemctl disable nginx
editCreate/edit drop-in override file for a unitsystemctl edit nginx
enableCreate boot symlink — start at bootsystemctl enable nginx
maskSymlink unit to /dev/null — cannot be started by any meanssystemctl mask bluetooth
reloadReload service config without a full restartsystemctl reload nginx
restartStop then start a servicesystemctl restart nginx
startStart a unit nowsystemctl start nginx
statusShow current state, recent logs, and PIDsystemctl status nginx
stopStop a running unitsystemctl stop nginx
unmaskRemove mask — restore normal behaviorsystemctl unmask bluetooth

2.6 Container Management

Runtimes

RuntimeDescriptionExample
runCOCI reference runtime — actually creates containers via kernel primitiveswhich runc
PodmanDaemonless, rootless-native Docker-compatible runtimepodman run -d nginx
containerdIndustry-standard high-level container runtime used by Kubernetessystemctl status containerd
DockerMost widely known container platform with daemon architecturedocker run -d nginx

Image Operations

ItemDescriptionExample
Pulling imagesDownload container images from a registrydocker pull nginx:1.25
FROMSpecifies the base image for a DockerfileFROM ubuntu:22.04
ENTRYPOINTDefines the fixed executable that always runs in a containerENTRYPOINT ["nginx", "-g", "daemon off;"]
CMDProvides default arguments to ENTRYPOINT or the default commandCMD ["dist/server.js"]
USERSets the user for subsequent RUN, CMD, ENTRYPOINT instructionsUSER appuser
PruningRemove unused images to free disk spacedocker image prune -a
TagsNamed references to specific image versionsdocker tag nginx:1.25 myregistry/nginx:stable
LayersRead-only stacked filesystem layers that make up an imagedocker history nginx:1.25

Container Operations

OperationDescriptionExample
Read logsView stdout/stderr output from a containerdocker logs -f mycontainer
Map volumesMount host directories or volumes into containersdocker run -v /data:/app/data nginx
Start/stopStart or stop a running containerdocker stop mycontainer
InspectView detailed JSON metadata about a containerdocker inspect mycontainer
DeleteRemove a stopped containerdocker rm mycontainer
runCreate and start a container from an imagedocker run -d --name web -p 80:80 nginx
execRun a command inside a running containerdocker exec -it web bash
PruningRemove stopped containers to free resourcesdocker container prune
TagsTag a container image for a registrydocker tag myapp:latest myregistry/myapp:v2
Env varsInject environment variables into containersdocker run -e DB_HOST=postgres myapp

Volume Operations

ItemDescriptionExample
Create volumeCreate a named Docker-managed volumedocker volume create mydata
Mapping volumeAttach a volume to a container at a mount pointdocker run -v mydata:/var/lib/postgres postgres
PruningRemove unused volumes to free disk spacedocker volume prune
SELinux contextApply SELinux labels to bind mounts with :z or :Zdocker run -v /host/path:/data:Z nginx
OverlayCopy-on-write filesystem used for container storage layersdocker info | grep "Storage Driver"

Container Networks

ItemDescriptionExample
Create networkCreate a custom Docker networkdocker network create mynet
Port mappingMap a host port to a container portdocker run -p 8080:80 nginx
PruningRemove unused networksdocker network prune
macvlanAssigns real MAC address to container — appears on physical LANdocker network create -d macvlan --subnet=192.168.1.0/24 -o parent=eth0 macnet
ipvlanShares parent interface MAC — containers get own IPsdocker network create -d ipvlan -o parent=eth0 ipvnet
HostContainer shares host’s network namespace — no isolationdocker run --network host nginx
BridgeDefault — containers connect to virtual bridge on private subnetdocker network create mybridge
OverlayEnables container communication across multiple Docker hostsdocker network create -d overlay myoverlay
NoneContainer has no network interfaces except loopbackdocker run --network none alpine

Privileged vs. Unprivileged

ItemDescriptionExample
PrivilegedContainer gets all Linux capabilities and device accessdocker run --privileged mycontainer
UnprivilegedDefault — limited capabilities, seccomp filter, no host device accessdocker run nginx (default is unprivileged)

Domain 3.0 — Security (18%)

3.1 Authentication, Authorization & Accounting

ItemDescriptionExample
PolkitFine-grained policy-based authorization framework for system actionspkcheck --action-id org.freedesktop.systemd1.manage-units --process $$
PAMPluggable Authentication Modules — modular authentication frameworkcat /etc/pam.d/sshd
SSSD/WinbindConnect Linux to Active Directory or LDAP for centralized authrealm join example.com
LDAPHierarchical protocol for accessing directory information (users, groups)ldapsearch -x -H ldap://ldap.example.com -b "dc=example,dc=com" "(uid=alice)"
KerberosNetwork authentication protocol using tickets — no passwords over wirekinit alice
SambaLinux implementation of SMB — file sharing and AD integrationtestparm
journalctlQuery and display systemd journal logsjournalctl -u sshd -n 50
rsyslogSystem logging daemon that routes messages to files/remote serverssystemctl status rsyslog
logrotateRotates, compresses, and removes old log files automaticallylogrotate -f /etc/logrotate.conf
/var/logStandard directory containing all system log filesls /var/log
audit.rulesRules file defining what security events auditd capturescat /etc/audit/rules.d/99-custom.rules
auditdKernel-level audit daemon producing tamper-evident event logssystemctl status auditd

3.2 Firewalls

firewalld

ItemDescriptionExample
firewall-cmdCommand-line interface for managing firewalldfirewall-cmd --list-all
Runtime vs. permanentRuntime changes are immediate; permanent survive rebootfirewall-cmd --permanent --add-service=http && firewall-cmd --reload
Rich rulesGranular firewall rules combining source, port, protocol, and loggingfirewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" service name="ssh" accept'
ZonesNamed trust levels assigned to interfaces or source IPsfirewall-cmd --get-active-zones
Ports vs. servicesServices are named port groups; ports are explicit numbersfirewall-cmd --permanent --add-port=8080/tcp

Other Firewall Tools

ItemDescriptionExample
ufwSimplified iptables frontend — default on Ubuntuufw allow ssh
nftablesModern replacement for iptables with unified syntaxnft list ruleset
iptablesClassic userspace tool for configuring Netfilter rulesiptables -L -n -v
ipsetCreates efficient sets of IPs/ports for iptables to referenceipset create blocklist hash:ip
NetfilterKernel framework all Linux firewall tools use underneathlsmod | grep nf_
NATRewrites IP addresses in packet headersiptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PATPort Address Translation — many IPs share one public IPfirewall-cmd --permanent --zone=external --add-masquerade
DNATRewrites destination IP — used for port forwardingfirewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=80:toaddr=192.168.1.10
SNATRewrites source IP — used for outbound NATiptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 203.0.113.1
StatefulTracks connection state — return traffic handled automaticallyiptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
StatelessRules evaluated per-packet with no connection state memoryiptables -A INPUT -p tcp --dport 22 -j ACCEPT
net.ipv4.ip_forwardKernel parameter enabling IP routing/forwarding between interfacessysctl -w net.ipv4.ip_forward=1

3.3 OS Hardening

Privilege Escalation

ItemDescriptionExample
/etc/sudoersMain sudo configuration file — defines who can run whatvisudo
NOEXECPrevents sudo commands from spawning subshells or child processescarol ALL=(ALL) NOEXEC: /usr/bin/vim
NOPASSWDAllows sudo without a password — use with cautiondeploy ALL=(ALL) NOPASSWD: /bin/systemctl reload nginx
/etc/sudoers.d/Drop-in directory for modular sudo configuration filesvisudo -f /etc/sudoers.d/webadmins
visudoSafe editor for sudoers that validates syntax before savingvisudo
sudo -iStart a root login shell loading root’s full environmentsudo -i
wheel groupGroup whose members get full sudo access (RHEL/Fedora default)usermod -aG wheel alice
sudo groupGroup whose members get full sudo access (Debian/Ubuntu default)usermod -aG sudo alice
su -Switch to root with a full login environmentsu -

File Attributes

CommandDescriptionExample
chattrSet extended filesystem attributes on files and directorieschattr +i /etc/passwd
lsattrList extended filesystem attributeslsattr /etc/passwd
immutableFile cannot be modified, deleted, or renamed — even by rootchattr +i /etc/sudoers
append onlyFile can only be appended to — cannot overwrite or deletechattr +a /var/log/audit.log

Permissions

ItemDescriptionExample
chgrpChange the group ownership of a filechgrp developers /opt/project
chmod (Octal)Set permissions using numeric notation (e.g., 755, 644)chmod 755 /opt/script.sh
chmod (Symbolic)Set permissions using symbolic notation (u+x, g-w)chmod u+x,g-w script.sh
chownChange file owner and/or group ownershipchown alice:developers /opt/project
Sticky bitOn directories — users can only delete their own fileschmod +t /tmp
setuidBinary runs with the file owner’s privileges (e.g., passwd)chmod u+s /usr/bin/program
setgidOn directories — new files inherit the directory’s groupchmod g+s /opt/shared/
umaskDefines which permissions are removed from new files by defaultumask 027

Access Control

CommandDescriptionExample
setfaclSet fine-grained ACL permissions on filessetfacl -m u:alice:rwx /opt/project
getfaclView ACL permissions on a file or directorygetfacl /opt/project
restoreconRestore correct SELinux context based on policy databaserestorecon -Rv /var/www/html/
semanageMake persistent changes to SELinux policy (contexts, ports)semanage fcontext -a -t httpd_sys_content_t "/opt/web(/.*)?"
chconChange SELinux context temporarily (not persistent)chcon -t httpd_sys_content_t /opt/web/index.html
ls -ZList files with their SELinux security context labelsls -Z /var/www/html/
getenforceShow current SELinux mode (Enforcing/Permissive/Disabled)getenforce
setenforceTemporarily switch SELinux mode without rebootsetenforce 0
getseboolShow current value of SELinux booleansgetsebool httpd_can_network_connect
setseboolSet SELinux boolean values (use -P for persistent)setsebool -P httpd_can_network_connect on
audit2allowGenerate SELinux policy from audit denial messagesausearch -m AVC -ts recent | audit2allow -M mymodule
sealertAnalyze and explain SELinux denials in human-readable formatsealert -a /var/log/audit/audit.log
EnforcingSELinux fully active — violations blocked and loggedsetenforce 1
PermissiveSELinux logs violations but does not block themsetenforce 0
DisabledSELinux completely off — requires reboot to changeSELINUX=disabled in /etc/selinux/config

Secure Remote Access

ItemDescriptionExample
Key vs. password authKey-based auth is stronger and recommended over passwordsssh-keygen -t ed25519 -C "alice@server"
SSH tunnelingRoute traffic through an encrypted SSH connectionssh -L 5432:db:5432 jumphost
PermitRootLoginDisable direct root SSH login for securitygrep PermitRootLogin /etc/ssh/sshd_config
Disabling X forwardingDisable X11 forwarding to reduce attack surfaceecho "X11Forwarding no" >> /etc/ssh/sshd_config
AllowUsersWhitelist specific users allowed to log in via SSHAllowUsers alice bob in sshd_config
AllowGroupsWhitelist specific groups allowed to log in via SSHAllowGroups sshusers admins in sshd_config
SSH agentCaches SSH keys in memory to avoid repeated passphrase entryeval $(ssh-agent) && ssh-add ~/.ssh/id_ed25519
SFTPSecure file transfer over SSHsftp user@server
SFTP chrootJail SFTP users to a specific directoryChrootDirectory /opt/sftp/%u in sshd_config
fail2banAutomatically bans IPs after repeated failed login attemptsfail2ban-client status sshd

Other Hardening

ItemDescriptionExample
Avoid TelnetTelnet sends all data including passwords in plaintextsystemctl mask telnet.socket
Avoid FTPFTP transmits credentials and data unencryptedsystemctl disable --now vsftpd
Avoid TFTPTFTP has no authentication at allsystemctl mask tftp.socket
Disable unused filesystemsReduce kernel attack surface by blocking unneeded modulesecho "install cramfs /bin/true" > /etc/modprobe.d/disable-filesystems.conf
Remove unnecessary SUIDSUID binaries are prime privilege escalation targetsfind / -perm /4000 -type f 2>/dev/null
Secure boot / UEFICryptographically verifies the boot chain to prevent rootkitsmokutil --sb-state

3.4 Account Hardening

ItemDescriptionExample
Password complexityEnforce character class requirements via pam_pwqualitygrep minclass /etc/security/pwquality.conf
Password lengthSet minimum password length (recommended 14+)grep minlen /etc/security/pwquality.conf
Password expirationForce periodic password changes using chage or login.defschage -M 90 alice
Password reusePrevent users from re-using recent passwordsgrep remember /etc/pam.d/system-auth
Password historyStore hashed history to enforce reuse preventioncat /etc/security/opasswd
MFARequire a second factor (TOTP, hardware key) in addition to passwordpam_google_authenticator.so in /etc/pam.d/sshd
Breach listsCheck passwords against known-breached password databasespip-audit or k-anonymity HIBP API check
/sbin/nologinCompletely prevents interactive login for a user accountusermod -s /sbin/nologin serviceuser
/bin/rbashRestricted bash shell — limits what logged-in users can dousermod -s /bin/rbash limiteduser
pam_tally2Account lockout after repeated failed logins (legacy)pam_tally2 --user alice --reset
Avoid running as rootUse sudo for specific commands — never log in as rootsudo systemctl restart nginx

3.5 Cryptography

ItemDescriptionExample
GPGGNU Privacy Guard — file encryption and digital signinggpg -e -r alice@example.com secret.txt
LUKS2Linux standard for full disk and partition encryptioncryptsetup luksFormat --type luks2 /dev/sdb1
Argon2Modern password-based key derivation function — resistant to GPU attackscryptsetup luksFormat --pbkdf argon2id /dev/sdb1
OpenSSLWidely used TLS toolkit and cryptographic libraryopenssl s_client -connect example.com:443
WireGuardModern minimal VPN protocol built into the Linux kernelwg show
LibreSSLOpenBSD fork of OpenSSL with security-first rewriteopenssl version (shows LibreSSL if installed)
TLS protocol versionsTLS 1.2 acceptable; TLS 1.3 preferred; all older versions deprecatedopenssl s_client -connect host:443 -tls1_3
SHA-256Secure 256-bit hash function — used for integrity verificationsha256sum file.txt
HMACHash with a secret key — provides both integrity and authenticationopenssl dgst -sha256 -hmac "key" file.txt
Removal of weak algorithmsDisable MD5, SHA-1, RC4, DES, TLS 1.0/1.1 system-wideupdate-crypto-policies --set FUTURE
Trusted root certificatesCA certificates pre-installed and trusted by the systemupdate-ca-trust extract
No-cost certificatesFree certificates from Let’s Encrypt using ACME protocolcertbot --nginx -d example.com
Commercial certificatesPaid CA certificates with OV/EV validation for business useopenssl req -new -key private.key -out request.csr
Avoiding self-signedSelf-signed certs provide encryption but no identity verificationopenssl verify certificate.crt

3.6 Compliance & Audit

ItemDescriptionExample
Anti-malwareClamAV and similar tools scanning for malicious softwareclamscan -r /var/www/html
IOCIndicators of Compromise — evidence of system intrusionfind /tmp -executable -type f 2>/dev/null
CVEsStandardized identifiers for publicly disclosed vulnerabilitiesdnf updateinfo list cves
CVSSNumerical scoring system (0–10) for vulnerability severitydnf updateinfo info CVE-2024-1234
Backporting patchesApplying security fixes to older package versions without upgradingrpm -q --changelog nginx | grep CVE
Service misconfigurationsInsecure defaults, unnecessary services, wrong permissionslynis audit system
Port scannersDiscover open ports and running services on hostsnmap -sV 192.168.1.0/24
Protocol analyzerCapture and analyze network traffic packetstcpdump -i eth0 -w capture.pcap
OpenSCAPAutomated security compliance scanning against standardsoscap xccdf eval --profile cis_server_l2 ssg-rhel9-ds.xml
CIS BenchmarksConsensus-based security configuration guidelinesoscap xccdf eval --profile cis /path/to/ssg.xml
AIDEFile integrity monitoring — detects unauthorized file changesaide --check
rkhunterRootkit hunter — scans for known rootkits and backdoorsrkhunter --check --skip-keypress
Signed package verificationVerify package files against GPG-signed RPM/dpkg databaserpm -Va | grep "^..5"
Installed file verificationCheck package-owned files for unauthorized modificationsdebsums -c
shredSecurely overwrite files multiple times before deletionshred -vzu -n 3 file.txt
badblocks -wWrite-mode block test that overwrites all blocksbadblocks -w /dev/sdb
dd if=/dev/urandomOverwrite a disk with random data for secure erasuredd if=/dev/urandom of=/dev/sdb bs=4M status=progress
Cryptographic destructionDestroy LUKS header making encrypted data permanently unreadablecryptsetup erase /dev/sdb
Software supply chainSecurity of all components in the software build and deploy processtrivy image nginx:latest
/etc/issuePre-login banner displayed on local console before login promptecho "Authorized access only" > /etc/issue
/etc/issue.netPre-login banner displayed to SSH users before authenticationecho "Authorized access only" > /etc/issue.net
/etc/motdMessage of the Day displayed after successful logincat /etc/motd

Domain 4.0 — Automation, Orchestration & Scripting (17%)

4.1 Automation & Orchestration

Ansible

ItemDescriptionExample
PlaybooksYAML files defining automation tasks and their orderansible-playbook site.yml
InventoryDefines which hosts Ansible manages and organizes them into groupsansible-inventory --list
ModulesUnits of work in Ansible — Python programs doing one specific thingansible webservers -m service -a "name=nginx state=started"
Ad hocQuick one-off commands without writing a full playbookansible all -m ping
CollectionsDistributable packages of Ansible modules, roles, and pluginsansible-galaxy collection install ansible.posix
FactsAutomatically collected system information available in playbooksansible webserver01 -m setup
AgentlessConnects over SSH — no software needed on managed nodesansible all -m command -a "uptime"

Puppet

ItemDescriptionExample
ClassesNamed blocks of reusable Puppet configuration codepuppet apply -e "include nginx"
CertificatesMutual TLS certificates authenticating agents to Puppet serverpuppetserver ca list
ModulesSelf-contained units of Puppet code with standard directory structurepuppet module install puppetlabs-apache
FactsSystem properties automatically available in manifests via Facterfacter os.family
Agent/AgentlessAgent mode polls server; agentless uses puppet apply locallypuppet agent --test

OpenTofu

ItemDescriptionExample
ProviderPlugin that interfaces with a specific cloud/infrastructure APItofu init
ResourceInfrastructure object being created and managedtofu plan
StateFile tracking all managed resources — source of truthtofu state list
APIOpenTofu interacts with infrastructure through provider REST APIstofu apply -auto-approve

Unattended Deployment

ItemDescriptionExample
KickstartFully automated RHEL/Fedora installation from a single answer fileksvalidator /var/www/html/ks/server.ks
cloud-initStandard cloud VM initialization — runs on first bootcloud-init status --wait

CI/CD

ItemDescriptionExample
Version controlGit-based tracking of all code and infrastructure changesgit log --oneline --graph --all
Shift left testingMove testing earlier in development to catch issues sooneransible-lint playbooks/ && yamllint .
GitOpsGit as the single source of truth — operators reconcile statekubectl get applications -n argocd
PipelinesAutomated stages (test, build, scan, deploy) triggered by Git eventsgitlab-runner verify
DevSecOpsSecurity integrated at every stage of the development lifecycletrivy image --severity HIGH,CRITICAL myapp:latest

Deployment Orchestration — Kubernetes

ItemDescriptionExample
ConfigMapsStore non-sensitive configuration data for podskubectl create configmap myapp-config --from-literal=ENV=prod
SecretsStore sensitive data (passwords, tokens) for podskubectl create secret generic db-creds --from-literal=password=secret
PodsSmallest deployable unit — one or more containers sharing networkkubectl get pods -n production
DeploymentsManage pod lifecycle — rolling updates, rollbacks, scalingkubectl rollout status deployment/myapp
VolumesPersistent storage attached to podskubectl get pvc
ServicesStable network endpoints for pods — load balancing and discoverykubectl expose deployment myapp --port=80
VariablesInject configuration into pods via env vars, ConfigMaps, Secretskubectl set env deployment/myapp APP_ENV=production

Deployment Orchestration — Docker Swarm

ItemDescriptionExample
ServiceLong-running containers managed across the swarmdocker service create --name web --replicas 3 nginx
NodesIndividual machines (managers and workers) in the swarm clusterdocker node ls
TasksIndividual container instances of a service running on a nodedocker service ps webapp
NetworksOverlay networks enabling container communication across nodesdocker network create -d overlay appnet
ScaleIncrease or decrease the number of service replicasdocker service scale webapp=5

Docker/Podman Compose

ItemDescriptionExample
Compose fileYAML file defining a multi-container application stackcat docker-compose.yml
Up/downStart or stop the entire application stackdocker compose up -d
LogsView log output from all services in the compose stackdocker compose logs -f

4.2 Shell Scripting

Expansion

ItemDescriptionExample
${var}Parameter expansion — access and manipulate variable valuesecho ${name:-"default"}
$(foo)Command substitution — capture command output as a stringdate=$(date +%Y-%m-%d)
`foo`Legacy backtick command substitution (avoid — use $() instead)hostname=`hostname`
(foo)Subshell — run commands in an isolated child shell(cd /tmp && ls)

Core Scripting Concepts

ItemDescriptionExample
FunctionsNamed reusable blocks of code in a shell scriptgreet() { echo "Hello $1"; }
IFS/OFSDefines what characters separate fields when bash splits stringsIFS=',' read -r a b c <<< "one,two,three"

Conditional Statements

ItemDescriptionExample
ifExecute code block based on a conditionif [[ -f /etc/passwd ]]; then echo "exists"; fi
casePattern-matching conditional — cleaner than chained if/elifcase "$action" in start) systemctl start nginx ;; esac

Looping Statements

ItemDescriptionExample
untilInverse of while — runs while condition is falseuntil pg_isready -q; do sleep 2; done
forIterate over a list, range, array, or command outputfor f in /var/log/*.log; do echo "$f"; done
whileExecute while a condition is truewhile IFS= read -r line; do echo "$line"; done < file.txt

Interpreter Directive

ItemDescriptionExample
#!Shebang — tells kernel which interpreter to use for the script#!/usr/bin/env bash

Comparisons — Numerical

OperatorDescriptionExample
-eqNumeric equal to[[ $a -eq $b ]]
-geNumeric greater than or equal to[[ $count -ge 5 ]]
-gtNumeric greater than[[ $usage -gt 80 ]]
-leNumeric less than or equal to[[ $retries -le 3 ]]
-ltNumeric less than[[ $pid -lt 1000 ]]
-neNumeric not equal to[[ $exit_code -ne 0 ]]

Comparisons — String

OperatorDescriptionExample
>String greater than (lexicographic)[[ "$b" > "$a" ]]
<String less than (lexicographic)[[ "$a" < "$b" ]]
==String equal to[[ "$str" == "expected" ]]
=String equal to (POSIX)[ "$str" = "expected" ]
=~Regex match[[ "$email" =~ ^[a-z]+@[a-z]+\.[a-z]+$ ]]
!=String not equal to[[ "$env" != "production" ]]
<=String less than or equal to[[ "$a" <= "$b" ]]
>=String greater than or equal to[[ "$a" >= "$b" ]]

Regular Expressions

ItemDescriptionExample
[[ $foo =~ regex ]]Bash extended regex match — captures in BASH_REMATCH array[[ "$ip" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]

Test Operators

OperatorDescriptionExample
!Negate a test condition[[ ! -f /tmp/lock ]]
-dTest if path is a directory[[ -d /var/log ]]
-fTest if path is a regular file[[ -f /etc/passwd ]]
-nTest if string is non-empty[[ -n "$hostname" ]]
-zTest if string is empty (zero length)[[ -z "$input" ]]

Variables

ItemDescriptionExample
EnvironmentalVariables inherited from the shell environmentecho $HOME
ArgumentsPositional parameters passed to a script (2, #)echo "Arg 1: $1, Count: $#"
aliasCreate a shorthand name for a commandalias ll='ls -lah'
exportMake a variable available to child processesexport APP_ENV=production
localRestrict a variable’s scope to a functionlocal count=0
setSet shell options or positional parametersset -euo pipefail
unaliasRemove an aliasunalias ll
unsetRemove a variable or functionunset MY_VAR
$?Return code of the last executed commandecho $?

4.3 Python for Sysadmin

ItemDescriptionExample
Virtual environmentIsolated Python installation to avoid dependency conflictspython3 -m venv myenv && source myenv/bin/activate
Built-in modulesStandard library modules requiring no installation (os, sys, subprocess)import subprocess; subprocess.run(['df', '-h'])
Installing dependenciesInstall third-party packages using pippip3 install -r requirements.txt
IndentationsPython uses 4-space indentation to define code blocks(enforced by language — no braces)
Current versionsPython 3.x is active; Python 2.x is end-of-lifepython3 --version
BooleanTrue/False values used in conditions and logicis_running = True
DictionaryKey-value pairs — ordered, mutable (Python 3.7+)server = {'hostname': 'web01', 'ip': '10.0.0.1'}
Floating pointDecimal numbers — not exact due to IEEE 754 representationusage = 87.5
IntegerWhole numbers with arbitrary precision in Pythonport = 22
ListOrdered, mutable sequence of items allowing duplicatesservers = ["web01", "web02", "db01"]
StringImmutable sequence of charactershostname = f"server-{id:03d}.example.com"
Modules & packagesExtend Python with reusable code librariesimport paramiko
PEP 8Python’s official style guide — naming, formatting, importsflake8 script.py

4.4 Git Version Control

CommandDescriptionExample
.gitignoreFile telling Git which files and directories to never trackecho "*.pyc" >> .gitignore
git addStage changes for the next commitgit add -p file.py
git branchCreate, list, rename, and delete branchesgit branch feature/new-feature
git checkoutSwitch branches or restore filesgit checkout -b feature/new-feature
git cloneClone an existing repository from a URLgit clone git@github.com:org/repo.git
git commitRecord staged changes with a messagegit commit -m "feat: add backup rotation"
git configSet user identity and Git behavior settingsgit config --global user.email "alice@example.com"
git diffShow differences between commits, branches, or working treegit diff main feature/new-feature
git fetchDownload changes from remote without merginggit fetch --prune
git initInitialize a new Git repositorygit init my-project
git logBrowse commit history with filtering optionsgit log --oneline --graph --all
git mergeCombine another branch into the current branchgit merge --no-ff feature/new-feature
squashCombine all feature commits into one before merginggit merge --squash feature/messy-history
git pullFetch from remote and merge into current branchgit pull --rebase origin main
git pushUpload commits to a remote repositorygit push -u origin feature/new-feature
git rebaseReapply commits on top of a different base commitgit rebase -i HEAD~3
git resetMove HEAD and optionally reset staging/working directorygit reset --soft HEAD~1
git stashTemporarily save uncommitted changes without committinggit stash push -m "WIP: feature work"
git tagCreate named references to specific commits for releasesgit tag -a v2.0.0 -m "Release 2.0.0"

4.5 AI Best Practices

Common Use Cases

Use CaseDescriptionExample
Code generationAI accelerates writing scripts, functions, and boilerplate codePrompt: “Write a bash script to monitor disk usage and alert via email”
Regex generationAI generates and explains complex regular expressionsPrompt: “Generate a Python regex to validate IPv4 addresses”
IaC generationAI generates Ansible, Terraform, Kubernetes manifestsPrompt: “Write an Ansible playbook to harden SSH on RHEL 9”
DocumentationAI writes docstrings, README files, and inline commentsPrompt: “Add Google-style docstrings to this Python function”
Compliance recommendationsAI analyzes configs against CIS/NIST standardsPrompt: “Review this sshd_config against CIS Benchmark Level 2”
Security reviewAI identifies vulnerabilities and suggests fixes in codePrompt: “Review this function for command injection vulnerabilities”
Code optimizationAI suggests performance improvements and better algorithmsPrompt: “Optimize this function for processing 1GB log files”
Code lintingAI explains linting errors and suggests correctionsPrompt: “Explain these flake8 errors and show corrected code”

Best Practices

PracticeDescriptionExample
Review before useNever run AI-generated code without reading every lineAlways read and understand before executing
Verify outputAI can be confidently wrong — cross-reference all factsnginx -t (validate AI-generated nginx config)
LLM training data securityNever send private keys, PII, or proprietary code to public AISanitize all inputs before sharing with public LLMs
Human reviewAI output requires human expert review for high-stakes changesCode review process for all AI-generated commits
Local modelsUse local models (Ollama, llama.cpp) for sensitive dataollama run codellama
Corporate policyVerify AI tools are approved by IT/Security before usingCheck acceptable use policy before adopting AI tools
Prompt engineeringClear, detailed, constrained prompts yield better AI outputInclude context, constraints, format, and examples in prompts

Domain 5.0 — Troubleshooting (22%)

5.1 Monitoring Concepts

Service Monitoring

ItemDescriptionExample
SLAFormal contract defining expected service level and remedies for breach”99.9% uptime monthly or service credits apply”
SLIQuantitative measurement of specific service behaviorawk '{sum+=$NF; count++} END {print sum/count}' access.log
SLOInternal target for an SLI — stricter than the SLA to provide buffer”p99 API latency < 200ms over any 30-minute window”

Data Acquisition Methods

ItemDescriptionExample
SNMPProtocol for collecting metrics from network devices and serverssnmpwalk -v3 -l authPriv -u user -a SHA -A pass 192.168.1.10
SNMP TrapsAsync notifications sent from device to manager on significant eventssnmptrap -v2c -c public mgr-ip "" coldStart.0
MIBsHierarchical databases defining what metrics an SNMP agent exposessnmpget -v3 ... sysUpTime.0
Agent/AgentlessAgent = software installed on host; Agentless = remote protocols onlysystemctl status node_exporter
WebhooksHTTP callbacks — monitored service pushes data to monitoring systemcurl -X POST http://receiver:9095/alert -d '{"alert":"disk_full"}'
Health checksActive probes verifying a service is functioning correctlycurl -sf http://localhost/health | exit 1
Log aggregationCentralizing logs from multiple sources into one queryable platformsystemctl status filebeat

Configurations

ItemDescriptionExample
ThresholdsBoundaries defining when a metric transitions from normal to alertalert: expr: disk_usage > 90
AlertsDefinitions of what happens when a threshold is crossedsystemctl status alertmanager
EventsDiscrete occurrences — deployments, errors, state changeslogger -t monitor "Deployment complete: v2.1.0"
NotificationsDelivery mechanisms for alerts (email, Slack, PagerDuty)curl -X POST $SLACK_WEBHOOK -d '{"text":"Alert!"}'
LoggingStructured, retained records of system and application activityjournalctl -u nginx --since "1 hour ago"

5.2 Hardware, Storage & OS Troubleshooting

IssueDescriptionDiagnostic Command
Kernel panicFatal unrecoverable kernel error — system halts to prevent data lossjournalctl -b -1 -p err
Data corruptionFiles unreadable, checksums fail, filesystem errorsfsck -n /dev/sdb1
Kernel corruption/boot files damaged, modules fail to load, random crashesrpm -V kernel-$(uname -r)
Package dependency issuesPackage install fails due to conflicting or missing dependenciesdnf check
Filesystem won’t mountmount fails, wrong type, corruption, missing driverdmesg | tail -20
Server not turning onNo power, no POST, system deadipmitool -I lanplus -H mgmt-ip -U admin -P pass power status
OS filesystem fullNo space left on device — disk capacity exhausteddf -h && du -sh /* 2>/dev/null | sort -rh | head -10
Server inaccessibleCannot SSH, ping fails, service unreachableping server-ip && nc -zv server-ip 22
Device failureDisk errors in dmesg, I/O errors, device disappearssmartctl -H /dev/sda
Inode exhaustion”No space left” but df -h shows free spacedf -i
Partition not writableRead-only filesystem error on a partitionmount | grep "ro,"
Segmentation faultApplication crashes with SIGSEGV signaljournalctl | grep segfault
GRUB misconfigurationSystem won’t boot, GRUB rescue prompt, wrong default kernelgrub2-mkconfig -o /boot/grub2/grub.cfg
Killed processesProcess disappears, OOM kill messages, exit code 137dmesg | grep -i "killed process"
PATH misconfiguration”command not found” for commands that existecho $PATH
Systemd unit failuresService fails to start, exits immediatelysystemctl status nginx && journalctl -u nginx -n 50
Missing/disabled driversHardware not recognized, device missing from lsblkdmesg | grep -i firmware && lspci -k
Unresponsive process100% CPU, hangs, not responding to requestsstrace -p $(pgrep app)
Quota issues”Disk quota exceeded” even with available spacequota -u alice && repquota -a
Memory leaksMemory usage grows continuously, OOM kills over timesmem -k -s rss -r | head -10

5.3 Network Troubleshooting

IssueDescriptionDiagnostic Command
Misconfigured firewallsConnection refused/times out — firewall blocking trafficfirewall-cmd --list-all && iptables -L -n -v
DHCP issuesNo IP assigned, wrong IP, can’t connect after reboottcpdump -i eth0 port 67 or port 68
DNS issuesCannot resolve hostnames, wrong IP, intermittent failuresdig google.com && cat /etc/resolv.conf
MTU mismatchLarge transfers fail; small pings work but large ones don’tping -M do -s 1472 gateway-ip
BondingBond interface down, only one link active, failover brokencat /proc/net/bonding/bond0
MAC spoofingMAC address mismatch, duplicate MAC on networkethtool -P eth0 && arp -n
SubnetCan reach some hosts but not others — wrong maskipcalc 192.168.1.50/24
Cannot ping serverNo ICMP response — firewall, down host, or routing issuearping -I eth0 192.168.1.100
Gateway issuesCan reach local subnet but nothing beyond itip route show default
Server unreachableAll connection attempts fail at all layersmtr --report server-ip
IP conflictsIntermittent connectivity, ARP conflict messages in logsarping -D -I eth0 192.168.1.50
Dual stack issuesWorks with IPv4 but not IPv6 or vice versaip -6 address show && ping6 ::1
Link downInterface shows DOWN state, NO-CARRIERip link show && ethtool eth0
Link negotiationConnected but slow, high errors, duplex mismatchethtool eth0 | grep -E "Speed|Duplex"

5.4 Security Troubleshooting

IssueDescriptionDiagnostic Command
SELinux policyService blocked by SELinux MAC policyausearch -m AVC -ts recent | audit2allow
SELinux contextFile has wrong SELinux type label — service denied accessls -Z /path && restorecon -Rv /path
SELinux booleansFeature works in Permissive but not Enforcing — boolean neededgetsebool -a | grep httpd
ACL issuesCorrect standard permissions but access still deniedgetfacl /opt/project/file.txt
File attributesPermission denied even as root — chattr attributes setlsattr /path/to/file
Account accessLogin fails — locked, expired, wrong shell, wrong key permspasswd -S alice && faillock --user alice
Unpatched systemsKnown CVEs exploitable in installed package versionsdnf updateinfo list sec
Misconfigured servicesUnnecessary services exposed, default credentials, info disclosuress -tulnp && lynis audit system
Remote access issuesSSH fails — key mismatch, cipher mismatch, GSSAPI delaysssh -vvv user@host 2>&1 | grep -i "auth|denied"
Certificate issuesExpired cert, chain incomplete, self-signed, key mismatchopenssl x509 -in cert.pem -noout -checkend 0
Misconfigured repositoryGPG signature failure, wrong URL, mixed versionsdnf clean all && dnf makecache
Insecure protocolsSSLv3/TLS 1.0/RC4/MD5 still enabled — security policy violationtestssl.sh https://example.com
Cipher negotiation”no shared cipher” — client and server have no common cipheropenssl s_client -connect host:443 -v 2>&1 | grep cipher

5.5 Performance Troubleshooting

SymptomDescriptionDiagnostic Command
SwappingSystem writing RAM contents to disk — causes dramatic slowdownvmstat 1 5 (watch si/so columns)
Out of memoryProcesses killed by OOM killer — exit code 137dmesg | grep -i "killed process"
Slow application responseRequests take longer than expected — SLO breachtime curl -s -o /dev/null http://localhost/api/
System unresponsivenessSystem frozen, SSH unresponsive, commands timeoutuptime && ps aux | awk '$8=="D"'
High CPU usageCPU saturated — applications or kernel consuming all cyclesmpstat -P ALL 1 && perf top
High load averageLoad >> CPU count — processes queuing for CPU or I/Ouptime && vmstat 1 5 (watch r and b)
High context switchingExcessive thread scheduling overhead — high %sysvmstat 1 5 (watch cs column)
High failed loginsBrute force attack consuming CPU and filling auth logslastb | awk '{print $3}' | sort | uniq -c | sort -rn
Slow startupSystem or service takes too long to initializesystemd-analyze blame
High I/O waitCPU waiting for disk I/O — storage bottleneckiostat -x 1 5 (watch await and %util)
Packet dropsNetwork data lost — NIC buffer overflow or socket saturationethtool -S eth0 | grep -i drop
JitterNetwork latency varies wildly — inconsistent response timesmtr --report target (check mdev column)
Random disconnectsConnections drop unexpectedly — keepalive, firewall, resource issuess -ti | grep retrans
Random timeoutsRequests fail intermittently with timeout errorsnetstat -s | grep -i "retransmit"
High latencyAll operations consistently slower than expectedping -c 20 target | tail -1
Slow response timesApplication responses exceed acceptable thresholdsab -n 1000 -c 10 http://localhost/
High disk latencyStorage I/O taking too long — device saturated or failingiostat -x 1 5 (watch await column)
Low throughputTransfers slower than hardware should supportfio --name=seqread --ioengine=libaio --rw=read --bs=128k --size=4G
Blocked processesProcesses stuck in D state waiting on I/O or locksps aux | awk '$8=="D" {print $2, $11}'
Hardware errorsMCE events, ECC corrections, disk SMART failuresdmesg | grep -iE "mce|hardware error"
Sluggish terminalSSH connects slowly, commands lag, prompt is slowtime ssh user@host echo test
Exceeding baselinesMetrics drift above established normal rangessar -r -f /var/log/sa/sa$(date +%d)
Slow remote storageNFS/iSCSI operations have high latencynfsstat -c | grep retrans
CPU bottleneckCPU saturated — run queue consistently > CPU countvmstat 1 5 (r column > nproc)

Acronym Reference (Key Terms)

AcronymDefinition
ACLAccess Control List
AIDEAdvanced Intrusion Detection Environment
APIApplication Programming Interface
CI/CDContinuous Integration/Continuous Deployment
CISCenter for Internet Security
CVECommon Vulnerabilities and Exposures
CVSSCommon Vulnerability Scoring System
DHCPDynamic Host Configuration Protocol
DNATDestination Network Address Translation
DNSDomain Name System
FHSFilesystem Hierarchy Standard
GPGGNU Privacy Guard
GRUBGrand Unified Bootloader
HMACHashed Message Authentication Code
IaCInfrastructure as Code
LDAPLightweight Directory Access Protocol
LLMLarge Language Model
LUKS2Linux Unified Key Setup 2
LVMLogical Volume Manager
MFAMultifactor Authentication
MIBManagement Information Base
MTUMaximum Transmission Unit
NATNetwork Address Translation
NFSNetwork File System
NTPNetwork Time Protocol
OOMOut of Memory
OpenSCAPOpen Security Content Automation Protocol
PAMPluggable Authentication Modules
PATPort Address Translation
PEPPython Enhancement Proposal
PIDProcess Identification Number
PPIDParent Process Identification Number
PTPPrecision Time Protocol
PXEPreboot Execution Environment
QEMUQuick Emulator
RAIDRedundant Array of Independent Disks
SNATSource Network Address Translation
SNMPSimple Network Management Protocol
SELinuxSecurity Enhanced Linux
SFTPSecure File Transfer Protocol
SLAService-level Agreement
SLIService-level Indicator
SLOService-level Objective
SMBServer Message Block
SMTPSimple Mail Transfer Protocol
SSHSecure Shell
SSSDSystem Security Services Daemon
TLSTransport Layer Security
UEFIUnified Extensible Firmware Interface
UFWUncomplicated Firewall

CompTIA Linux+ XK0-006 V8 | Exam Objectives Document Version 5.0 | Copyright © 2024 CompTIA, Inc.