🌍 DevOps · subject

DevOps Linux Basics Syllabus

The Linux Basics syllabus for DevOps in full: 9 chapters, 19 topics and 50 sub-topics, every one listed below, plus 51 Linux Basics flashcards with answers.

9Chapters
19Topics
50Sub-topics
51Flashcards

Linux Basics syllabus: all 9 chapters

Expand any chapter to see its topics and sub-topics.

  1. File System

    3 topics
    • Directory structure
    • File types
    • File permissions
  2. Commands

    2 topics
    • Basic commands
      • ls
      • cd
      • cp
      • mv
      • rm
      • mkdir
      • rmdir
    • Advanced commands
      • find
      • grep
      • awk
      • sed
  3. Text Editors

    2 topics
    • vi, vim
    • nano
  4. Processes

    2 topics
    • Listing processes
      • ps
      • top
    • Managing processes
      • kill
      • bg
      • fg
  5. Users and Groups

    3 topics
    • Managing users
      • useradd
      • usermod
      • userdel
    • Managing groups
      • groupadd
      • groupmod
      • groupdel
    • Permissions
      • chmod
      • chown
  6. Package Management

    2 topics
    • Debian-based
      • apt-get
      • dpkg
    • Red Hat-based
      • yum
      • rpm
  7. System Monitoring

    1 topic
    • Tools
      • top
      • htop
      • iostat
      • vmstat
      • netstat
  8. Shell Scripting

    2 topics
    • Shell Basics
      • Writing basic scripts
      • Using variables
      • Control structures: if statements, loops
    • Advanced Scripting
      • Functions
      • Error handling
      • Command-line arguments
      • Input/output redirection
  9. Networking in Linux

    2 topics
    • Networking Commands
      • ifconfig
      • ip
      • ping
      • netstat
      • ss
      • traceroute
      • nslookup
    • Network Configuration
      • Configuring network interfaces
      • Setting up static IP addresses
      • Configuring DNS

DevOps Linux Basics flashcards — 51 questions with answers

  1. In the Linux Filesystem Hierarchy Standard (FHS), what is the purpose of the root directory `/`?

    It is the top-level directory of the entire filesystem tree; every other file and directory descends from it. There is exactly one root, and absolute paths begin with `/`.

  2. What is stored in `/bin` and `/sbin` versus `/usr/bin` and `/usr/sbin`?

    `/bin` holds essential user command binaries and `/sbin` holds essential system/administration binaries needed for booting and single-user mode. `/usr/bin` and `/usr/sbin` hold non-essential user and system binaries. On modern distros `/bin` and `/sbin` are usually symlinks into `/usr`.

  3. What is the difference between `/etc`, `/var`, and `/tmp` in the Linux directory structure?

    `/etc` stores system-wide configuration files (static). `/var` stores variable data that changes during operation (logs, mail, spool, caches). `/tmp` stores temporary files, often cleared on reboot.

  4. What does `/proc` represent in Linux?

    `/proc` is a virtual (pseudo) filesystem exposing kernel and process information as files. For example, `/proc/cpuinfo`, `/proc/meminfo`, and `/proc/<pid>/` directories for each running process. It exists in memory, not on disk.

  5. What is the purpose of `/home`, `/root`, and `/boot`?

    `/home` contains regular users' personal directories. `/root` is the home directory of the root (superuser) account. `/boot` contains static files needed to boot the system, including the kernel (`vmlinuz`) and bootloader (GRUB) files.

  6. List the seven Linux file types and the character `ls -l` uses to denote each.

    Regular file `-`, directory `d`, symbolic link `l`, character device `c`, block device `b`, named pipe (FIFO) `p`, and socket `s`.

  7. What is the difference between a hard link and a symbolic (soft) link in Linux?

    A hard link is an additional directory entry pointing to the same inode; it shares the inode and breaks only when all links are removed, and cannot cross filesystems or link directories. A symbolic link is a separate file containing a path to the target; it can cross filesystems and link directories but breaks if the target is deleted (dangling link).

  8. In Linux file permissions, what numeric values are assigned to read, write, and execute?

    Read $r = 4$, write $w = 2$, and execute $x = 1$. Permissions for each class are summed, so e.g. $rwx = 4+2+1 = 7$ and $r{-}x = 4+1 = 5$.

  9. Decode the octal permission `755`: what access does each class (owner, group, other) have?

    Owner has $7 = rwx$ (read, write, execute); group has $5 = r{-}x$ (read, execute); other has $5 = r{-}x$ (read, execute). Common for executable scripts and directories.

  10. What three permission classes does every Linux file have, and in what order does `ls -l` show them?

    Owner (user, `u`), group (`g`), and other/everyone else (`o`). `ls -l` shows them left to right after the file-type character: owner triplet, group triplet, other triplet (e.g. `-rwxr-xr--`).

  11. How do `chmod` symbolic mode operators `+`, `-`, and `=` differ?

    `+` adds the specified permissions, `-` removes them, and `=` sets exactly those permissions (clearing the others). Example: `chmod u+x file` adds execute for the owner; `chmod go= file` removes all permissions for group and other.

  12. What does the `umask` value do, and what default permissions result from a umask of `022`?

    `umask` defines permission bits to remove from the default. Files default to $666$ and directories to $777$. With umask $022$: files become $666 - 022 = 644$ (`rw-r--r--`) and directories become $777 - 022 = 755$ (`rwxr-xr-x`).

  13. What are the three special permission bits in Linux and their octal values?

    setuid ($4000$): a program runs with the file owner's privileges. setgid ($2000$): a program runs with the group's privileges, or new files in a directory inherit its group. Sticky bit ($1000$): in a shared directory, only a file's owner (or root) can delete it (e.g. `/tmp`).

  14. What command changes a file's owner and group, and what is the syntax to set both at once?

    `chown`. Syntax: `chown user:group file`. To change only the group you can use `chown :group file` or the dedicated `chgrp group file`. Add `-R` for recursive on directories.

  15. Name the basic Linux commands to list directory contents, print the working directory, and change directory.

    `ls` lists directory contents, `pwd` prints the current working directory's absolute path, and `cd` changes the current directory.

  16. What do the commands `cp`, `mv`, and `rm` do, and which flag makes them recursive?

    `cp` copies files/directories, `mv` moves or renames, and `rm` deletes. The `-r` (or `-R`) flag makes `cp` and `rm` operate recursively on directories; `mv` handles directories without a recursive flag.

  17. What is the difference between `cat`, `less`, `head`, and `tail`?

    `cat` concatenates and prints whole files. `less` is a pager for scrolling through output interactively. `head` shows the first lines (default 10), and `tail` shows the last lines (default 10); `tail -f` follows a file as it grows.

  18. What does `grep` do, and what do the flags `-i`, `-r`, and `-v` mean?

    `grep` searches input for lines matching a pattern (regular expression). `-i` makes the match case-insensitive, `-r` searches recursively through directories, and `-v` inverts the match (shows non-matching lines).

  19. Compare the advanced text-processing tools `find`, `sed`, and `awk`.

    `find` searches the filesystem for files matching criteria (name, type, size, time) and can act on them. `sed` is a stream editor for find-and-replace and line transformations. `awk` is a pattern-scanning and field-processing language ideal for columnar/structured text.

  20. What do `tar`, `gzip`, and the combined `tar -czf` command do?

    `tar` bundles many files into a single archive (tarball). `gzip` compresses a single file. `tar -czf archive.tar.gz dir/` creates (`c`) a gzip-compressed (`z`) archive into a named file (`f`); extract with `tar -xzf`.

Show the other 31 Linux Basics flashcards
  1. In the vi/vim editor, what are the three main modes and how do you switch between them?

    Normal (command) mode for navigation/commands, Insert mode for typing text, and Visual mode for selecting text. Press `i`/`a`/`o` to enter Insert mode, `v`/`V`/`Ctrl+v` for Visual mode, and `Esc` to return to Normal mode.

  2. In vim's Normal mode, how do you save and quit, quit without saving, and force-quit?

    `:w` saves (write), `:q` quits, `:wq` or `ZZ` saves and quits, `:q!` quits discarding changes, and `:x` saves only if changes were made.

  3. What is the difference between vi and vim?

    `vi` is the original POSIX visual editor. `vim` (Vi IMproved) is a backward-compatible enhanced version adding syntax highlighting, multi-level undo, split windows, plugins, visual mode, and much more. On many systems `vi` is a symlink to `vim`.

  4. In the nano editor, what do the `^` and `M-` notations in the help bar mean, and how do you save and exit?

    `^` means the Ctrl key and `M-` means the Meta (usually Alt) key. Save (write out) with `Ctrl+O`, exit with `Ctrl+X`, and search with `Ctrl+W`.

  5. Why is nano often preferred over vi/vim for beginners?

    nano is a modeless editor (no separate command/insert modes) that displays the most common keyboard shortcuts at the bottom of the screen, so you can type and edit immediately without learning special commands.

  6. What is the difference between the `ps`, `top`, and `htop` commands for listing processes?

    `ps` gives a static snapshot of processes (e.g. `ps aux` for all). `top` shows a continuously updating real-time view of processes sorted by resource use. `htop` is an enhanced, colorized, interactive version of `top` with scrolling and tree view.

  7. What does `ps aux` show, and what do the `a`, `u`, and `x` options mean?

    It lists all running processes with details. `a` shows processes of all users, `u` shows the user-oriented format (owner, %CPU, %MEM), and `x` includes processes not attached to a terminal (daemons).

  8. In Linux process management, what is a PID and a PPID?

    PID is the Process ID, a unique number identifying a running process. PPID is the Parent Process ID, the PID of the process that spawned it. Process `init`/`systemd` has PID 1 and is the ancestor of all processes.

  9. How do you send a signal to a process by PID, and what is the difference between `kill`, `kill -9`, and `killall`?

    `kill <PID>` sends the default SIGTERM (15) requesting graceful termination. `kill -9 <PID>` sends SIGKILL, an unconditional immediate kill that cannot be caught or ignored. `killall <name>` kills all processes matching a name.

  10. What is the difference between a foreground and background process, and how do you manage them with `&`, `bg`, `fg`, and `jobs`?

    A foreground process occupies the terminal until it finishes; a background process runs while you keep using the shell. Append `&` to start in background, press `Ctrl+Z` to suspend, `bg` to resume in background, `fg` to bring to foreground, and `jobs` to list background jobs.

  11. What is the difference between the signals SIGTERM, SIGKILL, SIGHUP, and SIGSTOP?

    SIGTERM (15) politely asks a process to terminate (can be handled). SIGKILL (9) forcibly kills it and cannot be caught. SIGHUP (1) signals terminal hangup, often used to make daemons reload config. SIGSTOP (19) suspends/pauses a process and cannot be caught.

  12. What is the difference between `nice` and `renice` in process scheduling?

    `nice` launches a new process with a specified scheduling priority (niceness). `renice` changes the priority of an already-running process. Niceness ranges from $-20$ (highest priority) to $+19$ (lowest); only root can assign negative values.

  13. What commands are used to add, modify, and delete a Linux user account?

    `useradd` (or `adduser`) creates a user, `usermod` modifies an existing user (e.g. shell, home, groups), and `userdel` deletes a user (`userdel -r` also removes the home directory).

  14. What files store Linux user account and password information, and what is in each?

    `/etc/passwd` stores account info (username, UID, GID, home directory, login shell). `/etc/shadow` stores the hashed passwords and password-aging info, readable only by root. `/etc/group` stores group definitions and memberships.

  15. Decode a typical `/etc/passwd` line `alice:x:1001:1001:Alice:/home/alice:/bin/bash`.

    Fields are colon-separated: username `alice`, password placeholder `x` (hash is in `/etc/shadow`), UID `1001`, primary GID `1001`, GECOS/comment `Alice`, home directory `/home/alice`, and login shell `/bin/bash`.

  16. What is the difference between a user's primary group and supplementary (secondary) groups?

    The primary group is set by the GID field in `/etc/passwd` and is assigned by default to files the user creates. Supplementary groups are additional group memberships (listed in `/etc/group`) granting extra access. View them with `id` or `groups`.

  17. What commands create, modify, and delete groups, and how do you add a user to a group?

    `groupadd` creates a group, `groupmod` modifies it, and `groupdel` deletes it. Add a user to a supplementary group with `usermod -aG groupname username` (the `-a` is essential to append rather than replace existing groups), or `gpasswd -a user group`.

  18. What is the difference between `su`, `su -`, and `sudo`?

    `su` switches to another user (default root) keeping much of the current environment; `su -` starts a full login shell with the target user's environment. `sudo` runs a single command with elevated (usually root) privileges as configured in `/etc/sudoers`, using your own password.

  19. How do package management commands differ between Debian-based and Red Hat-based distributions?

    Debian-based (Ubuntu, Debian) use `.deb` packages managed by `dpkg` and the high-level `apt`/`apt-get`. Red Hat-based (RHEL, CentOS, Fedora) use `.rpm` packages managed by `rpm` and the high-level `dnf`/`yum`.

  20. Give the equivalent install/update/remove commands in apt versus dnf/yum.

    Install: `apt install pkg` vs `dnf install pkg`. Update package lists/upgrade: `apt update && apt upgrade` vs `dnf upgrade` (dnf refreshes metadata automatically). Remove: `apt remove pkg` vs `dnf remove pkg`.

  21. Name two Debian-based and two Red Hat-based Linux distributions.

    Debian-based: Debian, Ubuntu (also Linux Mint, Kali). Red Hat-based: Red Hat Enterprise Linux (RHEL), CentOS/Rocky/AlmaLinux, and Fedora.

  22. What essential system-monitoring tools report disk usage and free memory in Linux?

    `df` reports filesystem disk space usage (`df -h` for human-readable), `du` reports directory/file disk usage, and `free` reports memory and swap usage (`free -h`). `lsblk` lists block devices.

  23. What is a shell, and what are the differences among `sh`, `bash`, and `zsh`?

    A shell is a command interpreter between the user and the kernel. `sh` is the POSIX Bourne shell (minimal, portable). `bash` (Bourne Again Shell) is the common Linux default with history, completion, and scripting features. `zsh` adds advanced completion, globbing, and theming (default on macOS).

  24. What is the purpose of a shebang line like `#!/bin/bash` at the top of a script?

    The shebang (`#!`) tells the kernel which interpreter to use to execute the script. `#!/bin/bash` runs the script with bash; `#!/usr/bin/env python3` finds python3 via PATH. It must be the very first line of the file.

  25. In bash, what is the difference between single quotes `'...'`, double quotes `"..."`, and backticks/`$()`?

    Single quotes preserve everything literally (no variable or command expansion). Double quotes allow variable (`$var`) and command substitution but suppress globbing/word-splitting. Backticks `` `cmd` `` and `$(cmd)` perform command substitution, replacing themselves with the command's output (`$()` is preferred and nestable).

  26. What do the special bash variables `$?`, `$0`, `$#`, `$@`, and `$$` represent?

    `$?` is the exit status of the last command (0 = success). `$0` is the script name. `$#` is the number of positional arguments. `$@` is all arguments (as separate words when quoted). `$$` is the PID of the current shell.

  27. Write the bash syntax for an if/elif/else conditional and explain the test operators `-eq`, `-z`, and `-f`.

    `if [ cond ]; then ...; elif [ cond ]; then ...; else ...; fi`. `-eq` tests numeric equality, `-z` tests whether a string is empty (zero length), and `-f` tests whether a regular file exists.

  28. In bash scripting, what are the differences between standard input, output, and error redirection: `>`, `>>`, `2>`, and `|`?

    `>` redirects stdout to a file (overwrite), `>>` appends stdout to a file, `2>` redirects stderr to a file, and `|` (pipe) sends one command's stdout into the next command's stdin. `&>` or `2>&1` combines stdout and stderr.

  29. What does `set -euo pipefail` do at the top of a bash script?

    It enables safer scripting: `-e` exits immediately on any command failure, `-u` treats unset variables as errors, and `-o pipefail` makes a pipeline fail if any command in it fails (not just the last). Together they catch errors early.

  30. What networking commands are used to check connectivity, trace a route, and inspect interfaces?

    `ping` tests reachability and round-trip time via ICMP. `traceroute` (or `tracepath`) shows the hops a packet takes to a destination. `ip addr` (modern) or `ifconfig` (legacy) displays and configures network interfaces and IP addresses.

  31. Compare the networking commands `netstat`/`ss`, `curl`/`wget`, and `dig`/`nslookup`.

    `netstat` and its modern replacement `ss` show network connections, listening ports, and sockets. `curl` and `wget` transfer data over HTTP/FTP (curl prints to stdout, wget downloads to files). `dig` and `nslookup` perform DNS lookups to resolve hostnames to IP addresses.

DevOps Linux Basics FAQ

What is in the DevOps Linux Basics syllabus?

DevOps Linux Basics is split into 9 chapters: File System, Commands, Text Editors, Processes, Users and Groups, Package Management, System Monitoring, Shell Scripting and Networking in Linux. Together they contain 19 topics and 50 sub-topics.

How many chapters are in DevOps Linux Basics?

9 chapters, containing 19 topics and 50 sub-topics. The largest chapter is File System, with 3 topics.

Are there flashcards for DevOps Linux Basics?

Yes — a 51-card Linux Basics deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.