{"id":18636,"date":"2026-09-22T08:57:14","date_gmt":"2026-09-22T08:57:14","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=18636"},"modified":"2026-09-22T08:57:14","modified_gmt":"2026-09-22T08:57:14","slug":"lpi-101-500-practice-test-questions-and-exam-dumps-part-16-q301-320","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/lpi-101-500-practice-test-questions-and-exam-dumps-part-16-q301-320\/","title":{"rendered":"LPI 101-500 Practice Test Questions and Exam Dumps Part 16 Q301-320"},"content":{"rendered":"<p><b>View Full<\/b> <a href=\"https:\/\/www.examlabs.com\/101-500-exam-dumps\"><b>LPI 101-500<\/b><b> Exam Dumps<\/b><\/a><b> and Practice Test Dumps<\/b><\/p>\n<p>&nbsp;<\/p>\n<p><b>Question: 301. Which command can display all available locations of a command found through the shell&#8217;s command lookup mechanism?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">command -l<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">whereis -a<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">locate -c<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">type -a<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 4. type -a<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">type -a<\/span><span style=\"font-weight: 400;\"> shell command can display all locations or definitions that the shell associates with a command name. This is useful when more than one executable with the same name exists in different directories in the user&#8217;s <\/span><span style=\"font-weight: 400;\">PATH<\/span><span style=\"font-weight: 400;\">. It can also reveal aliases, builtins, functions, or other command interpretations depending on the shell and command being examined. This differs from <\/span><span style=\"font-weight: 400;\">which<\/span><span style=\"font-weight: 400;\">, which commonly reports an executable path, although its behavior can vary between implementations. <\/span><span style=\"font-weight: 400;\">type -a<\/span><span style=\"font-weight: 400;\"> is therefore useful for understanding exactly how a shell resolves a command name.<\/span><\/p>\n<p><b>Question: 302. Which command can be used to determine how the current shell interprets a command name?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">type<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">resolve<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">inspect<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">lookup<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. type<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">type<\/span><span style=\"font-weight: 400;\"> shell builtin identifies how a command name is interpreted by the current shell. It can indicate whether a name refers to an alias, shell builtin, function, keyword, or executable file. This makes it useful when troubleshooting unexpected command behavior. For example, if a command appears to execute a different program than expected, <\/span><span style=\"font-weight: 400;\">type<\/span><span style=\"font-weight: 400;\"> can reveal whether an alias or function is overriding the expected executable. It is more informative in this context than simply inspecting the <\/span><span style=\"font-weight: 400;\">PATH<\/span><span style=\"font-weight: 400;\">, because command resolution can involve several shell-specific mechanisms beyond searching executable directories.<\/span><\/p>\n<p><b>Question: 303. What does <\/b><b>grep -v<\/b><b> do?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> Searches only binary files<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> Displays only matching lines<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> Displays lines that do not match the pattern<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b><span style=\"font-weight: 400;\"> Replaces matching text<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. Displays lines that do not match the pattern<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-v<\/span><span style=\"font-weight: 400;\"> option of <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\"> inverts the normal matching behavior. Instead of displaying lines that match the supplied pattern, <\/span><span style=\"font-weight: 400;\">grep -v<\/span><span style=\"font-weight: 400;\"> displays lines that do not match it. This is useful when filtering unwanted entries from command output or text files. For example, an administrator can use <\/span><span style=\"font-weight: 400;\">grep -v &#8216;^#&#8217;<\/span><span style=\"font-weight: 400;\"> to remove comment lines from output when examining configuration content. The option does not modify the original file. It simply changes which lines are selected for output. Combining <\/span><span style=\"font-weight: 400;\">-v<\/span><span style=\"font-weight: 400;\"> with other <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\"> options can create powerful text-filtering commands.<\/span><\/p>\n<p><b>Question: 304. Which <\/b><b>grep<\/b><b> option enables extended regular expressions?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">-x<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">-E<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">-R<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">-P<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. -E<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-E<\/span><span style=\"font-weight: 400;\"> option tells <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\"> to interpret the supplied pattern as an extended regular expression. Extended regular expressions provide additional operators that make certain patterns easier to express without requiring as many escape characters. For example, alternation can be expressed using <\/span><span style=\"font-weight: 400;\">|<\/span><span style=\"font-weight: 400;\">, and grouping can be performed with parentheses in extended regular-expression syntax. Basic <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\"> uses basic regular expressions by default. The <\/span><span style=\"font-weight: 400;\">-R<\/span><span style=\"font-weight: 400;\"> option instead performs recursive searching, while <\/span><span style=\"font-weight: 400;\">-x<\/span><span style=\"font-weight: 400;\"> requires an entire line to match. Understanding <\/span><span style=\"font-weight: 400;\">-E<\/span><span style=\"font-weight: 400;\"> is useful when constructing more sophisticated text-search patterns.<\/span><\/p>\n<p><b>Question: 305. Which shell keyword can be used to mark a variable as read-only?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">constant<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">fixed<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">readonly<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">protect<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. readonly<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">readonly<\/span><span style=\"font-weight: 400;\"> shell builtin marks a shell variable so that its value cannot normally be changed or unset during the lifetime of that shell. For example, <\/span><span style=\"font-weight: 400;\">readonly VERSION=1<\/span><span style=\"font-weight: 400;\"> creates a variable whose value is protected from later assignment. Read-only variables can be useful when a script needs to ensure that an important configuration value is not accidentally overwritten. This feature applies to shell variables and is enforced by the shell. It should not be confused with filesystem permissions, which control access to files and directories rather than whether a shell variable can be reassigned.<\/span><\/p>\n<p><b>Question: 306. Which shell option causes an unset variable to produce an error when expanded?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">set -u<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">set -x<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">set -n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">set -v<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. set -u<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">set -u<\/span><span style=\"font-weight: 400;\"> shell option enables treatment of unset variables as errors when they are expanded, with some shell-specific exceptions. This can help identify typographical errors and missing variables in shell scripts. Without this option, an unset variable commonly expands to an empty string, which can sometimes cause a script to continue with unintended values. <\/span><span style=\"font-weight: 400;\">set -x<\/span><span style=\"font-weight: 400;\"> instead traces commands as they are executed, while <\/span><span style=\"font-weight: 400;\">set -v<\/span><span style=\"font-weight: 400;\"> displays shell input lines. Using <\/span><span style=\"font-weight: 400;\">set -u<\/span><span style=\"font-weight: 400;\"> is therefore a useful defensive programming technique when scripts depend on variables that must be defined.<\/span><\/p>\n<p><b>Question: 307. Which command executes a shell script in the current shell environment rather than starting a separate shell process for the script?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">run<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">execfile<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">source<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">launch<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. source<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">source<\/span><span style=\"font-weight: 400;\"> command reads and executes commands from a file in the current shell environment. The shorthand <\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\"> can also perform this operation in POSIX-compatible shells. This distinction matters because variables, functions, aliases, and other shell state created or modified by the sourced file can remain available in the current shell afterward. Running a script as a separate executable normally gives it its own shell environment, so changes to variables do not automatically affect the parent shell. <\/span><span style=\"font-weight: 400;\">source<\/span><span style=\"font-weight: 400;\"> is frequently used for loading shell configuration files and environment-setting scripts.<\/span><\/p>\n<p><b>Question: 308. Which command can display the value of a shell variable using formatted output?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">format<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">display<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">show<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. printf<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\"> shell builtin produces formatted output and provides more predictable formatting control than many uses of <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\">. It supports format strings and conversion specifications, allowing scripts to control spacing, numeric formatting, and line endings precisely. For example, <\/span><span style=\"font-weight: 400;\">printf &#8216;%s\\n&#8217; &#8220;$HOME&#8221;<\/span><span style=\"font-weight: 400;\"> can safely display the value of the <\/span><span style=\"font-weight: 400;\">HOME<\/span><span style=\"font-weight: 400;\"> variable followed by a newline. This makes <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\"> particularly useful in shell scripts where consistent output is important. Although <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> is convenient for simple messages, <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\"> is generally preferred when precise formatting or reliable handling of special characters is required.<\/span><\/p>\n<p><b>Question: 309. What does the <\/b><b>uniq<\/b><b> command normally do when processing sorted input containing repeated lines?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> Deletes the input file<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> Combines adjacent identical lines into a single displayed line<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> Sorts the lines alphabetically<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b><span style=\"font-weight: 400;\"> Converts all lines to lowercase<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. Combines adjacent identical lines into a single displayed line<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\"> command removes repeated adjacent lines from its output. It does not independently sort its input, which is why <\/span><span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"> is commonly used before <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\"> when the goal is to identify duplicate lines throughout an entire file. For example, <\/span><span style=\"font-weight: 400;\">sort names.txt | uniq<\/span><span style=\"font-weight: 400;\"> can consolidate identical entries that were originally separated in the file. <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\"> also provides options for counting repeated lines and selecting specific occurrences. Its key behavior is based on adjacent identical lines, so understanding that limitation is important when designing text-processing pipelines.<\/span><\/p>\n<p><b>Question: 310. Which option makes <\/b><b>grep<\/b><b> report the number of matching lines rather than displaying the matching lines themselves?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">-l<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">-m<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">-n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">-c<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 4. -c<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-c<\/span><span style=\"font-weight: 400;\"> option causes <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\"> to report a count of matching lines for each input file instead of displaying the matching lines themselves. This is useful when an administrator needs to determine how frequently a condition occurs without processing the complete matching output. The <\/span><span style=\"font-weight: 400;\">-n<\/span><span style=\"font-weight: 400;\"> option adds line numbers to matching lines, while <\/span><span style=\"font-weight: 400;\">-l<\/span><span style=\"font-weight: 400;\"> reports filenames containing matches. The count produced by <\/span><span style=\"font-weight: 400;\">-c<\/span><span style=\"font-weight: 400;\"> represents matching lines rather than necessarily counting every occurrence of a pattern within each line. This distinction is important when interpreting search results programmatically.<\/span><\/p>\n<p><b>Question: 311. Which <\/b><b>sed<\/b><b> expression replaces the first occurrence of <\/b><b>old<\/b><b> with <\/b><b>new<\/b><b> on each processed line?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">sed &#8216;s\/old\/new\/&#8217;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">sed &#8216;r\/old\/new\/&#8217;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">sed &#8216;c\/old\/new\/&#8217;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">sed &#8216;x\/old\/new\/&#8217;<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 4. sed &#8216;s\/old\/new\/&#8217;<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">s<\/span><span style=\"font-weight: 400;\"> command in <\/span><span style=\"font-weight: 400;\">sed<\/span><span style=\"font-weight: 400;\"> performs substitution. The expression <\/span><span style=\"font-weight: 400;\">s\/old\/new\/<\/span><span style=\"font-weight: 400;\"> searches each processed line for the first occurrence of <\/span><span style=\"font-weight: 400;\">old<\/span><span style=\"font-weight: 400;\"> and replaces it with <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\">. By default, the substitution affects the first matching occurrence on each line; adding the <\/span><span style=\"font-weight: 400;\">g<\/span><span style=\"font-weight: 400;\"> flag causes all matching occurrences on a line to be replaced. Unless an in-place editing option is used, <\/span><span style=\"font-weight: 400;\">sed<\/span><span style=\"font-weight: 400;\"> normally writes the transformed content to standard output rather than changing the original file. This makes substitution useful in pipelines and scripts where modified output needs to be inspected or redirected.<\/span><\/p>\n<p><b>Question: 312. Which <\/b><b>awk<\/b><b> option specifies the input field separator?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">-O<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">-F<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">-I<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">-S<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. -F<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-F<\/span><span style=\"font-weight: 400;\"> option specifies the field separator that <\/span><span style=\"font-weight: 400;\">awk<\/span><span style=\"font-weight: 400;\"> should use when splitting input records into fields. For example, <\/span><span style=\"font-weight: 400;\">awk -F: &#8216;{print $1}&#8217; \/etc\/passwd<\/span><span style=\"font-weight: 400;\"> treats the colon character as the separator and prints the first field from each record. By default, <\/span><span style=\"font-weight: 400;\">awk<\/span><span style=\"font-weight: 400;\"> commonly treats runs of whitespace as field separators. Explicitly specifying a separator is particularly useful when processing structured text such as colon-separated configuration or account files. The separator can be a literal character or an appropriate regular-expression pattern depending on the <\/span><span style=\"font-weight: 400;\">awk<\/span><span style=\"font-weight: 400;\"> implementation and command being used.<\/span><\/p>\n<p><b>Question: 313. What does <\/b><b>sort -r<\/b><b> do?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> Removes duplicate lines<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> Sorts lines in reverse order<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> Sorts only numeric values<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b><span style=\"font-weight: 400;\"> Randomizes the input<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. Sorts lines in reverse order<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-r<\/span><span style=\"font-weight: 400;\"> option reverses the normal ordering used by <\/span><span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\">. For a standard lexical sort, this means entries are presented in descending rather than ascending order. The option can also be combined with other sorting options. For example, <\/span><span style=\"font-weight: 400;\">sort -nr<\/span><span style=\"font-weight: 400;\"> performs a numeric sort in reverse order, which is useful when placing the largest numbers first. <\/span><span style=\"font-weight: 400;\">sort -r<\/span><span style=\"font-weight: 400;\"> does not remove duplicate entries or randomize data. Duplicate removal is commonly associated with <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\">, while randomization requires a different tool or approach. Understanding option combinations is important when constructing shell pipelines.<\/span><\/p>\n<p><b>Question: 314. Which command combines corresponding lines from two files side by side?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">merge<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">join<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">paste<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">combine<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. paste<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">paste<\/span><span style=\"font-weight: 400;\"> command combines lines from multiple files and writes them side by side, normally separated by a tab character. For example, <\/span><span style=\"font-weight: 400;\">paste names.txt departments.txt<\/span><span style=\"font-weight: 400;\"> can produce output where the first line of one file appears alongside the first line of the other file. This differs from <\/span><span style=\"font-weight: 400;\">join<\/span><span style=\"font-weight: 400;\">, which combines lines based on a common field and is more closely related to relational data processing. <\/span><span style=\"font-weight: 400;\">paste<\/span><span style=\"font-weight: 400;\"> is useful for simple column-oriented combinations where corresponding line positions are important. Options can also change the delimiter or alter how input files are combined.<\/span><\/p>\n<p><b>Question: 315. Which option controls the maximum number of arguments passed to each command invocation by <\/b><b>xargs<\/b><b>?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">-n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">-d<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">-p<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">-t<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. -n<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-n<\/span><span style=\"font-weight: 400;\"> option of <\/span><span style=\"font-weight: 400;\">xargs<\/span><span style=\"font-weight: 400;\"> specifies the maximum number of arguments that should be passed to each invocation of the command being executed. This can be useful when a command should process input in manageable groups rather than receiving every item at once. For example, <\/span><span style=\"font-weight: 400;\">xargs -n 2 command<\/span><span style=\"font-weight: 400;\"> attempts to invoke <\/span><span style=\"font-weight: 400;\">command<\/span><span style=\"font-weight: 400;\"> with up to two input arguments per invocation. Other <\/span><span style=\"font-weight: 400;\">xargs<\/span><span style=\"font-weight: 400;\"> options serve different purposes, such as selecting delimiters, prompting before execution, or displaying commands. Proper use of <\/span><span style=\"font-weight: 400;\">-n<\/span><span style=\"font-weight: 400;\"> can make batch processing more controlled and predictable.<\/span><\/p>\n<p><b>Question: 316. Which option makes <\/b><b>tee<\/b><b> append output to a file instead of replacing its existing contents?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">-r<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">-a<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">-p<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">-n<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 4. -a<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-a<\/span><span style=\"font-weight: 400;\"> option causes <\/span><span style=\"font-weight: 400;\">tee<\/span><span style=\"font-weight: 400;\"> to append its output to the specified file instead of overwriting the file&#8217;s existing contents. <\/span><span style=\"font-weight: 400;\">tee<\/span><span style=\"font-weight: 400;\"> is useful when a command&#8217;s output needs to continue through a pipeline while also being saved to a file. For example, a command can send output through <\/span><span style=\"font-weight: 400;\">tee -a logfile<\/span><span style=\"font-weight: 400;\">, allowing the output to remain available to later pipeline stages while being appended to the log. Without <\/span><span style=\"font-weight: 400;\">-a<\/span><span style=\"font-weight: 400;\">, the specified file is normally overwritten. This makes the append option especially useful for accumulating command output over multiple operations.<\/span><\/p>\n<p><b>Question: 317. Which shell builtin is commonly used to pause execution until a specified background process completes?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">wait<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">hold<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">sleep<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">pause<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. wait<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">wait<\/span><span style=\"font-weight: 400;\"> builtin synchronizes a shell script with background processes. When a script launches a command asynchronously using <\/span><span style=\"font-weight: 400;\">&amp;<\/span><span style=\"font-weight: 400;\">, the shell can continue immediately. If the script later needs to ensure that the background operation has completed, <\/span><span style=\"font-weight: 400;\">wait<\/span><span style=\"font-weight: 400;\"> can be used with the relevant process ID or job specification. The command can also return the exit status of the process it waited for, allowing a script to react to success or failure. This differs from <\/span><span style=\"font-weight: 400;\">sleep<\/span><span style=\"font-weight: 400;\">, which merely delays execution for a period and does not verify whether a particular background process has finished.<\/span><\/p>\n<p><b>Question: 318. What does <\/b><b>fg %1<\/b><b> normally do in a shell with job control enabled?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> Terminates job 1<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> Lists job 1<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> Brings job 1 to the foreground<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b><span style=\"font-weight: 400;\"> Deletes job 1 from the job table<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. Brings job 1 to the foreground<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">fg<\/span><span style=\"font-weight: 400;\"> shell builtin brings a stopped or background job into the foreground. The <\/span><span style=\"font-weight: 400;\">%1<\/span><span style=\"font-weight: 400;\"> notation identifies job number 1 in the shell&#8217;s job-control table. When a job is brought to the foreground, the terminal becomes associated with that job, allowing interactive input and job-control signals to be directed to it. This differs from <\/span><span style=\"font-weight: 400;\">bg<\/span><span style=\"font-weight: 400;\">, which resumes a stopped job in the background. <\/span><span style=\"font-weight: 400;\">jobs<\/span><span style=\"font-weight: 400;\"> is used to list managed jobs, while <\/span><span style=\"font-weight: 400;\">disown<\/span><span style=\"font-weight: 400;\"> can remove a job from the shell&#8217;s job table. Job specifications such as <\/span><span style=\"font-weight: 400;\">%1<\/span><span style=\"font-weight: 400;\"> are shell-specific job-control notation.<\/span><\/p>\n<p><b>Question: 319. Which command can display only the number of lines in a text file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">wc -w<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">wc -c<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">wc -m<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">wc -l<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 4. wc -l<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">wc -l<\/span><span style=\"font-weight: 400;\"> command counts newline characters and is commonly used to report the number of lines in a text file. This is useful for quickly determining the approximate record count of line-oriented data or verifying the size of generated output. The related <\/span><span style=\"font-weight: 400;\">wc -w<\/span><span style=\"font-weight: 400;\"> option counts words, <\/span><span style=\"font-weight: 400;\">wc -c<\/span><span style=\"font-weight: 400;\"> counts bytes, and <\/span><span style=\"font-weight: 400;\">wc -m<\/span><span style=\"font-weight: 400;\"> counts characters where supported. The distinction between bytes and characters can matter with multibyte encodings. In normal text-processing tasks, <\/span><span style=\"font-weight: 400;\">wc -l<\/span><span style=\"font-weight: 400;\"> is a simple and widely used way to obtain a line count.<\/span><\/p>\n<p><b>Question: 320. Which shell feature allows a command to continue only when the preceding command succeeds?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">||<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">&amp;&amp;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">;;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">|<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. &amp;&amp;<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">&amp;&amp;<\/span><span style=\"font-weight: 400;\"> operator connects two commands so that the second command is executed only if the first command exits successfully, normally with an exit status of zero. This is useful for conditional command execution in shell scripts and interactive administration. For example, <\/span><span style=\"font-weight: 400;\">mkdir project &amp;&amp; cd project<\/span><span style=\"font-weight: 400;\"> attempts to change into the directory only if the directory creation succeeds. The <\/span><span style=\"font-weight: 400;\">||<\/span><span style=\"font-weight: 400;\"> operator provides the opposite style of conditional behavior by executing the following command when the preceding command fails. The pipe operator <\/span><span style=\"font-weight: 400;\">|<\/span><span style=\"font-weight: 400;\"> instead connects standard output from one command to standard input of another.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>View Full LPI 101-500 Exam Dumps and Practice Test Dumps &nbsp; Question: 301. Which command can display all available locations of a command found through the shell&#8217;s command lookup mechanism? command -l 2. whereis -a 3. locate -c 4. type -a Correct Answer: 4. type -a Explanation: The type -a shell command can display all [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1648,1647],"tags":[],"_links":{"self":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18636"}],"collection":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/comments?post=18636"}],"version-history":[{"count":1,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18636\/revisions"}],"predecessor-version":[{"id":18637,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18636\/revisions\/18637"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=18636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=18636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=18636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}