All cards206
- Which command totals the space used by a directory and its contents?
du. Adding -s prints a single total per argument and -h shows human-readable sizes.
- In /proc/mdstat, what does the status string [U_] indicate for a two-disk RAID 1 array?
Each U is an up member and each underscore is a failed or missing member, so [U_] means the array is degraded. [UU] would mean both members are healthy.
- Which command detaches a mounted filesystem from the directory tree?
umount detaches the filesystem, and it accepts either the device or the mount point as its argument. It fails with "target is busy" while any process still has files open or a working directory there.
- Name the sixth and last field of an /etc/fstab entry, which sets fsck order.
The pass field sets the order in which fsck checks filesystems at boot. The root filesystem should use 1, other filesystems to be checked use 2, and 0 skips the check.
- Writes fail with "No space left on device" even though df -h shows plenty of free blocks on the filesystem. What is the most likely cause?
Each new file needs an inode. When the inode table is full, creation fails with "No space left on device" despite free blocks; df -i confirms it with IUse% at 100%. A read-only mount gives a "Read-only file system" error instead.
- The glibc resolver reads up to six nameserver lines from /etc/resolv.conf and ignores any entries beyond that.
The glibc resolver honors at most three nameserver entries (MAXNS is 3), and it ignores any further lines. Six is wrong, though extra lines being ignored is correct. The resolver tries the servers in the order listed, moving to the next only when one fails to answer.
- To apply changes made to an existing connection profile with nmcli connection modify, the administrator runs nmcli connection ___ office to reactivate the profile.
up
- Which file extension must Netplan configuration files in /etc/netplan use to be read?
Netplan only reads files ending in .yaml from /etc/netplan, and processes them in lexical order. Files ending in .conf or .cfg are ignored.
- Which command appends /opt/bin to the end of PATH for the current shell session only?
Appending uses $PATH first, then a colon and the new directory, so existing entries are kept and searched first. Putting /opt/bin before $PATH prepends it instead, and omitting $PATH replaces the whole variable.
- Which path notation refers to the parent of the current working directory?
The .. notation points to the parent directory, so cd .. moves up one level. A single . refers to the current directory itself, not its parent.
- If neither ~/.bash_profile nor ~/.bash_login exists, a Bash login shell reads the hidden file ___ in the user's home directory.
.profile
- In the command dmesg | grep usb, the pipe operator connects the standard error of dmesg to the standard input of grep.
A pipe connects the standard output (stdout) of the left command to the standard input of the right command. Standard error is not piped by default and still goes to the terminal unless redirected with 2>&1 or |&.
- What does the sed expression 's/old/new/g' do to each input line?
It replaces every occurrence of old with new on that line. Without the g flag, only the first match on each line is replaced.
- Which history expansion re-runs the most recent command starting with "ssh"?
!ssh. The shell searches history backward for the latest command beginning with that string and runs it.
- Which tar option sets the destination directory when extracting an archive with -x?
-C changes to the given directory before extracting, as in tar -xf data.tar -C /restore. -T reads a list of file names from a file and does not set a destination.
- When rsync is run with a source path that ends in a trailing slash, such as rsync -a /data/ /backup/, it copies the data directory itself into /backup, creating /backup/data.
A trailing slash on the source makes rsync copy the contents of the directory, so files land directly in /backup. Omitting the slash (/data) is what creates /backup/data. The -a archive option does not change this behavior.
- A user-space QEMU process accesses the KVM kernel module through the ___ device file.
/dev/kvm
- Which qemu-img subcommand grows or shrinks a disk image's virtual size?
qemu-img resize, as in qemu-img resize disk.qcow2 +10G. It changes only the image, so the partition and filesystem inside the guest must be extended separately.
- What does qemu-img info --backing-chain display?
The properties of the image and of every backing file it depends on, listed in order. It shows the full overlay chain of a qcow2 image built on a base image.
- A snapshot of a VM is a complete, independent copy that remains usable if the original disk image file is deleted.
A snapshot records the VM's disk state (and optionally memory) at a point in time, and it depends on the original base image, usually through a copy-on-write chain. A full clone is the independent copy. Deleting the base image breaks the snapshot.
- Which is an advantage of virtual machines over bare metal servers?
VMs are software-defined, so they can be snapshotted, cloned and migrated easily. Lower latency, dedicated hardware and no hypervisor overhead are advantages of bare metal.
- Which graphical tool creates and manages libvirt virtual machines on a Linux desktop?
virt-manager is the GUI front end to libvirt for creating, configuring, and monitoring VMs. virt-install is command-line only, and virt-viewer only displays a guest's console.
- The initrd is loaded by the kernel after the real root filesystem is mounted, and its purpose is to provide the configuration files that the init system reads during service startup.
The initrd is loaded into memory by the bootloader before the real root filesystem is mounted. It contains the modules and tools the kernel needs to find and mount that root filesystem, such as storage or LVM drivers. Service configuration comes from the real root filesystem after the switch.
- Which FHS directory stores the kernel image, initramfs, and bootloader files?
/boot holds the kernel, initramfs, and bootloader files needed at startup. /sbin holds system administration binaries, not boot files.
- On Linux, the uname -m command reports ___ for a 64-bit Intel or AMD processor running a 64-bit kernel.
x86_64
- Because Rocky Linux is a community rebuild of Red Hat Enterprise Linux, it is classified as an ___-based distribution.
RPM
- On a Linux system, GDM and SDDM are examples of a ___ manager, which handles user authentication at the graphical login screen.
display
- The Free Software Foundation defines free software by four essential ___ to run, study, modify and share a program, regardless of price.
freedoms
- Which file does depmod regenerate so modprobe can resolve module dependencies?
depmod scans installed modules under /lib/modules/<version> and writes modules.dep (plus map files) listing each module's dependencies. /proc/modules only shows currently loaded modules and is not generated by depmod.
- Running dmesg -T prints each kernel message with a human-readable timestamp, derived from the system's boot time and the current clock.
The statement is true. The kernel ring buffer stores each message with seconds elapsed since boot, and dmesg -T (--ctime) converts that to a wall-clock date and time using the boot time and current clock. Plain dmesg shows only raw offsets such as [ 12.345678]. The conversion can drift after a suspend/resume.
- What does the nvtop command display on a Linux system?
nvtop is an interactive, top-like monitor that shows GPU load, memory use and the processes using the GPU. Network, disk and CPU frequency are covered by tools such as iftop, iotop and cpupower.
- The ___ command deletes a logical volume and returns its extents to the volume group's free space.
lvremove
- Which command scans all disks for volume groups and rebuilds the LVM cache?
vgscan searches all block devices for volume groups and rebuilds the LVM cache. vgs and vgdisplay only report on volume groups LVM already knows about.
- Which command makes LVM adjust a physical volume to the new size of its underlying enlarged disk?
pvresize updates the physical volume's metadata to match the changed size of its underlying device. pvscan only lists physical volumes, and lvresize changes logical volumes, not physical volumes.
- Which command extends partition 1 on /dev/vda to fill the available free space on the disk?
growpart (from cloud-utils) takes a disk and a partition number and expands that partition into free space. resize2fs only enlarges the ext filesystem inside a partition and does not change the partition itself.
- A disk-backed volume must hold very large files with heavy parallel I/O and may be grown online later but can never be shrunk, so it should be formatted as ___.
xfs
- Running fsck with the -n option on an ext4 filesystem checks it without making any changes, answering "no" to every repair prompt and leaving the filesystem unmodified.
The -n option opens the filesystem read-only and answers "no" to all prompts, so problems are reported but nothing is fixed. It differs from -y, which answers "yes" and applies repairs automatically.
- To insert a new disk, /dev/sdd1, into the existing array /dev/md0 as a replacement member, run mdadm /dev/md0 with the long option ___ followed by /dev/sdd1.
--add
- The noexec mount option prevents the kernel from honoring the set-user-ID and set-group-ID permission bits on files in that filesystem.
The nosuid option blocks set-user-ID and set-group-ID bits from taking effect. The noexec option instead prevents binaries on the filesystem from being executed directly. The two are often combined, but they control different behaviors.
- Every hard link to the same file points to the same ___ number on that filesystem.
inode
- Which file sets the order of sources, such as files and dns, used to resolve hostnames?
The hosts line in /etc/nsswitch.conf lists the sources in lookup order, for example "files dns". /etc/resolv.conf only defines DNS servers and search domains, not the order of sources.
- By default, netplan try waits ___ seconds for the administrator to press Enter to confirm the new configuration before it reverts to the previous one.
120
- Which ip command activates the interface eth1?
ip link set eth1 up. The ip link subcommand controls device state at layer 2, and the change does not persist across reboots.
- What does dig -x 203.0.113.10 do?
It performs a reverse DNS lookup, returning the PTR record for that IP address. dig builds the in-addr.arpa name automatically.
- Which path-tracing tool needs no root privileges and reports path MTU?
tracepath. It discovers the MTU along the route as it traces each hop, unlike traceroute.
- Which operator passes the literal string "hello" to a command's standard input as a single line of text?
The <<< operator is a here string and feeds the given word to standard input with a trailing newline. The << operator is a here doc, which expects a delimiter word and reads multiple lines, not a string.
- An alias created with the alias command at a bash prompt is saved automatically and is available in every future login session.
Aliases defined at the prompt exist only in the current shell session and disappear when it exits. To make one persistent, add it to a startup file such as ~/.bashrc, or to ~/.bash_aliases if that file is sourced from ~/.bashrc, and then reload the file with source.
- Which command searches a gzip-compressed log file for a pattern without decompressing it on disk?
zgrep runs grep on gzip-compressed data and prints matching lines without writing a decompressed file. zcat only prints the whole decompressed content and does not filter it, and zless pages through the content interactively.
- In libvirt, a VM in the paused state remains in host memory but its virtual CPUs are not scheduled, whereas a VM in the shut off state has no running QEMU process.
A paused (suspended) libvirt domain keeps its memory allocated on the host while its vCPUs stop receiving execution time. A shut off domain is defined but has no running QEMU process. Confusing paused with shut off is tempting, but only shut off releases the VM's resources.
- What is the main benefit of deploying new VMs from a baseline template?
A baseline template is a preconfigured golden image, so each new VM starts with the same OS, packages, and settings. Snapshots provide point-in-time rollback, not standardized deployment.