View Full LPI 101-500 Exam Dumps and Practice Test Dumps
Question: 181. Which directory is commonly used as a template for files and directories created for new users?
- /etc/default
2. /etc/skel
3. /etc/init.d
4. /etc/modules
Correct Answer: 2. /etc/skel
Explanation:
The /etc/skel directory is commonly used as a skeleton or template directory for new user accounts. When a user account is created, appropriate files from /etc/skel may be copied into the new user’s home directory. These files can include shell configuration files such as .profile or other default settings. This provides administrators with a convenient way to establish standard initial configurations for users. The exact files placed there can vary between Linux distributions and system configurations. The important concept for the LPI exam is that /etc/skel provides default home-directory content used when creating new user accounts.
Question: 182. Which file commonly contains DNS resolver configuration information on traditional Linux systems?
- /etc/hosts
2. /etc/fstab
3. /etc/hostname
4. /etc/resolv.conf
Correct Answer: 4. /etc/resolv.conf
Explanation:
The /etc/resolv.conf file traditionally contains DNS resolver configuration information. It commonly specifies DNS nameserver addresses and may include search-domain settings. When an application needs to translate a hostname into an IP address, the system’s resolver configuration helps determine where DNS queries should be sent. Modern Linux systems may manage this file dynamically through services such as NetworkManager or systemd-resolved, so administrators should understand that its contents may not always be manually maintained. For LPI purposes, the key association is that /etc/resolv.conf is related to hostname resolution and DNS resolver settings.
Question: 183. Which command option is commonly used with ls to display hidden files in a directory?
- ls -a
2. ls -r
3. ls -h
4. ls -t
Correct Answer: 1. ls -a
Explanation:
The -a option of the ls command tells Linux to display all directory entries, including hidden files. In Linux, filenames beginning with a dot are normally hidden from a standard ls listing. Running ls -a therefore displays entries such as .bashrc, .profile, . and .. along with ordinary files. The . and .. entries represent the current and parent directories respectively. Other ls options have different purposes, such as sorting by modification time, displaying human-readable sizes, or reversing the listing. Remember that hidden files are not necessarily protected files; they are simply excluded from normal directory listings.
Question: 184. What does the sleep command primarily do?
- Terminates a running process
2. Changes the system clock
3. Pauses execution for a specified amount of time
4. Displays the current system uptime
Correct Answer: 3. Pauses execution for a specified amount of time
Explanation:
The sleep command pauses execution for a specified period. It is commonly used in shell scripts when a script needs to wait before continuing with the next operation. For example, a script might use sleep 5 to wait approximately five seconds. The command does not change the system clock, terminate another process, or report system uptime. The duration can be expressed using supported time units depending on the implementation, such as seconds, minutes, hours, or days. Understanding sleep is useful when working with automation, timing-dependent scripts, retries, and simple demonstrations of process behavior.
Question: 185. Which directory is commonly used for temporary mount points created by administrators?
- /boot
2. /usr
3. /srv
4. /mnt
Correct Answer: 4. /mnt
Explanation:
The /mnt directory is traditionally used as a temporary mount point for manually mounted filesystems. An administrator may mount a disk partition, network filesystem, or other storage resource under a directory such as /mnt. This differs from /media, which is commonly associated with automatically mounted removable media in desktop-oriented environments. The exact conventions can vary, but /mnt remains an important filesystem hierarchy concept. A mount point is simply a directory where the contents of another filesystem become accessible. The command used to perform the operation is mount, while /mnt provides a conventional location for temporary or manually managed mounts.
Question: 186. What is the primary purpose of the /run directory on a modern Linux system?
- Store runtime data for currently running processes and services
2. Store permanent user documents
3. Store bootloader configuration permanently
4. Store archived log files
Correct Answer: 1. Store runtime data for currently running processes and services
Explanation:
The /run directory is intended for volatile runtime data associated with the currently running system. It can contain information such as process identifiers, sockets, lock files, and other data needed by active services. Unlike persistent configuration directories, /run is generally associated with the current boot session and its contents may be recreated when the system starts. It should therefore not be treated as a normal location for permanent user files. The Linux filesystem hierarchy uses /run to provide a standardized location for runtime state. The important exam concept is the distinction between temporary runtime information and persistent system configuration.
Question: 187. Which command can display the target of a symbolic link?
- readlink
2. mkdir
3. touch
4. chmod
Correct Answer: 1. readlink
Explanation:
The readlink command can display information about symbolic links, including the path to which a symbolic link points. Symbolic links are filesystem objects that contain a reference to another pathname rather than directly representing the target file’s data. For example, if current is a symbolic link pointing to /opt/application, readlink current can return /opt/application. This is useful when troubleshooting links, examining directory structures, or determining where a link resolves. The command should be distinguished from chmod, which changes permissions, touch, which creates or updates files, and mkdir, which creates directories.
Question: 188. What happens to a symbolic link when its target file is removed?
- The symbolic link automatically becomes a hard link
2. The symbolic link is automatically deleted
3. The symbolic link becomes a dangling or broken link
4. The symbolic link creates a new target file
Correct Answer: 3. The symbolic link becomes a dangling or broken link
Explanation:
A symbolic link stores a pathname pointing to another file or directory. If that target is removed or moved so that the stored pathname no longer identifies a valid target, the symbolic link itself normally remains. It becomes a dangling, broken, or unresolved symbolic link. Attempting to access the target through the link will fail because the referenced pathname cannot be resolved. This behavior is different from a hard link, which refers to the same underlying inode as the target and therefore remains associated with the file data while at least one hard link exists. Understanding this distinction is important when troubleshooting filesystem links.
Question: 189. Which command is commonly used to compare two text files line by line?
- diff
2. sleep
3. echo
4. basename
Correct Answer: 1. diff
Explanation:
The diff command is commonly used to compare files and identify differences between them. For text files, it can report lines that need to be added, removed, or changed to transform one file into another. This makes diff useful for checking configuration changes, reviewing revisions, troubleshooting scripts, and preparing patches. A common form is diff file1 file2. The command does not modify the compared files merely by examining them. Other commands have unrelated purposes: sleep pauses execution, echo displays text, and basename extracts the final component of a pathname. For LPI preparation, associate diff with comparing file contents.
Question: 190. Which command is designed to compare two files byte by byte and report whether they differ?
- grep
2. cmp
3. sort
4. wc
Correct Answer: 2. cmp
Explanation:
The cmp command compares two files byte by byte. It is useful when the goal is to determine whether two files are identical or to identify the first position where their contents differ. Unlike diff, which is especially useful for presenting meaningful line-oriented differences in text files, cmp performs a direct comparison of the file data. This makes it useful for binary files as well as text files when an exact byte-level comparison is desired. If the files are identical, cmp normally produces no output and returns a successful status. If differences are found, it reports them according to its options.
Question: 191. Which command is commonly used to perform basic text substitutions on input using editing commands?
- sed
2. ps
3. mount
4. jobs
Correct Answer: 1. sed
Explanation:
sed, the stream editor, is commonly used to process and transform text streams. One of its most familiar uses is performing substitutions, such as replacing one string with another in lines of input. A typical form is sed ‘s/old/new/’ file, although many additional editing operations are available. sed reads input, applies specified editing commands, and writes the resulting text to standard output unless options or redirection change that behavior. It is particularly useful in shell scripts and automation because it can process large amounts of text without requiring interactive editing. LPI candidates should recognize sed as a stream-oriented text-processing tool.
Question: 192. Which command is commonly used for pattern-based text processing and field-oriented data extraction?
- sleep
2. mount
3. awk
4. ln
Correct Answer: 3. awk
Explanation:
awk is a powerful text-processing language commonly used from the Linux command line. It is particularly useful for processing structured text divided into records and fields. An awk program can select lines based on patterns, perform calculations, manipulate fields, and generate formatted output. For example, awk ‘{print $1}’ file can print the first field from each input line using the default field separation behavior. Although awk can perform complex programming tasks, the LPI exam often focuses on recognizing its role in text and data processing. It should not be confused with commands intended primarily for mounting filesystems, creating links, or pausing execution.
Question: 193. Which command option is commonly used to display filesystem types along with disk usage information?
- df -T
2. df -h
3. df -i
4. df -a
Correct Answer: 1. df -T
Explanation:
The -T option of df causes filesystem type information to be displayed along with filesystem usage information on implementations that support this option. The df command itself reports information about available and used space on mounted filesystems. Other options provide different forms of information. For example, -h commonly presents sizes in human-readable units, while other options can control which filesystems or inode information are displayed. Knowing df -T is useful when an administrator needs both capacity information and the filesystem type, such as determining whether a mounted filesystem uses ext4, XFS, or another supported filesystem.
Question: 194. Which command is commonly used to display block-device information including filesystem-related details when used with the -f option?
- free -f
2. lsblk -f
3. ps -f
4. du -f
Correct Answer: 2. lsblk -f
Explanation:
The lsblk command displays information about block devices such as disks and partitions. When used with the -f option, it commonly includes filesystem-related information such as filesystem type, label, UUID, and mount point, depending on the system and available metadata. This makes lsblk -f useful when identifying storage devices and determining how filesystems are associated with partitions. It is especially helpful during system administration tasks involving disks and mounts. The command does not itself mount or format devices. The key LPI association is that lsblk -f combines block-device information with filesystem details.
Question: 195. Which command can display filesystem UUIDs and other block-device attributes?
- blkid
2. uname
3. who
4. jobs
Correct Answer: 1. blkid
Explanation:
The blkid command is commonly used to display block-device attributes, including filesystem type, filesystem label, and UUID. UUIDs are useful because they provide persistent identifiers that can be used in configuration files such as /etc/fstab, rather than relying exclusively on device names that may vary between boots. Administrators can use blkid when identifying partitions and determining their filesystem metadata. The exact output depends on the devices and permissions available on the system. The important LPI concept is that blkid is associated with identifying block devices and their filesystem attributes, especially UUID and filesystem type information.
Question: 196. What does the execute permission on a directory generally allow a user to do?
- Read every file automatically
2. Delete the filesystem
3. Access or traverse entries within the directory when other permissions allow
4. Change the owner of the directory
Correct Answer: 3. Access or traverse entries within the directory when other permissions allow
Explanation:
Execute permission on a directory has a different meaning from execute permission on a regular file. For a directory, execute permission generally allows a user to traverse the directory and access entries when the necessary permissions on those entries are also satisfied. For example, a user may need directory execute permission to access a known file inside that directory. Read permission on a directory is associated with being able to list its entries, while write permission can allow entries to be created, removed, or renamed when combined with appropriate permissions. Understanding directory permission semantics is important because r, w, and x behave differently depending on the object type.
Question: 197. Which keyboard shortcut normally sends SIGINT to the foreground process in a terminal?
- Ctrl+Z
2. Ctrl+D
3. Ctrl+S
4. Ctrl+C
Correct Answer: 4. Ctrl+C
Explanation:
In a typical interactive terminal, pressing Ctrl+C causes the terminal driver to send the SIGINT signal to the foreground process group. SIGINT is commonly interpreted by programs as an interrupt request and often causes the current command to terminate, although a program can handle or ignore the signal. This differs from Ctrl+Z, which normally sends SIGTSTP and suspends the foreground process. Ctrl+D is generally associated with an end-of-file indication rather than a signal such as SIGINT. The exact behavior can depend on terminal configuration and the program, but Ctrl+C is the standard association for SIGINT.
Question: 198. Which keyboard shortcut normally suspends a foreground process in an interactive shell?
- Ctrl+Z
2. Ctrl+C
3. Ctrl+D
4. Ctrl+R
Correct Answer: 1. Ctrl+Z
Explanation:
In a typical interactive shell, pressing Ctrl+Z causes the terminal to send the SIGTSTP signal to the foreground process group. This normally suspends the process rather than terminating it. After suspension, the shell can place the job in the background or bring it back to the foreground using commands such as bg and fg. This is different from Ctrl+C, which normally sends SIGINT and requests interruption. Ctrl+Z is therefore an important part of Linux job control. Understanding the relationship between keyboard shortcuts, signals, and shell jobs helps explain how interactive processes can be paused and resumed.
Question: 199. Which command can be used to display the absolute path of a command or executable that would be found through the user’s PATH?
- touch
2. realpath
3. which
4. mkdir
Correct Answer: 3. which
Explanation:
The which command is commonly used to locate the executable associated with a command by searching directories listed in the user’s PATH. For example, which python may display the pathname of the Python executable that would be selected when the command is entered. This can help diagnose situations where multiple versions of a program are installed. which is different from realpath, which resolves a pathname to its canonical form, and from mkdir or touch, which create or modify filesystem objects. Shell behavior can involve aliases, functions, and builtins that are not necessarily represented by which, so it should be understood as a command-path lookup tool.
Question: 200. Which command can resolve a pathname to its canonical absolute path, resolving symbolic links and special path components?
- basename
2. realpath
3. echo
4. wc
Correct Answer: 2. realpath
Explanation:
The realpath command can resolve a pathname into a canonical absolute pathname. This process can resolve symbolic links and normalize components such as . and .., depending on the command’s behavior and options. It is useful when a script or administrator needs to determine the actual canonical location represented by a pathname. This differs from basename, which extracts the final component of a pathname, and echo, which simply writes arguments to standard output. realpath can therefore be valuable when troubleshooting symbolic links, scripts, and filesystem paths where multiple path representations may refer to the same location.