Linux Distributions
Linux is an open-source kernel; distributions (distros) package the kernel with tools and a package manager. Major families: Debian-based: Debian, Ubuntu, Linux Mint, Raspberry Pi OS. Package manager: APT (apt-get, apt). Red Hat-based: Red Hat Enterprise Linux (RHEL), CentOS, Fedora, AlmaLinux. Package manager: RPM/YUM/DNF. Arch-based: Arch Linux, Manjaro. Package manager: pacman. Desktop environments: GNOME (Ubuntu default), KDE Plasma, XFCE, LXDE, Cinnamon (Mint). Linux server editions often have no GUI (command-line only). Android is based on the Linux kernel. Common desktop Linux distros for A+ context: Ubuntu and Linux Mint (most beginner-friendly).
Linux File System Structure
Linux uses a single hierarchical file system starting at / (root). Key directories: / (root — top of the hierarchy), /home (user home directories — like C:\Users), /etc (configuration files), /bin and /usr/bin (user commands/executables), /sbin and /usr/sbin (system administration executables — require root), /tmp (temporary files — cleared on reboot), /var (variable data: logs in /var/log, spool files), /dev (device files — hardware represented as files), /mnt and /media (mount points for external drives), /proc (virtual file system — kernel and process information), /boot (boot files, including kernel). Unlike Windows, Linux uses forward slashes (/), not backslashes (\). Case-sensitive: File.txt ≠ file.txt ≠ FILE.TXT.
Essential Linux Commands
Navigation: ls (list files), ls -la (long format with hidden files), cd (change directory), pwd (print working directory), mkdir (make directory), rm (remove file), rm -rf (remove directory recursively — use with caution), cp (copy), mv (move/rename), cat (display file), less (page through file), head (first lines), tail (last lines), tail -f (follow log in real time). File creation and editing: touch (create empty file or update timestamp), nano/vi/vim (text editors). System info: uname -a (kernel version), df -h (disk space usage), free -h (RAM usage), top or htop (process monitor — like Task Manager). Searching: find /path -name filename, grep pattern file (search text within files). Root access: sudo command (run as superuser), su (switch to root shell). man command: display manual page for any command.
Linux File Permissions
Linux permissions use a 3x3 matrix: owner, group, and others (world), each with read (r/4), write (w/2), execute (x/1). Example: `-rwxr-xr--` = file (not directory), owner can read/write/execute, group can read/execute, others can only read. Octal notation: chmod 755 file = rwxr-xr-x (7=rwx, 5=r-x, 5=r-x). chmod: change permissions. `chmod 644 file.txt` (owner rw, group r, others r). chown: change ownership. `chown user:group file`. Common permission sets: 644 = standard file (owner rw, others r), 755 = executable/directory (owner rwx, others rx), 600 = private file (owner rw only), 700 = private directory. ls -l shows permissions in the first column. The execute bit on a directory means 'enter the directory.' Root (UID 0) bypasses all permission checks.
Package Management
Package managers automate software installation, updates, and removal. Debian/Ubuntu (APT): `sudo apt update` (refresh package list), `sudo apt upgrade` (upgrade all packages), `sudo apt install packagename`, `sudo apt remove packagename`, `sudo apt autoremove` (remove unused dependencies). Red Hat/CentOS (DNF/YUM): `sudo dnf install packagename`, `sudo dnf update`, `sudo dnf remove packagename`. Package repositories: online servers hosting software packages. Sources configured in /etc/apt/sources.list (Debian) or /etc/yum.repos.d/ (Red Hat). Snap packages: universal format from Canonical, works across distros. Flatpak: another universal package format. AppImage: self-contained executable, no installation needed.
Linux Networking
Network commands: ip addr (modern replacement for ifconfig — show IP addresses), ip route (show routing table), ping (test connectivity), traceroute (trace packet path), ss (socket statistics — modern replacement for netstat), nmap (network scanner). Configuration files: /etc/hosts (local hostname resolution), /etc/resolv.conf (DNS server configuration), /etc/network/interfaces or NetworkManager (network configuration). SSH (Secure Shell): primary remote access method for Linux. `ssh user@hostname`. SSH key authentication: generate keys with `ssh-keygen`, copy public key with `ssh-copy-id user@host`. scp: secure copy over SSH. `scp file.txt user@host:/destination`. Firewall: iptables (low-level) or ufw (Uncomplicated Firewall — Ubuntu). `sudo ufw enable`, `sudo ufw allow 22/tcp` (allow SSH).
Linux System Administration Basics
User management: `sudo useradd username` (create user), `sudo passwd username` (set password), `sudo userdel username` (delete user), `sudo usermod -aG groupname username` (add user to group). Service management (systemd-based, modern Linux): `sudo systemctl start servicename`, `sudo systemctl stop servicename`, `sudo systemctl enable servicename` (start at boot), `sudo systemctl status servicename`. Log files: /var/log/syslog or /var/log/messages (system log), /var/log/auth.log (authentication log), `journalctl -f` (follow systemd journal). Cron jobs: scheduled tasks. `crontab -e` to edit user cron jobs. Format: minute hour day month weekday command. Disk management: fdisk (partition management), mkfs (make file system), mount/umount (mount/unmount drives).