🌍 DevOps · flashcards
DevOps Linux Basics Flashcards
51 question-and-answer cards covering Linux Basics as it is examined in DevOps. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Linux Basics deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
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.
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.
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.
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.
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.
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).
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.
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`.
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`.
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`.
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.
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`.
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`.
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.
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.
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).
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.
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).
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.
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.
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.
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.
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.
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.
What this deck covers
The Linux Basics deck follows the DevOps Linux Basics syllabus — 9 chapters and 19 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 5.7 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 233 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Linux Basics flashcards FAQ
How many Linux Basics flashcards are in this DevOps deck?
51 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these DevOps flashcards free?
Yes. The preview here is free to read with no signup, and the full 51-card deck is free inside the Examius app.
What do the Linux Basics cards cover?
They follow the DevOps Linux Basics syllabus — 9 chapters and 19 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.