First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Operations Deployment
Which command changes the current systemd target to graphical.target immediately, without altering the default target?
- systemctl isolate graphical.target Correct answer.
- systemctl set-default graphical.target
- systemctl start graphical.target
- systemctl enable graphical.target
Explanation
isolate starts the requested target and stops units that are not required by it, affecting only the current runtime state. The default target is changed by set-default, which creates a symlink for future boots.
Question 2Operations Deployment
After editing a systemd unit file, which command makes systemd reread unit configuration without restarting the service?
- systemctl reenable myapp.service
- systemctl restart myapp.service
- systemctl reload myapp.service
- systemctl daemon-reload Correct answer.
Explanation
systemd caches unit files, so daemon-reload must be run after modifying a unit file to load the new configuration. reload asks the running service itself to reload its own configuration and does not reread the unit file.
Question 3Operations Deployment
Which command displays log messages from the previous system boot when using the systemd journal?
- journalctl -b -1 Correct answer.
- journalctl -b 0
- journalctl --since=yesterday
- journalctl --list-boots
Explanation
The -b option selects a boot by offset, with 0 meaning the current boot and -1 meaning the boot before it. --list-boots only lists boot identifiers, and --since filters by time rather than by boot.
Question 4Operations Deployment
In a systemd timer unit, which section contains the OnCalendar= schedule setting?
- [Service]
- [Timer] Correct answer.
- [Install]
- [Unit]
Explanation
Timer-specific settings such as OnCalendar= and OnBootSec= belong in the [Timer] section. The [Service] section describes the service unit, and [Install] controls enablement.
Question 5Operations Deployment
Which command loads a kernel module by name while resolving dependency modules from module metadata?
- lsmod
- depmod
- insmod
- modprobe Correct answer.
Explanation
modprobe consults the module dependency database and loads any required modules before loading the requested one. insmod loads a module file directly but does not resolve dependencies.
Question 6Operations Deployment
Where should a module name be placed so systemd loads it automatically at boot on a modern Linux system?
- /etc/modprobe.d/blacklist.conf
- /etc/sysctl.d/modules.conf
- /etc/modules-load.d/custom.conf Correct answer.
- /etc/udev/rules.d/99-modules.rules
Explanation
Files in /etc/modules-load.d/ with a .conf suffix list module names to be loaded at boot by systemd-modules-load.service. The modprobe.d directory is for module options and blacklists, not for boot-time loading lists.
Question 7Operations Deployment
Which file location persistently applies a custom kernel parameter through the sysctl mechanism?
- /etc/sysconfig/sysctl
- /etc/sysctl.conf.local
- /proc/sys/net/ipv4/ip_forward
- /etc/sysctl.d/99.conf Correct answer.
Explanation
Drop-in files under /etc/sysctl.d/ ending in .conf are read by systemd-sysctl at boot and by sysctl --system. Writing directly under /proc changes only the running kernel and is lost on reboot.
Question 8Operations Deployment
Which command regenerates the GRUB configuration on a Debian-based system using the distribution wrapper script?
- update-grub Correct answer.
- mkinitcpio -P
- update-initramfs -u
- grub-install /dev/sda
Explanation
update-grub is a Debian wrapper that runs grub-mkconfig to rebuild the GRUB configuration from the scripts in /etc/grub.d/. grub-install writes boot loader code to a device but does not rebuild the menu configuration.
Question 9Operations Deployment
What does the command apt update do on a Debian-based system?
- removes unused dependencies
- upgrades installed packages
- lists installed packages
- refreshes package index Correct answer.
Explanation
apt update downloads repository metadata so the package manager knows the available versions. It does not install or upgrade packages; that is done by apt upgrade or apt install.
Question 10Operations Deployment
On a Fedora system, which dnf command identifies the package that supplies the file /usr/bin/vi?
- dnf repoquery --installed /usr/bin/vi
- dnf provides /usr/bin/vi Correct answer.
- dnf search /usr/bin/vi
- dnf info /usr/bin/vi
Explanation
dnf provides queries file-provides metadata to determine which package owns or supplies a path. dnf search matches package names and summaries rather than file paths.
Question 11Operations Deployment
Which directory holds repository definition files on RHEL and Fedora systems?
- /etc/yum.repos.d Correct answer.
- /etc/apt/sources.list.d
- /var/lib/rpm/repos
- /etc/dnf/repositories.conf
Explanation
Repository configuration files with a .repo suffix are stored in /etc/yum.repos.d/ and are read by dnf and yum. APT-style repository entries live under /etc/apt/ on Debian-based systems.
Question 12Operations Deployment
Which command creates a user named alice with a home directory and /bin/bash as the login shell?
- useradd -M -s /sbin/nologin alice
- useradd alice
- useradd -r alice
- useradd -m -s /bin/bash alice Correct answer.
Explanation
The -m option creates the home directory, and -s sets the login shell. Without -m, useradd behavior depends on the distribution defaults and may not create a home directory.
Question 13Operations Deployment
Which command forces alice to change her password at the next login?
- chage -d 0 alice Correct answer.
- chage -M 0 alice
- passwd -l alice
- usermod --lock alice
Explanation
chage -d 0 sets the date of the last password change to the epoch, which makes the password expired and requires a change at login. Locking the account or setting maximum age to zero does not produce that prompt.
Question 14Operations Deployment
Which command safely edits /etc/sudoers and checks its syntax before saving?
- chmod 440 /etc/sudoers
- sudoedit /etc/sudoers.d
- visudo Correct answer.
- nano /etc/sudoers
Explanation
visudo locks the sudoers file and validates syntax before installing the edited version, preventing a broken sudo configuration. Direct editing risks leaving a syntax error that blocks sudo access.
Question 15Operations Deployment
Which permission pair is required for a user's ~/.ssh directory and ~/.ssh/authorized_keys for key-based SSH login to work correctly?
- 750 and 640
- 700 and 600 Correct answer.
- 755 and 644
- 700 and 644
Explanation
SSH refuses to use keys when the ~/.ssh directory or authorized_keys is group- or world-writable. The usual secure values are 700 for the directory and 600 for the file.
Question 16Operations Deployment
What schedule does the cron expression */15 2 * * 1-5 define?
- every 15 min in hour 2, Mon-Fri Correct answer.
- at 02:15 every day
- every 15 minutes every day around the clock
- every 15 hours on weekdays
Explanation
The minute field */15 means every 15 minutes, the hour field 2 limits execution to the 02:00 hour, and 1-5 limits the day of week to Monday through Friday. This yields runs at 02:00, 02:15, 02:30, and 02:45 on weekdays.
Question 17Operations Deployment
Which command tests logrotate configuration and reports what it would do without modifying logs?
- logrotate -f /etc/logrotate.conf
- logrotate -d /etc/logrotate.conf Correct answer.
- logrotate --force /etc/logrotate.conf
- logrotate -m /etc/logrotate.conf
Explanation
The -d option enables debug mode, which prints the actions logrotate would take without performing rotations. The -f option forces rotation and therefore modifies log files.
Question 18Operations Deployment
Which command adds the address 192.168.1.10/24 to interface eth0?
- ip link set eth0 192.168.1.10/24
- ip route add 192.168.1.10/24 dev eth0
- ip addr set eth0 192.168.1.10/24
- ip addr add 192.168.1.10/24 dev eth0 Correct answer.
Explanation
Addresses are managed with the ip addr object, using add followed by the address and dev interface. The ip route command manages routes, and ip link controls interface state and attributes.
Question 19Operations Deployment
Which command activates the existing NetworkManager connection profile named office?
- nmcli networking on
- nmcli con up office Correct answer.
- nmcli device connect eth0
- nmcli con add type ethernet
Explanation
nmcli connection up activates a saved connection profile by name. nmcli device connect connects a device and may create a profile, but it does not select the named existing profile.
Question 20Operations Deployment
Which command adds a default route through the gateway 10.0.0.1?
- ip route add 10.0.0.1 default
- ip addr add default via 10.0.0.1
- ip route add default via 10.0.0.1 Correct answer.
- ip route add default dev 10.0.0.1 metric 100
Explanation
A default route is added with ip route add default followed by via and the next-hop gateway address. The dev keyword expects an interface name, not an IP address.
Question 21Operations Deployment
Which /etc/fstab line mounts /dev/sdb1 at /data as ext4 with default options and an fsck pass number of 2?
- /dev/sdb1 /data ext4 defaults 0 2 Correct answer.
- /dev/sdb1 /data ext4 defaults 1 1
- /dev/sdb1 /data ext4 noauto 0 0
- /dev/sdb1 /data ext4 defaults,nofail 0 2
Explanation
The fstab fields are device, mount point, filesystem type, options, dump, and fsck pass. The value 0 in the dump field and 2 in the pass field matches the requested non-root filesystem behavior.
Question 22Operations Deployment
A swap file has already been created and initialized with mkswap. Which command activates it immediately?
- mount -a /swapfile
- sysctl vm.swappiness=10
- swapoff /swapfile
- swapon /swapfile Correct answer.
Explanation
swapon activates a prepared swap area or swap file for the running kernel. mkswap only writes the swap signature, so swapon is needed before the kernel can use the file.
Question 23Operations Deployment
Which command extends logical volume vg/data by 5 GiB and resizes the filesystem in the same step?
- lvextend -L +5G vg/data
- lvextend -r -L +5G vg/data Correct answer.
- resize2fs vg/data 5G
- vgextend -L +5G vg/data
Explanation
lvextend -r resizes the logical volume and then invokes the appropriate filesystem resize tool. Without -r, the volume grows but the filesystem inside it remains at its old size.
Question 24Operations Deployment
Which kernel command-line parameter boots the system into the rescue target for maintenance?
- single.target=yes
- systemd.unit=rescue.target Correct answer.
- rescue.mode=1
- systemd.default=rescue.target
Explanation
systemd.unit= specifies the unit systemd starts as the initial target, so systemd.unit=rescue.target selects rescue mode. rescue.target starts a minimal environment with basic services and a root shell.
Question 25Operations Deployment
Which command sets the system's static hostname to web01 using systemd tools?
- hostnamectl hostname web01
- nmcli general hostname web01 --permanent
- hostnamectl set-hostname web01 Correct answer.
- hostname web01
Explanation
hostnamectl set-hostname updates the static hostname managed by systemd and writes it persistently. The hostname command changes only the transient hostname for the current session.
Question 26Operations Deployment
Which command configures the nginx service to start automatically each time the system boots?
- systemctl stop nginx
- systemctl start nginx
- systemctl daemon-reload
- systemctl enable nginx Correct answer.
Explanation
Enabling a unit creates the dependency symlinks under the target's .wants directory so the service is pulled in during boot. Starting a unit only affects the current running system and leaves no boot-time linkage.
Question 27Operations Deployment
Which journalctl invocation displays only the log entries recorded since the machine was last booted?
- journalctl -f
- journalctl -xe
- journalctl --disk-usage
- journalctl -b Correct answer.
Explanation
The -b switch filters the journal to the current boot, and it can be combined with an offset such as -b -1 to reach an earlier boot. Without it, journalctl shows entries from all retained boots.
Question 28Operations Deployment
Which command reports the systemd target that the system will boot into by default?
- systemctl list-units --type=target
- systemctl get-default Correct answer.
- systemctl isolate multi-user.target
- systemctl status default.target
Explanation
The get-default subcommand reads and prints the default.target alias, which determines the boot target. Use set-default to change it and isolate to switch immediately at runtime.
Question 29Operations Deployment
Which command reports used and available space for every mounted filesystem in human-readable units?
- free -h
- df -h Correct answer.
- du -sh
- lsblk -f
Explanation
df reports per-filesystem capacity, usage and availability, and -h scales the numbers into KiB/MiB/GiB. du instead measures the space consumed by directory trees.
Question 30Operations Deployment
On a Debian-based system with repositories already configured, which command installs the nginx package?
- apt remove nginx
- apt search nginx
- apt install nginx Correct answer.
- apt reinstall nginx
Explanation
The install verb resolves the package from the configured repositories, downloads it and applies it through dpkg. It also pulls in declared dependencies.
Question 31Operations Deployment
Which command stops the nginx unit and then starts it again in a single operation?
- systemctl try-restart nginx
- systemctl reload nginx
- systemctl reset-failed nginx
- systemctl restart nginx Correct answer.
Explanation
restart performs a full stop followed by a start, so the service process is replaced and downtime is brief but real. A reload, by contrast, asks the running process to re-read its configuration without terminating it.
Question 32Operations Deployment
Which command adds the existing user alice to the supplementary group wheel while preserving her current group memberships?
- deluser alice wheel
- groupadd wheel alice
- usermod --groups wheel alice
- usermod -aG wheel alice Correct answer.
Explanation
The -a flag appends the listed groups to the user's existing supplementary set, while -G names the supplementary group list. Omitting -a makes -G replace the entire supplementary list.
Question 33Operations Deployment
Which command opens the current user's crontab in the default editor for modification?
- crontab -l
- cat /etc/crontab
- crontab -e Correct answer.
- crontab -r
Explanation
crontab -e copies the user's crontab into an editor and installs it back after syntax checking when the editor exits. The system-wide /etc/crontab is not the place for individual user jobs.
Question 34Operations Deployment
Which command makes the cups unit impossible to start, either directly or as a dependency of another unit?
- systemctl stop cups
- systemctl mask cups Correct answer.
- systemctl freeze cups
- systemctl disable cups
Explanation
Masking replaces the unit with a symlink to /dev/null, so any attempt to start it fails until it is unmasked. Disabling only removes the automatic start links and still permits manual starts.
Question 35Operations Deployment
Which journalctl option restricts output to messages logged at priority err and above?
- journalctl -o err
- journalctl -n err
- journalctl -p err Correct answer.
- journalctl -t err
Explanation
The -p option filters by syslog priority, and specifying a level such as err includes that level and everything more severe. Priorities range from emerg down to debug.
Question 36Operations Deployment
After editing a unit file under /etc/systemd/system, which command makes systemd aware of the changed contents before the service is restarted?
- systemctl reload-or-restart nginx
- systemctl reload nginx
- systemctl daemon-reload Correct answer.
- systemctl restart nginx
Explanation
systemd caches unit definitions, so editing a unit file requires a manager re-scan before the new definition takes effect. daemon-reload performs that re-scan and also re-evaluates dependencies.
Question 37Operations Deployment
Which command changes the system time zone to Europe/Berlin in a way that persists across reboots?
- timedatectl list-timezones Europe/Berlin
- date --set Europe/Berlin
- timedatectl set-timezone Europe/Berlin Correct answer.
- timedatectl set-time Europe/Berlin
Explanation
set-timezone updates /etc/localtime and the systemd configuration so the change survives reboots. Using date to adjust time affects only the running clock reading.
Question 38Operations Deployment
Which command lists listening TCP and UDP sockets together with the process that owns each socket?
- netstat -i
- ip link show
- ethtool -S eth0
- ss -tulpn Correct answer.
Explanation
ss -tulpn combines the TCP (-t), UDP (-u), listening (-l), process (-p) and numeric (-n) selections. The -p flag requires sufficient privilege to see processes owned by other users.
Question 39Operations Deployment
Which command removes the nginx package together with its configuration files on a Debian-based system?
- apt remove nginx
- apt purge nginx Correct answer.
- apt clean nginx
- apt autoremove nginx
Explanation
The purge verb removes the package and also deletes its conffiles, so configuration is not retained. The plain remove verb leaves marked configuration files behind on disk.
Question 40Operations Deployment
Which command lists every package currently installed according to the RPM database?
- rpm -qa Correct answer.
- rpm -ql
- rpm -qf
- rpm -qi
Explanation
The query mode -q combined with the all selector -a enumerates the whole installed package set. The other single-letter modifiers refine a query against a package that must still be named.
Question 41Operations Deployment
Which command prints the UUID and filesystem type of each block device on the system?
- blkid Correct answer.
- free -m
- lsblk -d
- mount -l
Explanation
blkid probes block devices and reports attributes such as UUID, label and filesystem type, which is what you copy into /etc/fstab. lsblk -d only shows the devices without probing them for attributes.
Question 42Operations Deployment
Which command mounts all filesystems listed in /etc/fstab that are not already mounted?
- mount -t auto
- mount --bind
- mount -a Correct answer.
- mount -r
Explanation
mount -a walks /etc/fstab and mounts every entry whose filesystem is not currently mounted. It is the standard way to validate a newly edited fstab without rebooting.
Question 43Operations Deployment
Which command rotates logs immediately, ignoring whether the configured time or size thresholds have been reached?
- logrotate -f /etc/logrotate.conf Correct answer.
- logrotate -s /etc/logrotate.conf
- logrotate -l /etc/logrotate.conf
- logrotate -d /etc/logrotate.conf
Explanation
The -f switch forces rotation even when the criteria in the configuration have not been met, which is useful for testing or clearing a log file. The -d switch is the dry-run mode that only reports what would happen.
Question 44Operations Deployment
Which directive in /etc/ssh/sshd_config stops the SSH server from accepting password-based logins?
- PubkeyAuthentication yes
- UsePAM no
- PermitRootLogin no
- PasswordAuthentication no Correct answer.
Explanation
PasswordAuthentication controls whether the server offers the password authentication method at all. Setting it to no forces clients to use another method such as public keys.
Question 45Operations Deployment
Which command lists only those units that have entered a failed state?
- systemctl show --all
- systemctl list-sockets
- systemctl --failed Correct answer.
- systemctl list-jobs
Explanation
The --failed switch filters the unit listing to those whose result is failed, giving a quick view of broken services. Failed units can be retried or cleared with reset-failed after the cause is fixed.
Question 46Operations Deployment
Which command prints the full text of a unit as systemd sees it, including any drop-in override files?
- systemctl list-dependencies nginx
- systemctl cat nginx Correct answer.
- systemctl status nginx
- systemctl show nginx
Explanation
cat concatenates the vendor unit file and every drop-in in effect, which makes it the fastest way to confirm which file supplied a given setting. The show subcommand instead prints individual resolved properties.
Question 47Operations Deployment
Which command reduces the on-disk size of the systemd journal to at most 100 MB by deleting the oldest entries?
- journalctl --vacuum-size=100M Correct answer.
- journalctl --rotate=100M
- journalctl --flush=100M
- journalctl --sync=100M
Explanation
The --vacuum-size option removes archived journal files, oldest first, until the journal directory is at or below the given size. A persistent cap can also be set with SystemMaxUse in journald.conf.
Question 48Operations Deployment
Which command shows the device and mount options backing the mount point /data without requiring you to read /etc/fstab?
- findmnt /data Correct answer.
- df -i /data
- du -x /data
- fdisk -l /data
Explanation
findmnt reads the kernel mount table and prints the source, target, filesystem type and options for the matching mount point. It therefore reflects what is actually mounted, not merely what the fstab declares.
Question 49Operations Deployment
Which command lists units ordered by the time each one took to initialise during the last boot, longest first?
- systemctl list-timers
- systemd-analyze blame Correct answer.
- systemd-analyze time
- systemd-analyze verify
Explanation
blame attributes boot time to individual units and sorts them so the slowest appear at the top, which points to candidates for optimisation. The critical-chain view instead shows the dependency path that determined the total.
Question 50Operations Deployment
Which command switches SELinux into permissive mode until the next reboot?
- semanage permissive -a
- getenforce 0
- setenforce 0 Correct answer.
- selinuxenabled 0
Explanation
setenforce 0 changes the running enforcement state so denials are logged but not blocked; a value of 1 returns to enforcing. The change is runtime only, so the mode in /etc/selinux/config applies again after a reboot.