LPI 101-500 Practice Test Questions and Exam Dumps Part 15 Q281-300

View Full LPI 101-500 Exam Dumps and Practice Test Dumps

 

Question: 281. Which directory traditionally contains most user-level executable programs installed by the system?

  1. /var/lib
    2. /usr/bin
    3. /etc
    4. /var/log

Correct Answer: 2. /usr/bin

Explanation:

The /usr/bin directory traditionally contains a large collection of executable programs intended for ordinary users and applications. Commands such as text-processing utilities, editors, and many other user-space programs can be located there. The /etc directory is primarily used for system configuration files, while /var/lib stores variable application and system state data. /var/log contains log files generated by the operating system and applications. Modern Linux systems may use merged filesystem layouts in which /bin is linked to /usr/bin, but /usr/bin remains an important standard location for user-space executables.

Question: 282. Which directory is primarily associated with variable application and system state data?

  1. /var/lib
    2. /usr/share
    3. /boot
    4. /dev

Correct Answer: 1. /var/lib

Explanation:

The /var/lib directory stores persistent variable data used by applications and system services. Examples can include package-management databases, service state information, and other data that programs need to preserve between system reboots. It differs from /var/log, which is specifically associated with logs, and /var/cache, which stores data that can generally be regenerated. /boot contains files needed during the boot process, while /dev provides interfaces representing devices. Understanding the purpose of /var/lib helps administrators identify where applications maintain persistent operational state.

Question: 283. Which directory is traditionally used for system lock files?

  1. /var/cache
    2. /var/spool
    3. /var/lock
    4. /usr/local

Correct Answer: 3. /var/lock

Explanation:

The /var/lock directory is traditionally associated with lock files used to indicate that a resource is currently being used or reserved. Locking helps prevent multiple processes from simultaneously accessing a resource in ways that could cause conflicts. On many modern Linux distributions, /var/lock may be implemented as part of the /run/lock hierarchy because /run is intended for runtime data. Nevertheless, understanding /var/lock remains relevant for Linux administration and filesystem knowledge. It should not be confused with /var/cache, which stores reusable cached information, or /var/spool, which holds queued data.

Question: 284. What does ls -i display in addition to the normal directory listing?

  1. File ownership only
    2. File contents
    3. Network interface addresses
    4. Inode numbers

Correct Answer: 4. Inode numbers

Explanation:

The ls -i command displays the inode number associated with each listed filesystem object. An inode is a filesystem data structure that stores metadata about a file, such as ownership, permissions, timestamps, and references to the file’s data blocks. The inode number is particularly useful when investigating hard links because multiple hard-linked filenames can reference the same inode. The command does not display file contents or network information. Administrators can use inode numbers to help distinguish filesystem objects and investigate relationships between filenames and their underlying filesystem metadata.

Question: 285. Which option causes ls to sort entries by file size?

  1. -S
    2. -t
    3. -r
    4. -i

Correct Answer: 1. -S

Explanation:

The -S option tells ls to sort directory entries by file size, normally placing larger files first. This can be useful when looking for unusually large files that may be consuming significant disk space. The -t option sorts by modification time, while -r reverses the sorting order and can be combined with other sorting options. The -i option displays inode numbers rather than controlling size sorting. For example, ls -lS combines a long listing with size-based sorting, making it easier to inspect permissions, ownership, timestamps, and file sizes together.

Question: 286. Which ls option sorts directory entries by modification time?

  1. -S
    2. -t
    3. -i
    4. -F

Correct Answer: 2. -t

Explanation:

The -t option makes ls sort entries according to their modification time. By default, newer entries are shown before older ones. This is useful when an administrator needs to identify recently modified files quickly. The option can be combined with other ls options, such as -l, to display detailed metadata alongside the time-based ordering. The -S option sorts by file size, -i displays inode numbers, and -F adds indicators to filenames based on their file types. Adding -r can reverse the normal sorting order.

Question: 287. What does ls -1 do?

  1. Shows hidden files only
    2. Displays inode numbers
    3. Displays one entry per line
    4. Sorts entries by size

Correct Answer: 3. Displays one entry per line

Explanation:

The -1 option tells ls to display one directory entry on each line. This can be especially useful when output needs to be processed by another command or when a clean, vertically arranged listing is easier to read. It does not mean that only one file is displayed. Hidden files are controlled by the -a option, inode numbers by -i, and size sorting by -S. Although ls may automatically choose a suitable display format depending on whether its output goes to a terminal or another command, -1 explicitly requests one entry per line.

Question: 288. Which find test restricts results to regular files?

  1. -type f
    2. -file regular
    3. -regular
    4. -kind file

Correct Answer: 1. -type f

Explanation:

The find expression -type f restricts matches to regular files. A regular file is the ordinary type used for documents, scripts, program data, and similar content. Other type values can identify directories, symbolic links, block devices, character devices, and other filesystem objects. For example, find /home -type f searches under /home and returns regular files. This test is useful because directories and other filesystem objects are otherwise possible matches. Combining -type f with additional tests such as -name or -mtime allows administrators to build more precise searches.

Question: 289. Which find expression searches for files whose names match a specified shell-style pattern?

  1. -pattern
    2. -name
    3. -match
    4. -filename

Correct Answer: 2. -name

Explanation:

The find option -name compares the filename against a shell-style pattern. For example, find /tmp -name ‘*.log’ searches for filenames ending in .log. The wildcard * in this context is a shell-style pattern understood by find, rather than a regular expression. Quoting the pattern is important so that the current shell does not expand it before find receives it. The -name test normally performs a case-sensitive comparison. The related -iname test performs a case-insensitive name comparison.

Question: 290. Which find option can be used to locate files based on modification time measured in days?

  1. -date
    2. -age
    3. -mtime
    4. -time

Correct Answer: 3. -mtime

Explanation:

The find test -mtime searches according to the age of a file’s contents based on modification time, using periods measured in 24-hour units. For example, find /var/log -mtime +7 can be used to locate files whose modification time is more than seven days ago, subject to find‘s day-rounding semantics. This is commonly useful for administration and cleanup tasks. Other time-related tests exist for access and metadata-change times, but -mtime specifically concerns modification time. Administrators should understand the exact meaning of +, , and numeric values when constructing time-based searches.

Question: 291. Which find option allows an administrator to search for files according to their size?

  1. -length
    2. -capacity
    3. -bytes
    4. -size

Correct Answer: 4. -size

Explanation:

The find -size test searches for filesystem objects based on their size. It can be useful when locating very large files or identifying files below a particular size threshold. Units can be specified so that searches can be expressed in terms such as bytes, kilobytes, megabytes, or other supported units. For example, a command can search for files larger than a specified size and combine that condition with -type f. This makes -size particularly useful during disk-space investigations and routine system maintenance.

Question: 292. Which find action executes a specified command for each matching result?

  1. -exec
    2. -run
    3. -command
    4. -perform

Correct Answer: 1. -exec

Explanation:

The -exec action allows find to execute another command for each object that matches the preceding search conditions. A common form uses {} as a placeholder for the current pathname, followed by \; to terminate the action. For example, a search can identify files and then run another utility on each matching file. Because -exec can perform potentially destructive operations such as deletion or modification, administrators should test search expressions carefully before applying changes. The action is particularly useful when the command needs to operate directly on each matched pathname.

Question: 293. What command updates the database commonly used by the locate utility?

  1. locate-update
    2. updatedb
    3. refreshlocate
    4. dbupdate

Correct Answer: 2. updatedb

Explanation:

The updatedb command is commonly used to build or update the database searched by the locate utility. Unlike find, which normally examines the filesystem directly when the search is performed, locate searches a previously generated database. This can make locate very fast, but its results may not include files created or removed since the database was last updated. The exact scheduling and permissions surrounding updatedb depend on the Linux distribution. Administrators should therefore understand that locate provides database-based searching rather than a guaranteed real-time filesystem scan.

Question: 294. What is a key characteristic of a symbolic link whose target has been removed?

  1. It automatically becomes a hard link
    2. It becomes an ordinary directory
    3. It becomes a dangling symbolic link
    4. It deletes every file in its directory

Correct Answer: 3. It becomes a dangling symbolic link

Explanation:

A symbolic link stores a pathname referring to another filesystem object. If that target is removed or moved so that the stored pathname no longer resolves to the intended object, the symbolic link becomes a dangling, or broken, symbolic link. The link itself can still exist in the filesystem even though its target cannot be followed successfully. This differs from a hard link, which directly references an inode and therefore generally remains valid as long as at least one hard link continues to reference that inode. Broken symbolic links can be identified and cleaned up during filesystem maintenance.

Question: 295. What is a defining characteristic of hard links on a typical Unix filesystem?

  1. They always point to another pathname
    2. They share the same inode as the original file
    3. They can always cross filesystem boundaries
    4. They must point only to directories

Correct Answer: 2. They share the same inode as the original file

Explanation:

A hard link is another directory entry referring to the same inode as an existing file. Because the filenames reference the same underlying inode, changes made through one hard link are visible through the other. The inode also maintains a link count indicating how many directory entries reference it. Hard links normally cannot cross filesystem boundaries because the referenced inode belongs to a particular filesystem. They are also generally not created for directories by ordinary users because doing so could create filesystem hierarchy problems. Understanding inode sharing is essential when distinguishing hard links from symbolic links.

Question: 296. Which mount option requests that a filesystem be mounted read-only?

  1. -o rw
    2. -o safe
    3. -o ro
    4. -o lock

Correct Answer: 3. -o ro

Explanation:

The -o ro mount option requests that the filesystem be mounted read-only. A read-only mount prevents normal write operations through that mounted filesystem, which can be useful for protecting data, examining a filesystem, or mounting media where modifications are not desired. The contrasting -o rw option requests read-write access. Mount behavior can also depend on filesystem type, kernel support, and other options. Read-only access should not be confused with Unix file permissions on individual files; mount options operate at the filesystem mount level.

Question: 297. Which ps option combination is commonly used to request a full-format listing of processes?

  1. ps -ef
    2. ps -xy
    3. ps -df
    4. ps -lfx

Correct Answer: 1. ps -ef

Explanation:

The ps -ef command is a commonly used form for displaying a full-format listing of running processes. The -e option selects processes across the system, while -f requests a full-format listing that includes useful fields such as user, process ID, parent process ID, start information, and the command. This makes the command useful when administrators need to inspect process relationships and identify which user started a process. Linux systems also support other ps syntaxes, but ps -ef is a widely recognized administrative form.

Question: 298. Which process state generally indicates that a process has been stopped, for example by a job-control signal?

  1. R
    2. Z
    3. S
    4. T

Correct Answer: 4. T

Explanation:

In Linux process status information, T generally indicates that a process is stopped or traced. A process can enter this state because of job-control signals such as those associated with suspending a foreground job, or because it is being traced. This differs from R, which indicates that the process is running or runnable, and S, which generally represents interruptible sleep. Z indicates a zombie process whose execution has ended but whose parent has not yet collected its exit status. Understanding process states helps administrators diagnose stopped, sleeping, running, and terminated processes.

Question: 299. Which shell command removes a job from the shell’s job table so that the shell no longer manages it as a job?

  1. detach
    2. disown
    3. release
    4. forget

Correct Answer: 2. disown

Explanation:

The disown shell builtin removes jobs from the shell’s job table. This can be useful when an administrator wants a background process to stop being associated with the shell’s job-control mechanisms. Depending on the shell and options used, disown can also help prevent the shell from sending certain notifications or signals to the job when the shell exits. It is different from kill, which sends signals to processes, and from bg or fg, which manipulate the execution state of jobs. disown is therefore primarily a job-control management command.

Question: 300. Which shell builtin waits for one or more background processes to finish and returns their status?

  1. wait
    2. pause
    3. sleep
    4. join

Correct Answer: 1. wait

Explanation:

The wait shell builtin allows a shell script or interactive shell to wait for one or more background processes to complete. When given a process ID or job-related identifier, it can wait for that particular process and obtain its exit status. With no specific identifier, it can wait for applicable asynchronous jobs managed by the shell. This is particularly important in scripts that launch several background operations but must ensure those operations finish before continuing. sleep merely delays execution for a specified period, while wait synchronizes execution with process completion.