Free Features and Tools of Linux practice questions
10 free 220-1202 questions on Features and Tools of Linux, each with a full explanation — no account needed. This section sits in the Operating Systems part of the exam. Answer every question to see your score, then read the lessons below for anything you missed.
A Linux workstation experiences a sudden power loss, and after rebooting it drops into a recovery shell because a volume using ext4 will not mount cleanly. Which utility is the standard first tool to verify and repair the filesystem?
fsck is the standard first tool for verifying and repairing an ext4 filesystem that will not mount after an unclean shutdown. ext4 uses journaling, which usually reduces damage after a sudden power loss, but when a volume still won't mount, fsck checks the filesystem structure and repairs inconsistencies so it can be mounted again. chkdsk is the Windows equivalent utility for checking and repairing NTFS and FAT volumes; it is not used on a Linux ext4 filesystem. icacls is a Windows command-line tool used to view and modify NTFS permissions and ACLs, which is unrelated to repairing a Linux filesystem. sudo is a Linux command used to run actions with elevated privileges, so while a technician might run fsck with sudo, sudo itself performs no filesystem checking or repair. Recognizing fsck as the go-to recovery tool for ext filesystems is a practical skill for Linux support after crashes or forced power-offs.
A technician needs to install a troubleshooting utility on an Ubuntu desktop. Before installing, they want to ensure the local package index reflects the latest available versions from the configured repositories. Which command should be run first?
The command sudo apt update refreshes the local package lists by downloading the latest package index data from the configured repositories. It does not install or upgrade anything; it only ensures the system knows which versions are currently available, which prevents version-mismatch problems during installs. The command sudo apt upgrade applies available upgrades to installed packages, but it relies on an already-refreshed index, so running it first would use stale data. The command sudo apt install is used to add a specific package but requires a package name and does not refresh metadata. The command sudo apt autoremove cleans up unused dependencies left behind after uninstalling software and has nothing to do with refreshing package lists. The proper maintenance order is to update the index first, then upgrade, and only then install new tools.
A user reports that a file they need is 'missing,' but the technician suspects it is a hidden configuration item stored in a dotfile. Which command will list all files, including hidden ones, in the current directory?
The command ls -a shows all items in the directory, including hidden files and folders whose names begin with a dot, such as .bashrc or .config. Hidden dotfiles frequently store user settings, so a browser profile or app preference that appears missing may actually reside in one of these directories. The command ls -l produces a long listing showing permissions, owner, group, size, and timestamp, but it does not reveal hidden items. The command ls -h makes file sizes human-readable but is typically combined with -l and still does not display hidden files. The command ls -t sorts results by modification time, which is useful for finding the newest file but does not expose hidden dotfiles. When a user complains a setting or profile is gone, revealing hidden files with ls -a is often the fastest way to turn a vague complaint into a clear next step.
A technician runs su without the dash and then attempts to execute an administrative command that normally works for root, but it fails with a 'command not found' error. What is the MOST likely cause?
Running su without the dash switches the user to root but keeps the original user's environment, including their PATH variable. Because root's system paths were not loaded, a command that lives in a root-accessible directory may produce a 'command not found' error even though the command exists. Using su - starts a login shell that resets the environment to match the target account, which usually makes admin commands behave as expected. The idea that the root password was entered incorrectly is unlikely because an incorrect password would prevent the switch entirely, not allow a shell that later fails a command. Requiring sudo instead of su is not the issue, since su successfully placed the technician in a root shell. Assuming the package was never installed is a common misdiagnosis; if the same command works after su -, the problem was the environment and PATH, not a missing package. Always confirm identity with id and watch for PATH differences before concluding software is missing.
A support technician wants to verify exactly which administrative commands their current account is permitted to run before performing a maintenance task. Which command provides this information?
The command sudo -l lists the specific commands the current user is allowed to run with elevated privileges according to the sudoers policy. This is the correct way to confirm the scope of your administrative access before running maintenance tasks. The command sudo -v refreshes or updates your cached sudo credentials so you are not prompted again soon, which is helpful before a long install, but it does not list permitted commands. The command id displays your user ID and group memberships, which helps confirm who you are but does not show what admin actions are authorized. The command groups shows which groups you belong to, and while membership in a group like sudo or wheel may grant privileges, it does not enumerate the exact allowed commands. If you cannot explain who you are with id and what you are allowed to run with sudo -l, you should not run admin commands yet.
A technician runs ls -l on a script and sees the permission string -rwxr-x---. Which statement correctly describes the access this file grants?
The permission string -rwxr-x--- breaks down into three triplets after the leading file-type character. The first triplet rwx grants the owner read, write, and execute (full access). The second triplet r-x grants the group read and execute but not write. The final triplet --- grants others no permissions at all. The option stating the owner has read and execute while the group has full access reverses the actual owner and group rights. The option describing read and write for the owner with read only for group and others corresponds to a string like -rw-r--r-- (644), not the string shown. The option granting others read and execute is incorrect because the final triplet is all dashes, meaning others have no access. Reading permission strings accurately is essential for diagnosing 'Permission denied' errors quickly and applying the smallest change needed to resolve them.
An administrator copied several files to a user's home directory using a root account. Afterward, the user reports they cannot edit the files because they are owned by root. Which command will BEST resolve the issue while affecting an entire folder tree?
chown -R user:group FolderName changes the owner and group of the folder and everything inside it recursively, handing the files back to the account that needs to edit them, which is the actual fault when root copied them in. chmod -R 777 makes every file world-writable, a serious security hole that hides the ownership mistake instead of fixing it. chmod -R u+w adds write permission for the owner recursively, but the owner is still root, so the user stays locked out. chown user:group without -R changes only the top-level folder, leaving every file beneath it owned by root. Ownership decides whose permission bits apply, so a recursive chown is the least-privilege fix.
A technician needs to search recursively through all files in a directory for the word 'fail' while ignoring case differences so that both 'Fail' and 'fail' are matched. Which command accomplishes this?
The command grep -r -i "fail" foldername searches text inside files recursively through a directory (-r) and ignores case (-i), so both 'Fail' and 'fail' will match. This is ideal for surfacing authentication or error strings across an entire folder of logs or config files. The command grep -r -n "fail" foldername searches recursively but the -n flag only adds line numbers to the output; without -i it will not match different cases. The command find foldername -name "fail" locates files whose names are 'fail' but does not search the contents inside files, which is the wrong tool for finding text within files. The command grep -i "fail" foldername ignores case but lacks the recursive flag, so it will not descend into subdirectories and will not properly search a folder tree. Remember that grep searches inside files for text, while find locates files by name, type, or date.
A technician attempts to run sudo apt install on a Debian-based system and receives an error referencing /var/lib/dpkg/lock. What is the SAFEST first response?
A lock error referencing /var/lib/dpkg/lock usually means another package process, such as an automatic updater, is currently running. The safest first step is to wait a short time and then retry the command, because the other process will typically finish and release the lock on its own. Killing the process holding the lock can corrupt the package database and leave the system in a broken state. Deleting the lock file manually is risky for the same reason; if the other process is still active, removing the lock can result in a corrupted package state and interrupted transactions. Reinstalling the apt package manager from source is unnecessary and contradicts best practice, since apt is not broken and repository installs are preferred over source builds. When package commands fail, read the exact error line and apply the least disruptive fix first, escalating only if the problem persists.
On a Fedora workstation, a recent system update introduced a problem, and the technician wants to review previous package transactions so they can attempt to reverse the update. Which command lists past transactions on this Red Hat-based system?
The command dnf history lists past package transactions along with their transaction IDs. Once the offending transaction is identified, sudo dnf history undo <ID> can attempt to reverse it, making this the correct tool for reviewing and rolling back a problematic update. The command dnf list installed shows all currently installed packages but provides no record of transactions or the ability to undo them. The command dnf check-update queries repositories and reports which packages have available upgrades; it looks forward at pending updates rather than backward at completed transactions. The command dnf clean all clears cached metadata to resolve slow or corrupted cache issues, but it does not display or reverse transaction history. While transaction rollback is not a perfect restore because later changes can complicate the state, A+ candidates should recognize dnf history as the starting point for reviewing and undoing recent package activity.
Study this section
Every lesson that covers Features and Tools of Linux on the 220-1202 exam.
Free PBQs for this section
Interactive performance-based questions on Features and Tools of Linux, graded instantly.