117 questions saved for revision · 0 already mastered
find / -perm ______ 2>/dev/null lists every SUID binary on the system — a standard security audit step.
In GNU regular expressions, ______ matches a word boundary, so grep '\bcat\b' file finds cat but not concatenate.
grep ______ 3 'ERROR' app.log prints each matching line together with the three lines before and the three lines after it.
In vi/vim normal mode, what keystroke sequence deletes from the cursor up to (but not including) the NEXT literal period character?
You want one pipeline that BOTH writes dd's output to sda1.img AND feeds a copy into sha1sum to produce sda1.sha1, in a single command. Which command lets a stream "branch" like this?
Running nice ./batch.sh with no -n option does not leave the job at 0 — it starts it at niceness ______.
You started a multi-hour job inside GNU Screen over SSH, and the connection dropped. What is the situation?
Filenames containing spaces break a naive pipeline. The safe pairing is find . -name '*.log' -print0 | xargs ______ gzip.
To capture normal output *and* error output in one file: make ______ build.log 2>&1. Which redirection operator belongs in the blank?
If you have a .repo file describing a new repository, where should it be put so DNF recognizes it?
Using objdump -p (--private-headers) and grep, how would you print (a) the dependencies of glibc, (b) the soname of glibc, and (c) the dependencies of Bash?
How can you set GRUB 2 to wait for 10 seconds before booting the default menu entry?
Consider this GRUB 2 entry:
plain text
menuentry "Default OS" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
Change it so the system will boot from a disk with the UUID 5dda0af3-c995-481a-a6f3-46dcd3b6998d.
You have a disk identified as /dev/sda with multiple partitions. Which command can be used to find out which is the boot partition on a system?
watch ______ 5 df -h re-runs the disk-usage report every five seconds and redraws the screen with the result.
______ prints how long the system has been running, how many users are logged in, and the 1-, 5-, and 15-minute load averages on a single line.
You want to diff the listings of two directories without creating any temporary files. Which command works?
Which single cp option both recurses into directories and preserves mode, ownership, timestamps, and symbolic links?
Creating /opt/app/config/env when none of those directories exist yet takes a single command: mkdir ______ /opt/app/config/env.
In dd if=image.iso of=/dev/sdc ______=4M status=progress, which operand sets the size of each block that is read and written?
Pressing ______ at the prompt begins a reverse incremental search back through your command history, matching as you type.
In the S (state) column of ps -elf, the code ______ marks a zombie: a process that has finished but whose parent has not yet reaped its exit status.
find . -name '*.tmp' -______ rm {} \; deletes every matching file by running a command on each result, without needing a pipe into xargs.
Logging out sends SIGHUP to your jobs and kills them. Prefixing the command with ______ makes it ignore that signal and redirects its output to nohup.out.
What does cmd 2>&1 > out.log actually do?
A directory contains notes.txt, .bashrc, and .profile. What does ls * list?
tar cannot run without one particular option, which names the archive it should read or write: ______.
uniq collapses only *adjacent* duplicate lines, so a frequency count must pipe through another command first: ______ access.log | uniq -c.
The name passwd is documented twice: once as a command and once as a configuration file format. Which invocation opens the page describing the file format of /etc/passwd?
How would you open ~/.bash_profile in vi with the cursor already on the LAST line?
In vi/vim normal mode, what keystroke sequence selects from the cursor to the end of the line, EXCLUDING the trailing newline character?
How would find search the current directory for files whose names do NOT end in a standard extension like .txt or .c?
Given domains.txt with one domain per line, write an egrep command listing only lines ending in .org or .com.
Write an extended-regex pattern matching a dotted-quad IPv4 address like 192.168.15.1.
In top's PR (priority) column, real-time processes typically show which special value instead of a normal number?
Which command can both DISPLAY a process's current CPU scheduling parameters and CHANGE them to real-time?
Write a ps invocation that sorts all processes by CPU usage in ASCENDING order (lowest first).
Type the top invocation that starts with tasks already sorted by memory usage, without pressing a key interactively.
Which signal, sent to Apache HTTPD's parent process, makes it re-read its config and re-open log files WITHOUT killing the parent — only replacing its child workers?
Which THREE forms are all valid ps syntax for filtering by user www-data, differing only in flag convention?
The paths and filesystem types that updatedb deliberately skips are configured in ______.
find / ______ -name '*.conf' keeps the search within a single filesystem, so it never descends into /proc, /sys, or other mounted filesystems.
Software you compile and install yourself belongs under ______, which keeps it cleanly separated from anything the distribution's package manager owns.
alice owns report.txt and is a member of the devs group. Which statement is true?
chmod -R u+rw______ project/ grants the owner read and write everywhere, but adds execute only to directories and to files that were already executable.
With umask 022 in effect, a newly created regular file ends up with mode ______.
Which source is the kernel's own authoritative record of what is mounted right now?
An NFS or CIFS entry in fstab needs the ______ option, which tells the system to bring up networking before attempting the mount.
The sixth field of an /etc/fstab line sets the boot-time fsck order. The root filesystem takes ______, other local filesystems take 2, and swap or network mounts take 0.
fsck finishes and exits with status 4. What does that tell you?
Which variable, set in /etc/updatedb.conf, tells updatedb to skip indexing a given filesystem type (e.g. ntfs)?
Write a find command (current directory only, no subdirectories) for files that are writable by the user, modified in the last 10 days, AND bigger than 4 GiB.
Which directory holds temporary runtime data and is specifically cleared during the boot process (distinct from /tmp)?
A symbolic link link.txt was created with a RELATIVE target path, then the LINK ITSELF is moved to a different directory that happens to also contain a file with that same relative name. What happens when you read link.txt from its new location?
Which command shows the UUID of the filesystem on /dev/sdb1?
Write a mount command that mounts an ext4 filesystem on /dev/sdc1 at /mnt/external, read-only, with the noatime and async options.
tune2fs -c 9 /dev/sda1 sets the maximum mount count to 9; the filesystem's current mount count is already 8. What happens at the NEXT boot?
Write a single tune2fs command that converts an ext2 filesystem on /dev/sdb1 to ext3, resets its mount count to 0, and relabels it UserData.
Write the command that combines two equal-size partitions, /dev/sda1 and /dev/sdb1, into one Btrfs filesystem where each mirrors the other (RAID1-style).
Write the mkfs command that creates an ext3 filesystem on /dev/sdc1, checking for bad blocks first, with label MyDisk and a random UUID.
If your processor supports virtualization, what would running a KVM hypervisor typically involve?
What command checks whether your system already has CPU extensions enabled to run a virtual machine?
A mission-critical server installation that requires the fastest performance will likely use what type of virtualization?
Using dnf, what is the command to add a repository located at https://www.example.url/home:reponame.repo to the system?
How would you use zypper to find out which package owns the file /usr/sbin/swapon?
Using zypper, how would you disable a repository called repo-extras?
Using rpm on a Red Hat Enterprise Linux system, how would you install the package file-roller-3.28.1-2.el7.x86_64.rpm, showing a progress bar during installation?
Using dpkg-query, find which package contains a file named 7zr.1.gz.
Which clock does hwclock --set --date "12:00:00" change?
Which command sets the hardware clock from the current system clock?
ls -l /usr/bin/crontab shows -rwxr-sr-x ... root crontab ... /usr/bin/crontab. What does the s in the group triplet enable?
A crontab entry runs ./foobar.sh and redirects output to output.log with no absolute paths. Why does this work?
A user's encrypted password field in /etc/shadow begins with !. What does this mean?
kevin belongs to secondary groups administrators, developers, and web-designers. You want to remove ONLY developers. What must you do?
useradd -G administrators,developers kevin — what does the uppercase -G control?
Which chage option sets a user account's expiration date?
Which desktop environments are best suited to low-power single-board computers (e.g. Raspberry Pi–class hardware)?
Which command generates a keyboard configuration for the X Window System?
Which component is responsible for keeping an X server running — starting it, and restarting it if it crashes?
A new 10-button mouse needs its own X config, without touching the rest of the server config. Which directory/section?
Which of these is NOT a remote-desktop access protocol?
Which pair of startup files does an interactive login Bash shell read that an interactive non-login shell does not?
Script do.sh is executable; undo.sh is a symlink pointing to it. From inside the script, which special variable reveals whether it was invoked as do.sh or undo.sh?
You have an alias named ls that hides some output you need to see once. Type the command that runs the REAL ls, bypassing the alias, for this one call.
Which feature is unique to shell FUNCTIONS and not available to aliases?
Which key combination opens a text-mode tty shell (tty1–tty6) from a frozen X session?
Where should a function be defined so it is available to root in every interactive shell — login or non-login — without being re-sourced manually?
Which command starts an interactive non-login shell as root, assuming the caller already has sudo rights?
Where are the menu entries for GRUB Legacy stored?
Into which file should custom GRUB 2 menu entries be added?
On a disk formatted with the MBR partitioning scheme, which is the ID of the EFI System Partition?
What is the smallest unit inside of a Volume Group?
Where should the boot partition end to ensure that a PC will always be able to load the kernel?
Using xargs, write a command that runs convert IMG -resize 25% small/IMG once per filename listed in filelist.txt, substituting each filename for IMG.
Which directory holds a symlink for every file descriptor a specific running process (PID 1234) currently has open?
Write a find size clause that matches files strictly between 100 MB and 1000 MB.
Which mv option lets you specify the destination directory as an option BEFORE listing multiple source files, instead of listing sources first and the destination last?
Before piping ls -l output to cut -d" " -f9 to get just the filename, which command should you insert to collapse ls -l's variable-width column spacing into single spaces?
Write the split command that breaks book.txt into 100-line chunks with filenames prefixed part.
Write a single sed command that prints only the 1st, 10th, and last line of a file.
Write a grep pattern that matches only /etc/passwd lines where the login shell field is exactly /bin/bash (not e.g. /bin/bash-something).
Write a sed-only one-liner equivalent to grep processor /proc/cpuinfo | wc -l — i.e. count lines matching a pattern — without piping to grep or wc.
Which apropos option makes it print only a brief usage summary and exit, instead of searching man pages?
Although the file /sbin/init can be found in systemd based systems, it is only a symbolic link to another executable file. In such systems, what is the file pointed to by /sbin/init?
In a SysV based system, suppose the default runlevel defined in /etc/inittab is 3, but the system always starts in runlevel 1. What is the probable cause for that?
What will happen to the services related to the file /etc/rc1.d/K90network when the system enters runlevel 1?
A hard drive containing the entire filesystem of an offline machine was removed and attached to a working machine as a secondary drive. Assuming its mount point is /mnt/hd, how would journalctl be used to inspect the contents of the journal files located at /mnt/hd/var/log/journal/?
What is a common consequence of installing a custom kernel without providing an appropriate initramfs image?
The boot process of a Linux machine ends up with the following message:
plain text
ALERT! /dev/sda3 does not exist. Dropping to a shell!
What is the likely cause of this problem?
Suppose the system is unable to boot due to a misinformed root filesystem location. How would the correct root filesystem, located at /dev/sda3, be given as a parameter to the kernel?
On a machine equipped with a BIOS firmware, where is the bootstrap binary located?
Many network routers run a Linux based operating system and have a USB port for external devices. How will an external USB hard drive be named in the /dev/ directory, assuming no other conventional block device is present in the router?
An attentive user will notice the absence of the lspci command on ARM-based single board computers, like the Raspberry Pi. What difference with x86 machines justifies that absence?
Some x86 servers with older BIOS firmware will not boot if a keyboard is not detected. How can this particular issue be avoided?
The following line is part of the output generated by command lspci:
plain text
03:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2208 [Thunderbolt] (rev 05)
What command should you execute to identify the kernel module in use for this specific device?
Suppose an operating system is unable to boot after adding a second SATA disk to the system. Knowing that all parts are not defective, what could be the possible cause for this error?
Type the full command that switches a running systemd system to multi-user.target immediately, without changing the boot default.