Try a few cards
All cards133
- Which ln option creates a symbolic link instead of a hard link?
ln -s creates a symbolic link, as in ln -s target linkname. Without -s, ln creates a hard link that shares the target's inode.
- Which character appears first in an ls -l listing for a block device file such as /dev/sda?
The letter b. Block devices transfer data in fixed-size blocks and are buffered, while character devices, shown with c, transfer data as a stream of bytes.
- Which useradd option creates the user's home directory when the account is created?
The -m (--create-home) option. Without it, useradd on many distributions does not create the home directory unless CREATE_HOME is set in /etc/login.defs.
- Which userdel option also removes the user's home directory and mail spool?
The -r option (--remove). Without it, userdel deletes the account entry but leaves the home directory and its files on disk.
- Which usermod option appends a user to supplementary groups without removing existing memberships?
The -a option, used together with -G (usermod -aG groupname username). Without -a, -G replaces the user's entire supplementary group list.
- Which usermod option locks a user account by prefixing an exclamation mark to the password hash in /etc/shadow?
usermod -L (or --lock). The matching option usermod -U (or --unlock) removes the exclamation mark and restores the original hash.
- Which chage option sets the date an account expires, in YYYY-MM-DD format?
The -E (--expiredate) option, as in chage -E 2025-12-31 username. Setting -E -1 removes the account expiration date, whereas -M controls how long a password stays valid.
- Which command shows each account's most recent login time, including accounts that have never logged in?
lastlog. It reads /var/log/lastlog and prints "**Never logged in**" for accounts with no recorded login.
- Which directory's contents are copied into a new user's home directory by useradd -m?
/etc/skel. Files placed there, such as .bashrc or .profile, become the default dotfiles for every account created afterward, and existing users are not affected.
- In an /etc/passwd entry, what does the fourth colon-separated field hold?
The primary group's GID (numeric group ID) for the user. The group name for that GID is resolved through /etc/group, and the seven fields run username:password:UID:GID:GECOS:home:shell.
- Which identifier does the kernel check when deciding whether a running process may access a file?
The EUID is used for permission checks, while the real UID records who launched the process. A setuid binary such as passwd runs with the file owner's EUID even though the real UID stays that of the caller.
- On most modern Linux distributions, which UID range is reserved for regular user accounts by default?
Regular user accounts start at UID 1000, as set by UID_MIN in /etc/login.defs. UIDs 1 to 999 are reserved for system and service accounts, and UID 0 is root.
- Which command displays running processes as a tree showing parent-child relationships?
pstree is the command that does this. It draws each process under its parent, so you can quickly see what spawned what, and with -p it adds PIDs.
- What does a process's PPID identify?
The PID of the process that created (spawned) it, its parent. Every process except PID 1 has a PPID, and you can view both with ps -ef or ps -o pid,ppid.
- Which ps STAT code marks a zombie process?
Z, a defunct process that has exited but still has an entry in the process table. It remains until its parent calls wait() to read the exit status.
- Which command changes the niceness of a process that is already running?
renice changes the niceness of a running process, for example renice -n 5 -p 1234. Only root can lower a niceness value to raise priority, while regular users can only increase it for their own processes.
- Which command displays all current shell resource limits for the logged-in user?
ulimit -a lists all soft resource limits for the current shell. ulimit -u shows only the maximum number of user processes, and sysctl -a lists kernel parameters, not per-shell limits.
- Which command schedules a job to run once at a specified future time?
The at command. It reads commands from standard input or a file (-f) and runs them once at the given time, while recurring jobs belong in crontab.
- Which dnf command enables the repository with ID "epel" persistently in its configuration?
dnf config-manager --set-enabled epel. This edits the enabled= line in the repo's .repo file under /etc/yum.repos.d/ from 0 to 1.
- Which /etc/dnf/dnf.conf directive keeps named packages from being updated by dnf?
The exclude= directive, e.g. exclude=kernel* httpd. It accepts a space- or comma-separated list of package names or globs, and can also be set per repository in its .repo file.
- Which update-alternatives option registers a new alternative for a generic command name?
The --install option registers it, taking the link, name, path, and priority as arguments. For example, update-alternatives --install /usr/bin/editor editor /usr/bin/vim 50 adds vim as a candidate for editor.
- Which command checks the syntax of /etc/ssh/sshd_config without starting or restarting the SSH daemon?
sshd -t runs test mode: it validates the configuration file and sanity-checks the host keys, then exits without starting the daemon. That catches errors before a reload locks you out. systemctl daemon-reload only reloads systemd unit files and does not validate sshd_config.
- What is a sandboxed application in Linux software management?
An application that runs isolated from the rest of the system, with restricted access to files, devices, and other processes. Snap and Flatpak package apps this way, bundling dependencies and limiting access through permissions.
- Which directive in chrony.conf defines an upstream NTP server for the system to sync with?
The server directive (for example, "server 0.pool.ntp.org iburst"). The iburst option sends a quick burst of packets at startup so the clock syncs faster.
- Which systemd unit type activates another unit at calendar times or after a set interval, serving as the systemd alternative to cron, and what suffix does its file use?
A timer unit, with the .timer suffix. It triggers a matching .service unit (same base name by default) at calendar times or after a set interval, and is the systemd alternative to cron.
- Which systemd command sets the system's time zone?
timedatectl set-timezone followed by the zone name, such as America/Chicago. Running timedatectl with no arguments shows the current time, time zone and NTP synchronization status.
- Which systemctl command prevents a unit from being started manually or by dependencies?
systemctl mask. It links the unit file to /dev/null, so even manual starts fail until you run systemctl unmask.
- Which container engine runs without a central daemon and can run containers rootless?
Podman. It launches each container as a child process of the user and uses a Docker-compatible command syntax, whereas Docker relies on the central dockerd daemon.
- Which command opens an interactive shell inside an already running container named web?
docker exec -it web /bin/bash (or /bin/sh if bash is not installed). The -i flag keeps stdin open and -t allocates a pseudo-terminal, and unlike docker run it starts no new container.
- Which Podman option mounts the named volume appdata at /var/lib/app inside a container?
Use -v appdata:/var/lib/app (or --volume) with podman run. If the named volume does not exist yet, Podman creates it automatically, and 'podman volume create appdata' can also create it beforehand.
- Which Podman or Docker option publishes container port 80 on host port 8080?
-p 8080:80 (or --publish 8080:80). The format is host_port:container_port, so traffic reaching the host on 8080 is forwarded to port 80 in the container.
- What is the main security advantage of an unprivileged container over a privileged one?
Unprivileged containers use user namespaces so root inside the container maps to an unprivileged UID on the host, limiting damage from an escape. Image scanning and traffic encryption are separate features that neither container type provides by default.
- What does a symbolic link store as its content?
A symbolic link is a small file holding the path to its target, so it breaks if the target is moved or removed. A hard link is the one that shares the target's inode.
- Which of these /dev entries is a character device rather than a block device?
/dev/tty0 is a terminal device that transfers data as a stream of characters, so it is a character device. /dev/loop0 is tempting, but it is a block device that exposes a file as a disk, like /dev/sda1 and /dev/nvme0n1.
- Which useradd option sets the new user's primary group by name or GID?
-g sets the primary group by name or GID. -G is the neighbouring option, but it only supplies a comma-separated list of supplementary groups.
- Which command deletes a group from the system?
groupdel removes a group's entry from /etc/group and /etc/gshadow. groupmod only modifies an existing group, and gpasswd manages group membership and passwords.
- Which command renames an existing group from developers to engineers?
groupmod -n sets a new name for an existing group, with the old name given last. The -g option changes the numeric GID, not the name, and usermod modifies user accounts.
- Which passwd option unlocks a user account by removing the leading exclamation mark from the password hash?
passwd -u unlocks the account by removing the leading ! from the hash in /etc/shadow. passwd -l does the opposite and locks it, while passwd -d deletes the password.
- Which chage option sets the maximum number of days a password remains valid before it must be changed?
Uppercase -M sets the maximum password age in days. The tempting lowercase -m sets the minimum days between changes, which blocks frequent changes rather than forcing expiry.
- Which command queries the system's configured name services to list user account entries, not just those in /etc/passwd?
getent passwd reads the passwd database through NSS, so it includes LDAP, SSSD and other sources as well as local files. who -a only reports current login sessions and system events.
- Which file holds system-wide environment settings that login shells read for every user?
/etc/profile is read by login shells for all users before any per-user file. ~/.bash_profile applies only to the individual user, and /etc/skel/.profile is just a template copied into new home directories.
- In /etc/shadow, what does the third colon-separated field record?
The third field of /etc/shadow is the date of the last password change, counted in days since the Unix epoch. The minimum age, maximum age and warning period are the fourth, fifth and sixth fields.
- When a user runs a program that has the setuid bit set, the process keeps the user's own UID as its real UID, but its EUID becomes that of the program's ___.
owner
- With a default UID_MIN of 1000, an account assigned UID 992 is classified as a ___ account rather than a regular user account.
system
- Running strace -p 2417 attaches to the running process with PID 2417 and records the library function calls it makes, such as those into libc, rather than its system calls.
strace records system calls, the requests a process makes to the kernel, such as open, read and write. Tracing library function calls is the job of ltrace. The -p option attaches to an existing PID, but what it traces is system calls.
- When a parent process exits while its child keeps running, the child's PPID typically becomes what?
Orphaned processes are reparented to init (PID 1, usually systemd), or to the nearest subreaper if one is set. PID 2 is kthreadd, the parent of kernel threads, not of orphaned user processes.
- Which ps STAT code marks a process in uninterruptible sleep, typically waiting on disk or network I/O?
D is uninterruptible sleep, where the process is blocked on I/O and ignores signals until the operation completes. S is interruptible sleep, where the process waits for an event but can be woken by a signal.
- Which niceness value gives a process the highest scheduling priority on Linux?
Niceness ranges from -20 (highest priority) to 19 (lowest priority). 0 is the default, and 19 is the most polite, lowest-priority value.
- The soft and hard resource limits of a running process with PID 1234 can be read from the file /proc/1234/___.
limits
- Which key combination suspends a running foreground job in the shell?
Ctrl+z suspends the foreground job and returns the prompt, leaving the job stopped. Resume it in the background with bg or in the foreground with fg.