LPI 101-500 Practice Test Questions and Exam Dumps Part 5 Q81-100

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

 

Question: 81. Which command removes a previously defined shell variable from the current shell environment?

  1. export
    2. unset
    3. env
    4. set

Correct Answer: 2. unset

Explanation:
The unset command removes a shell variable or function from the current shell environment. For example, unset MYVAR removes the variable named MYVAR. After it has been unset, attempting to reference $MYVAR normally produces an empty value unless the variable is defined again. This is different from export, which marks a shell variable for inheritance by child processes. The env command displays or modifies environment variables for a command invocation, while set is used to display or modify shell options and positional parameters. Understanding variable management is important for shell scripting and Linux command-line administration.

Question: 82. Which command creates a shortcut name for another shell command?

  1. alias
    2. type
    3. history
    4. source

Correct Answer: 1. alias

Explanation:
The alias command creates a convenient alternative name for a command or command sequence. For example, alias ll=’ls -l’ allows the user to type ll instead of the longer ls -l command. Aliases are commonly used in interactive shells to save typing and create preferred command shortcuts. They are normally shell-specific and may disappear when the shell session ends unless placed in an appropriate shell startup configuration file. The type command identifies how a command name is interpreted, history displays previously executed commands, and source executes commands from a file in the current shell.

Question: 83. Which command removes an existing shell alias?

  1. remove
    2. unalias
    3. unsetalias
    4. delete

Correct Answer: 2. unalias

Explanation:
The unalias command removes an alias from the current shell. For example, unalias ll removes an alias named ll. This is useful when a shortcut is no longer wanted or when troubleshooting unexpected command behavior caused by an alias. Using unalias normally affects the current shell session; if the alias is defined in a startup file, it may be recreated when a new shell starts. The unset command is used for shell variables and functions rather than aliases. Commands such as remove, unsetalias, and delete are not standard Bash commands for removing aliases.

Question: 84. Which shell command displays previously executed commands?

  1. recall
    2. commands
    3. history
    4. previous

Correct Answer: 3. history

Explanation:
The history command displays commands that have previously been entered into the shell’s command history. In Bash, the history mechanism allows users to review earlier commands and reuse them without typing everything again. For example, history may display numbered entries, and a command can often be recalled using shell history expansion or keyboard shortcuts. The history mechanism is especially useful when repeating administrative commands or reviewing recent command-line activity. Commands such as recall, commands, and previous are not standard Bash commands for displaying the shell history.

Question: 85. Which command can be used to determine how the shell interprets a command name?

  1. where
    2. locate
    3. whichfile
    4. type

Correct Answer: 4. type

Explanation:
The type command tells the shell how a command name would be interpreted. It can identify whether a name refers to an alias, shell builtin, function, keyword, or executable file. For example, type cd normally identifies cd as a shell builtin, while type ls can show the executable path or indicate that ls is an alias. This makes type particularly useful when troubleshooting situations where a command behaves unexpectedly. Although which can locate executable files in the PATH, it does not provide the same comprehensive information about shell command resolution as type.

Question: 86. Which command displays the shell’s list of recently executed commands?

  1. history
    2. lastcmd
    3. recent
    4. logcmd

Correct Answer: 1. history

Explanation:
The history command is the standard shell command for displaying previously entered commands. In an interactive Bash session, command history allows users to quickly review and reuse commands. It can be particularly useful when working with long command lines, troubleshooting, or repeating administrative tasks. The shell typically assigns numbers to history entries, which can then be referenced through history expansion or keyboard navigation. Commands named lastcmd, recent, and logcmd are not standard Bash commands for this purpose. The exact amount of stored history depends on shell configuration and variables such as HISTSIZE and HISTFILESIZE.

Question: 87. What does the jobs command display in a shell?

  1. All users logged into the system
    2. Files currently being modified
    3. Jobs controlled by the current shell
    4. Installed software packages

Correct Answer: 3. Jobs controlled by the current shell

Explanation:
The jobs command displays information about jobs that are being managed by the current interactive shell. These jobs are commonly created by placing commands in the background or suspending foreground processes. The output may show job numbers and states such as running or stopped. This job-control information can then be used with commands such as fg and bg. jobs does not list every process on the system, nor does it display logged-in users or installed packages. Understanding shell job control is important when managing multiple interactive tasks from a single terminal session.

Question: 88. Which command brings a stopped or background job into the foreground?

  1. bg
    2. fg
    3. front
    4. resume

Correct Answer: 2. fg

Explanation:
The fg command brings a job into the foreground of the current shell. For example, fg %1 can bring job number 1 to the foreground. Once in the foreground, the terminal normally becomes associated with that job, allowing it to receive interactive input. This is different from bg, which resumes a stopped job in the background. Shell job control uses job identifiers such as %1, while process IDs identify operating-system processes. The fg command is therefore useful when a command was previously suspended or started in the background and now needs to continue interactively.

Question: 89. Which command resumes a stopped shell job in the background?

  1. resume
    2. start
    3. fg
    4. bg

Correct Answer: 4. bg

Explanation:
The bg command resumes a stopped job while allowing it to continue running in the background. A common sequence is to press Ctrl+Z to suspend a foreground job and then use bg to continue that job without occupying the terminal interactively. A job number can be specified, such as bg %1. The fg command performs the opposite job-control operation by bringing a job into the foreground. This distinction is important when managing multiple commands from one shell, especially when some tasks need to continue running while the user works on other commands.

Question: 90. Which shell operator starts a command as a background job?

  1. &
    2. |
    3. >
    4. &&

Correct Answer: 1. &

Explanation:
The ampersand operator, &, causes a shell command to be started as a background job. For example, long_command & allows the shell to return a prompt while the command continues running. The shell normally assigns a job number and displays information about the associated process. This is different from &&, which conditionally runs a following command when the previous command succeeds. The pipe operator | connects the standard output of one command to the standard input of another, while > redirects output to a file. Understanding these operators is fundamental to effective shell usage.

Question: 91. Which command is commonly used to run a command so it can continue after the terminal session is disconnected?

  1. detach
    2. nohup
    3. persist
    4. keep

Correct Answer: 2. nohup

Explanation:
The nohup command runs another command while making it resistant to the hangup signal that is normally associated with closing a terminal session. It is commonly used for long-running commands that should continue after the user logs out. For example, nohup command & can start a command in the background while reducing its dependence on the terminal session. Output is commonly redirected to a file such as nohup.out when appropriate redirection is not explicitly provided. nohup does not make a process immortal or guarantee protection from every possible termination method; it specifically addresses hangup-related behavior.

Question: 92. What does PPID represent in Linux process information?

  1. 1. Primary Process Identifier
    Previous Program Input Data
    3. Parent Process ID
    4. Protected Process Index

Correct Answer: 3. Parent Process ID

Explanation:
PPID stands for Parent Process ID. Every process, with special system-level exceptions, is associated with a parent process that created it. The PPID identifies that parent process. This relationship is useful when examining process hierarchies and understanding how commands or services were started. The PID identifies the process itself, while the PPID identifies its parent. Tools such as ps can display both identifiers, allowing administrators to investigate process relationships. PPID should not be confused with terms such as Primary Process Identifier or Protected Process Index, which are not the standard meanings of PPID in Linux process management.

Question: 93. Which command displays the signals that can be sent to processes?

  1. kill -l
    2. signals
    3. signal-list
    4. kill –show

Correct Answer: 1. kill -l

Explanation:
The kill -l command lists the signal names and, depending on the implementation, their corresponding signal numbers. Signals provide a mechanism for communicating with processes. For example, administrators can use signals to request that a process terminate, stop, continue, or perform other signal-defined actions. The kill command is therefore not limited to forcibly terminating processes; its broader purpose is sending signals. The -l option specifically requests a list of available signals. Commands such as signals, signal-list, and kill –show are not the standard portable syntax for obtaining this signal list.

Question: 94. Which command changes the scheduling priority of an already running process?

  1. priority
    2. nice
    3. renice
    4. reprioritize

Correct Answer: 3. renice

Explanation:
The renice command changes the nice value, and therefore the scheduling priority, of processes that are already running. This is different from nice, which is commonly used when starting a new command with a specified nice value. Adjusting a process’s nice value can influence how much CPU scheduling preference it receives relative to other processes. Permission requirements apply when changing process priority, particularly when attempting to increase scheduling priority. renice is therefore useful for administrators managing CPU-intensive workloads. Commands named priority and reprioritize are not standard Linux commands for changing a running process’s nice value.

Question: 95. Which wildcard matches any sequence of zero or more characters in a shell pathname pattern?

  1. ?
    2. []
    3. *
    4. #

Correct Answer: 3. *

Explanation:
In standard shell pathname expansion, the asterisk * matches any sequence of characters, including an empty sequence, subject to the shell’s pathname expansion rules. For example, *.txt can match filenames ending in .txt. The question mark ? normally matches exactly one character, while bracket expressions such as [abc] match one character from the specified set or range. These patterns are expanded by the shell before the command receives its arguments. Understanding wildcard expansion is essential because the shell performs this expansion rather than the target command itself in the usual case.

Question: 96. Which wildcard normally matches exactly one character in shell pathname expansion?

  1. ?
    2. *
    3. []
    4. **

Correct Answer: 1. ?

Explanation:
The question mark ? is a shell pathname expansion pattern that normally matches exactly one character. For example, file?.txt can match file1.txt or fileA.txt, but it would not normally match file10.txt because that contains two characters in the position represented by ?. The asterisk * can match zero or more characters, while bracket expressions such as [abc] match one character from a specified set. Shell pattern matching should be distinguished from regular expressions because the syntax and behavior are not identical, even though both are commonly used for text and filename selection.

Question: 97. Which directory traditionally contains the Linux kernel and boot-related files?

  1. /opt
    2. /boot
    3. /srv
    4. /media

Correct Answer: 2. /boot

Explanation:
The /boot directory contains files needed during the system’s boot process. It commonly includes the Linux kernel, initial RAM filesystem images, and bootloader-related files, although exact contents vary by distribution and configuration. The /opt directory is traditionally used for optional add-on application software, /srv is intended for data served by system services, and /media is commonly used as a mount point for removable media. Understanding standard filesystem hierarchy locations helps administrators locate important system components and distinguish boot files from application, service, and removable-device data.

Question: 98. Which command is used to mount a filesystem in Linux?

  1. attach
    2. mount
    3. connectfs
    4. linkfs

Correct Answer: 2. mount

Explanation:
The mount command attaches a filesystem to the Linux directory tree at a specified mount point. For example, a filesystem can be mounted so that its contents become accessible through a directory such as /mnt/data. Linux uses a unified directory hierarchy, so filesystems are integrated into that hierarchy rather than being accessed through separate drive-letter conventions. The umount command performs the corresponding unmount operation. Proper permissions and filesystem details are required for successful mounting. Commands such as attach, connectfs, and linkfs are not standard Linux commands for mounting filesystems.

Question: 99. Which command displays block devices and their relationships in a tree-like format?

  1. lsblk
    2. blkshow
    3. devices
    4. disklist

Correct Answer: 1. lsblk

Explanation:
The lsblk command lists information about block devices and commonly presents their relationships in a tree-like structure. It can show disks, partitions, and related device information, making it useful when examining storage layouts. For example, it can help an administrator determine which partitions belong to which physical disks. This is different from commands focused on filesystem usage or free space. df reports filesystem space usage, while du estimates space used by files and directories. lsblk is therefore particularly useful during storage administration, partition identification, and troubleshooting device layouts.

Question: 100. Which command displays the amount of available and used memory in a human-readable form?

  1. memory
    2. ram
    3. meminfo
    4. free -h

Correct Answer: 4. free -h

Explanation:
The free command reports information about system memory, including used and available memory. The -h option requests human-readable units such as MiB or GiB, making the output easier to interpret. This command is useful when checking memory consumption and determining whether the system has sufficient available RAM. The /proc/meminfo file provides much more detailed memory information, but free -h offers a convenient summary. Commands such as memory and ram are not standard Linux commands for this purpose. Understanding memory reporting is useful for basic Linux performance monitoring and troubleshooting.