DiPiazza

Where I break stuff, then write about it.

CompTIA Linux+ (XK0-005) Study Notes

Structured notes aligned to the Linux+ exam domains

1.0 System Management (32%)

Filesystem Hierarchy (FHS)

  • /boot: Bootloader and kernel files.
  • /proc: Virtual filesystem with process/system info.
  • /sys: Kernel and hardware information.
  • /var: Variable data like logs and spools.
  • /usr: User binaries, libraries, and docs.
  • /lib: Essential shared libraries/modules.
  • /dev: Device files for hardware.
  • /etc: System configuration files.
  • /opt: Optional/add-on software.
  • /bin: Essential user binaries.
  • /sbin: System binaries for admins.
  • /home: User home directories.
  • /media: Removable media mounts.
  • /mnt: Temporary mount points.
  • /root: Root user home directory.
  • /tmp: Temporary files.

Disk Partitioning & Mounting

  • MBR: Legacy partitioning; 2TB limit; 4 primary partitions.
  • GPT: Modern partition table for large disks and many partitions.
  • FUSE: Filesystems implemented in user space.
  • fdisk: MBR partitioning tool.
  • parted: GPT-aware partitioning tool.
  • partprobe: Reload partition table without reboot.
  • mount: Mount a filesystem manually.
  • /etc/fstab: Persistent mount configuration file.
  • systemd.mount: systemd unit for mounts.
  • LUKS: Linux Unified Key Setup (disk encryption).

LVM & RAID

  • pvcreate: Create a physical volume.
  • vgcreate: Create a volume group.
  • lvcreate: Create a logical volume.
  • lvresize: Resize a logical volume.
  • pvs: Display physical volume details.
  • vgs: Display volume group details.
  • lvs: Display logical volume details.
  • RAID 0: Striping; no redundancy.
  • RAID 1: Mirroring for redundancy.
  • RAID 5: Single-parity redundancy with striping.
  • RAID 6: Dual-parity redundancy with striping.
  • mdadm: Manage RAID arrays.
  • /proc/mdstat: RAID status interface.

Networking & Name Resolution

  • ip: Configure routing and interfaces.
  • ss: Socket statistics and connections.
  • nmcli: NetworkManager CLI.
  • hostname: Show or set system hostname.
  • hostnamectl: systemd hostname management.
  • arp: View ARP cache.
  • /etc/resolv.conf: DNS resolver configuration.
  • nsswitch.conf: Name lookup order.
  • dig: DNS query tool.
  • nslookup: Legacy DNS query tool.
  • host: Simple DNS lookup tool.
  • WHOIS: Domain registration lookup.
  • tcpdump: CLI packet capture.
  • wireshark: GUI packet analyzer.
  • tshark: CLI Wireshark analyzer.
  • ping: ICMP reachability test.
  • traceroute: Trace network path hops.
  • mtr: Combined ping/traceroute diagnostics.

System Services & Scheduling

  • systemctl: Manage systemd services.
  • start: Start a service immediately.
  • stop: Stop a running service.
  • restart: Stop and start a service.
  • status: Show service status/logs.
  • enable: Start service at boot.
  • disable: Prevent service from starting at boot.
  • mask: Block a service from being started.
  • cron: Time-based job scheduler.
  • crontab: Manage cron jobs.
  • at: Schedule one-time jobs.

User, Group & Process Management

  • useradd: Create a user account.
  • userdel: Remove a user account.
  • usermod: Modify a user account.
  • groupadd: Create a group.
  • groupdel: Remove a group.
  • groupmod: Modify a group.
  • /etc/passwd: User account database.
  • /etc/shadow: Encrypted password database.
  • /etc/group: Group definitions.
  • ps: List running processes.
  • top: Live process/resource view.
  • htop: Enhanced interactive process viewer.
  • nice: Start a process with a priority.
  • renice: Change priority of a running process.
  • kill: Send a signal to a PID.
  • pkill: Send a signal by process name.
  • pgrep: Find PIDs by name/pattern.
  • Zombie: Terminated, unreaped process.

Package Management & Updates

  • DNF: Modern RPM package manager (Fedora/CentOS).
  • YUM: Legacy RPM package manager.
  • APT: Debian-based package manager.
  • RPM: Package format/manager for Red Hat systems.
  • dpkg: Low-level Debian package tool.
  • ZYpp: openSUSE package management system.
  • Kernel updates: Updates to the Linux kernel.
  • Package updates: Updates to installed software.
  • snapd: Service managing Snap packages.
  • Flatpak: Sandboxed cross-distro app packaging.
  • AppImage: Portable self-contained application format.

2.0 Security (21%)

Permissions & Access Control

  • chmod: Change file permissions.
  • chown: Change file owner.
  • chgrp: Change file group.
  • SUID: Run as file owner when executed.
  • SGID: Run as file group when executed.
  • Sticky Bit: Restrict deletes in shared directories.
  • ACLs: Extended permissions beyond owner/group/other.
  • umask: Default permission mask for new files.

SELinux

  • SELinux: Mandatory access control framework.
  • Enforcing: SELinux policy is enforced.
  • Permissive: Violations logged only.
  • Disabled: SELinux is off.
  • setenforce: Change SELinux mode.
  • getenforce: Show current SELinux mode.
  • semanage: Manage SELinux settings/contexts.
  • audit2allow: Build allow rules from audit logs.

3.0 Scripting, Containers, and Automation (19%)

Shell Scripting Essentials

  • Loops: Repeat commands until a condition is met.
  • while: Loop while a condition is true.
  • for: Loop over a list or range.
  • until: Loop until a condition becomes true.
  • Conditionals: Execute logic based on true/false tests.
  • if: Run commands when a condition is true.
  • case: Select a code path based on matching patterns.
  • Variables: Store values for reuse in scripts.
  • Globbing: Wildcard pattern matching for filenames.
  • Brace expansion: Generate multiple strings from a pattern.
  • Standard streams: stdin, stdout, and stderr.
  • | (pipe): Pass output of one command to another.
  • &&: Run next command if previous succeeds.
  • ||: Run next command if previous fails.
  • >: Redirect output to a file (overwrite).
  • >>: Redirect output to a file (append).
  • <: Read input from a file.
  • <<: Here-document input block.
  • &: Run process in the background.
  • Exit code: Command status (0 success, non-zero failure).
  • $PATH: Directories searched for commands.
  • $SHELL: Current user shell path.
  • $?: Exit status of last command.
  • Relative path: Path based on current directory.
  • Absolute path: Full path from root (/).

Containers & Automation

  • Docker: Container platform for packaging apps.
  • docker run: Create and start a container.
  • docker start: Start a stopped container.
  • docker stop: Stop a running container.
  • docker ps: List containers.
  • docker build: Build an image from a Dockerfile.
  • docker pull: Download an image.
  • docker push: Upload an image to a registry.
  • Kubernetes: Container orchestration platform.
  • git clone: Copy a repository.
  • git add: Stage changes.
  • git commit: Save a snapshot.
  • git push: Upload commits.
  • git pull: Fetch and merge updates.
  • .gitignore: Define files to ignore in Git.
  • CI/CD: Automated build/test/deploy pipelines.

4.0 Troubleshooting (28%)

Resource Troubleshooting

  • df: Show filesystem free space.
  • du: Show file/directory disk usage.
  • OOM: Out-of-memory condition.
  • iowait: CPU time waiting on disk I/O.
  • journalctl: systemd log viewer.

Common Issue Areas

  • Network issues: Routing, DNS, or firewall problems.
  • Storage issues: RAID/LVM or filesystem failures.
  • Permission issues: ACL, SELinux, or ownership conflicts.

Get in Touch