{"id":18613,"date":"2026-09-22T08:08:23","date_gmt":"2026-09-22T08:08:23","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=18613"},"modified":"2026-09-22T08:08:23","modified_gmt":"2026-09-22T08:08:23","slug":"lpi-101-500-practice-test-questions-and-exam-dumps-part-4-q61-80","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/lpi-101-500-practice-test-questions-and-exam-dumps-part-4-q61-80\/","title":{"rendered":"LPI 101-500 Practice Test Questions and Exam Dumps Part 4 Q61-80"},"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: 61. Which command is commonly used to view a text file one screen at a time with support for scrolling backward and forward?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">cat<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">echo<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">less<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> command is commonly used to view text files interactively, one screen at a time. Unlike <\/span><span style=\"font-weight: 400;\">cat<\/span><span style=\"font-weight: 400;\">, which normally sends an entire file directly to standard output, <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> allows the user to scroll forward and backward through the content. It is especially useful for examining large log files or configuration files without displaying everything at once. Users can search within the displayed content and navigate through the file using keyboard commands. The <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> command displays the beginning of a file, while <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> prints specified text. Therefore, <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> is the appropriate command for interactive text-file viewing.<\/span><\/p>\n<p><b>Question: 62. Which command sorts lines of text alphabetically by default?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">order<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">arrange<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">rank<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">sort<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"> command arranges lines of text according to specified sorting rules. By default, it performs a lexicographic sort, which generally means arranging lines according to their character order. It can also sort numerically, reverse the order, or use particular fields as sorting keys. For example, <\/span><span style=\"font-weight: 400;\">sort names.txt<\/span><span style=\"font-weight: 400;\"> produces sorted output from the lines in the file. The other commands listed are not standard Linux utilities for performing general text sorting. <\/span><span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"> is frequently combined with commands such as <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\"> when processing and analyzing text data. Understanding basic text-processing commands is an important Linux administration skill.<\/span><\/p>\n<p><b>Question: 63. Which command removes adjacent duplicate lines from sorted or appropriately grouped input?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">duplicate<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">unique<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">dedupe<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">uniq<\/span><\/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 is used to report or remove repeated adjacent lines from input. A common pattern is to combine <\/span><span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\">, such as <\/span><span style=\"font-weight: 400;\">sort names.txt | uniq<\/span><span style=\"font-weight: 400;\">, because <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\"> only identifies consecutive duplicate lines rather than searching the entire input for duplicates regardless of position. It also provides options for counting occurrences and displaying only repeated or unique lines. The commands <\/span><span style=\"font-weight: 400;\">duplicate<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">unique<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">dedupe<\/span><span style=\"font-weight: 400;\"> are not standard Linux utilities for this purpose. Understanding the relationship between <\/span><span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">uniq<\/span><span style=\"font-weight: 400;\"> is useful when processing lists, logs, and other structured text data.<\/span><\/p>\n<p><b>Question: 64. Which command can extract selected characters or fields from each line of text?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">cut<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">slice<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">field<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">extract<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">cut<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">cut<\/span><span style=\"font-weight: 400;\"> command extracts selected portions of each line of input. It can work with character positions, byte positions, or fields separated by a specified delimiter. For example, <\/span><span style=\"font-weight: 400;\">cut -d: -f1 \/etc\/passwd<\/span><span style=\"font-weight: 400;\"> can extract the first field from each colon-separated line. This makes <\/span><span style=\"font-weight: 400;\">cut<\/span><span style=\"font-weight: 400;\"> useful for processing structured text and command output. The commands <\/span><span style=\"font-weight: 400;\">slice<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">field<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">extract<\/span><span style=\"font-weight: 400;\"> are not standard general-purpose Linux replacements for <\/span><span style=\"font-weight: 400;\">cut<\/span><span style=\"font-weight: 400;\">. It is important to understand the difference between selecting character ranges and selecting delimiter-separated fields when using this command.<\/span><\/p>\n<p><b>Question: 65. Which command can translate or replace individual characters in a stream of text?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">replace<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">convert<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">tr<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">change<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">tr<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">tr<\/span><span style=\"font-weight: 400;\"> command translates, replaces, or deletes characters from standard input and writes the result to standard output. For example, <\/span><span style=\"font-weight: 400;\">tr &#8216;a-z&#8217; &#8216;A-Z&#8217;<\/span><span style=\"font-weight: 400;\"> can convert lowercase letters to uppercase letters. It can also remove selected characters using appropriate options. Because <\/span><span style=\"font-weight: 400;\">tr<\/span><span style=\"font-weight: 400;\"> normally operates on standard input rather than directly modifying a file, it is commonly used in pipelines. The commands <\/span><span style=\"font-weight: 400;\">replace<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">convert<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">change<\/span><span style=\"font-weight: 400;\"> are not standard Linux utilities serving this exact purpose. <\/span><span style=\"font-weight: 400;\">tr<\/span><span style=\"font-weight: 400;\"> is particularly useful for simple character-level transformations during shell scripting and text processing.<\/span><\/p>\n<p><b>Question: 66. Which command displays input on standard output while also writing it to one or more files?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">tee<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">split<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">copyout<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">duplicate<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">tee<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">tee<\/span><span style=\"font-weight: 400;\"> command reads data from standard input and writes it both to standard output and to one or more files. This is useful when a user wants to save command output while still seeing it in the terminal. For example, <\/span><span style=\"font-weight: 400;\">command | tee output.txt<\/span><span style=\"font-weight: 400;\"> displays the command&#8217;s output and simultaneously writes it to <\/span><span style=\"font-weight: 400;\">output.txt<\/span><span style=\"font-weight: 400;\">. With the appropriate option, <\/span><span style=\"font-weight: 400;\">tee<\/span><span style=\"font-weight: 400;\"> can append rather than overwrite a file. The commands <\/span><span style=\"font-weight: 400;\">split<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">copyout<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">duplicate<\/span><span style=\"font-weight: 400;\"> do not provide this standard pipeline behavior. <\/span><span style=\"font-weight: 400;\">tee<\/span><span style=\"font-weight: 400;\"> is therefore an important utility for shell pipelines and troubleshooting.<\/span><\/p>\n<p><b>Question: 67. Which command is commonly used to execute a command once for each item received from standard input?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">each<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">apply<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">xargs<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">foreach<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">xargs<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">xargs<\/span><span style=\"font-weight: 400;\"> command builds and executes commands using items supplied through standard input. It is particularly useful when the output of one command needs to become arguments for another command. For example, a list of filenames can be passed to another utility through a pipeline using <\/span><span style=\"font-weight: 400;\">xargs<\/span><span style=\"font-weight: 400;\">. Depending on its options and the input, <\/span><span style=\"font-weight: 400;\">xargs<\/span><span style=\"font-weight: 400;\"> can execute the target command multiple times, grouping arguments efficiently. The commands <\/span><span style=\"font-weight: 400;\">each<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">apply<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">foreach<\/span><span style=\"font-weight: 400;\"> are not standard Linux utilities providing this functionality. Care should be taken with filenames containing spaces or special characters, where appropriate quoting and null-delimited input may be needed.<\/span><\/p>\n<p><b>Question: 68. Which shell syntax performs command substitution and replaces the command with its output?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">${command}<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">$(command)<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">&lt;command&gt;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">[command]<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">$(command)<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">$(command)<\/span><span style=\"font-weight: 400;\"> syntax performs command substitution in common Unix shells. The shell executes the command inside the parentheses and substitutes its standard output into the surrounding command line. For example, <\/span><span style=\"font-weight: 400;\">echo &#8220;Today is $(date)&#8221;<\/span><span style=\"font-weight: 400;\"> executes <\/span><span style=\"font-weight: 400;\">date<\/span><span style=\"font-weight: 400;\"> and places its output into the string before <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> runs. Command substitution is widely used in shell scripts and interactive commands when the result of one command needs to become part of another command. Although older shell syntax using backticks can also perform command substitution, <\/span><span style=\"font-weight: 400;\">$(&#8230;)<\/span><span style=\"font-weight: 400;\"> is generally clearer and easier to nest.<\/span><\/p>\n<p><b>Question: 69. In a typical POSIX shell, which type of quotes prevents variable expansion and command substitution inside the quoted text?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> Double quotes <\/span><span style=\"font-weight: 400;\">&#8221; &#8220;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> Parentheses <\/span><span style=\"font-weight: 400;\">( )<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> Brackets <\/span><span style=\"font-weight: 400;\">[ ]<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b><span style=\"font-weight: 400;\"> Single quotes <\/span><span style=\"font-weight: 400;\">&#8216; &#8216;<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 4. Single quotes <\/span><span style=\"font-weight: 400;\">&#8216; &#8216;<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Single quotes preserve the literal meaning of almost all characters inside them in a POSIX shell. Variable references such as <\/span><span style=\"font-weight: 400;\">$HOME<\/span><span style=\"font-weight: 400;\"> and command substitutions such as <\/span><span style=\"font-weight: 400;\">$(date)<\/span><span style=\"font-weight: 400;\"> are not expanded when enclosed in single quotes. Double quotes provide protection from word splitting and pathname expansion but still allow variable expansion and command substitution. This distinction is important when constructing shell commands and scripts that contain special characters or literal dollar signs. Parentheses and brackets have other shell meanings and do not provide the same general quoting behavior. Therefore, single quotes are the correct answer for preventing these expansions.<\/span><\/p>\n<p><b>Question: 70. Which shell character is commonly used to escape the special meaning of the next character?<\/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;<\/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:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">\\<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The backslash character, <\/span><span style=\"font-weight: 400;\">\\<\/span><span style=\"font-weight: 400;\">, is commonly used by the shell to escape the special meaning of the character that follows it. For example, <\/span><span style=\"font-weight: 400;\">echo \\$HOME<\/span><span style=\"font-weight: 400;\"> can display the literal text <\/span><span style=\"font-weight: 400;\">$HOME<\/span><span style=\"font-weight: 400;\"> rather than expanding the variable. Similarly, a backslash can be used to include spaces or other special characters in appropriate shell contexts. The <\/span><span style=\"font-weight: 400;\">#<\/span><span style=\"font-weight: 400;\"> character commonly begins comments in shell scripts, <\/span><span style=\"font-weight: 400;\">&amp;<\/span><span style=\"font-weight: 400;\"> can be used for background execution, and <\/span><span style=\"font-weight: 400;\">@<\/span><span style=\"font-weight: 400;\"> has other contextual uses but is not the standard general-purpose escape character. Understanding escaping is essential when working with shell metacharacters and filenames.<\/span><\/p>\n<p><b>Question: 71. Which path represents an absolute path in Linux?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">documents\/report.txt<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">..\/report.txt<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">.\/report.txt<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">\/home\/user\/report.txt<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 4. <\/span><span style=\"font-weight: 400;\">\/home\/user\/report.txt<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">An absolute path begins at the root directory, represented by <\/span><span style=\"font-weight: 400;\">\/<\/span><span style=\"font-weight: 400;\">, and identifies a location independently of the user&#8217;s current working directory. <\/span><span style=\"font-weight: 400;\">\/home\/user\/report.txt<\/span><span style=\"font-weight: 400;\"> is therefore an absolute path because it starts from the root and provides the complete path to the file. In contrast, <\/span><span style=\"font-weight: 400;\">documents\/report.txt<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">..\/report.txt<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">.\/report.txt<\/span><span style=\"font-weight: 400;\"> are relative paths whose meanings depend on the current working directory. Understanding the difference is important when writing shell commands and scripts because absolute paths provide a fixed reference while relative paths depend on where the command is executed.<\/span><\/p>\n<p><b>Question: 72. Which command creates a hard link to an existing file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">ln<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">linkfile<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">ln -s<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">hardlink<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">ln<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">ln<\/span><span style=\"font-weight: 400;\"> command creates links between filesystem directory entries and files. When used without the <\/span><span style=\"font-weight: 400;\">-s<\/span><span style=\"font-weight: 400;\"> option, <\/span><span style=\"font-weight: 400;\">ln<\/span><span style=\"font-weight: 400;\"> normally creates a hard link. A hard link refers to the same underlying inode as the original file, so both directory entries refer to the same file data. By contrast, <\/span><span style=\"font-weight: 400;\">ln -s<\/span><span style=\"font-weight: 400;\"> creates a symbolic link, which stores a path referring to another file or directory. The commands <\/span><span style=\"font-weight: 400;\">linkfile<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">hardlink<\/span><span style=\"font-weight: 400;\"> are not the standard general-purpose Linux commands for creating hard links. Hard links generally cannot cross filesystem boundaries and have restrictions concerning directories.<\/span><\/p>\n<p><b>Question: 73. Which command displays detailed metadata about a file, including information such as its inode, permissions, size, and timestamps?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">metadata<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">stat<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">fileinfo<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">details<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">stat<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">stat<\/span><span style=\"font-weight: 400;\"> command displays detailed information about a file or filesystem object. Its output can include the file size, inode number, permissions, ownership, timestamps, and file type. This makes <\/span><span style=\"font-weight: 400;\">stat<\/span><span style=\"font-weight: 400;\"> useful when ordinary directory listings do not provide enough information for troubleshooting or administration. The <\/span><span style=\"font-weight: 400;\">file<\/span><span style=\"font-weight: 400;\"> command can identify the general type of a file, but it does not provide the same detailed metadata. <\/span><span style=\"font-weight: 400;\">metadata<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">fileinfo<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">details<\/span><span style=\"font-weight: 400;\"> are not the standard Linux command represented here. Therefore, <\/span><span style=\"font-weight: 400;\">stat<\/span><span style=\"font-weight: 400;\"> is the correct utility for examining detailed filesystem metadata.<\/span><\/p>\n<p><b>Question: 74. Which command extracts the final component of a pathname?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">pathpart<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">dirname<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">basename<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">lastpath<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">basename<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">basename<\/span><span style=\"font-weight: 400;\"> command extracts the final component of a pathname. For example, <\/span><span style=\"font-weight: 400;\">basename \/home\/user\/report.txt<\/span><span style=\"font-weight: 400;\"> returns <\/span><span style=\"font-weight: 400;\">report.txt<\/span><span style=\"font-weight: 400;\">. This is useful in shell scripts when a script needs to separate a filename from the directory portion of a path. The complementary <\/span><span style=\"font-weight: 400;\">dirname<\/span><span style=\"font-weight: 400;\"> command extracts the directory portion instead. The commands <\/span><span style=\"font-weight: 400;\">pathpart<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">lastpath<\/span><span style=\"font-weight: 400;\"> are not standard Linux utilities for this purpose. Understanding <\/span><span style=\"font-weight: 400;\">basename<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">dirname<\/span><span style=\"font-weight: 400;\"> is useful for manipulating paths without manually processing strings in shell scripts.<\/span><\/p>\n<p><b>Question: 75. Which command outputs a specified string or the value of a variable to standard output?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">display<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">printtext<\/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:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">echo<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> command writes specified text or expanded variable values to standard output. It is commonly used interactively and within shell scripts to display messages or simple values. For example, <\/span><span style=\"font-weight: 400;\">echo &#8220;$HOME&#8221;<\/span><span style=\"font-weight: 400;\"> displays the value of the <\/span><span style=\"font-weight: 400;\">HOME<\/span><span style=\"font-weight: 400;\"> environment variable. Shell implementations may provide <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> as a builtin, and its behavior for certain escape sequences can vary between implementations, which is one reason <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\"> is often preferred for portable formatted output. Nevertheless, <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> remains a fundamental command for basic shell output. The other listed commands are not standard general-purpose replacements for <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><b>Question: 76. Which command is generally preferred for portable formatted output in shell scripts?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">display<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">format<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">echo<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">printf<\/span><\/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;\"> command provides formatted output and is generally preferred over <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> when predictable behavior is important in shell scripts. It supports format specifications such as <\/span><span style=\"font-weight: 400;\">%s<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">%d<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">%f<\/span><span style=\"font-weight: 400;\">, allowing scripts to control how values are displayed. For example, <\/span><span style=\"font-weight: 400;\">printf &#8220;User: %s\\n&#8221; &#8220;$USER&#8221;<\/span><span style=\"font-weight: 400;\"> produces predictable formatted output. Although <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> is convenient for simple messages, its handling of certain options and escape sequences can vary among implementations. <\/span><span style=\"font-weight: 400;\">printf<\/span><span style=\"font-weight: 400;\"> follows well-defined formatting behavior and is therefore particularly useful in portable shell scripting. The other choices are not standard replacements for formatted shell output.<\/span><\/p>\n<p><b>Question: 77. Which command makes a shell variable available to programs started from that shell?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">export<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">share<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">envset<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">publish<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">export<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">export<\/span><span style=\"font-weight: 400;\"> command marks a shell variable so that it becomes part of the environment inherited by subsequently executed child processes. For example, <\/span><span style=\"font-weight: 400;\">export EDITOR=vim<\/span><span style=\"font-weight: 400;\"> makes the <\/span><span style=\"font-weight: 400;\">EDITOR<\/span><span style=\"font-weight: 400;\"> variable available to programs launched from that shell. A variable that has been assigned without being exported normally remains a shell variable and is not automatically inherited by child processes. The commands <\/span><span style=\"font-weight: 400;\">share<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">envset<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">publish<\/span><span style=\"font-weight: 400;\"> are not standard shell commands for exporting variables. Understanding the distinction between shell variables and environment variables is important when configuring programs and writing shell scripts.<\/span><\/p>\n<p><b>Question: 78. Which command can display the environment variables available to a command or shell?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">vars<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">environment<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">env<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">showenv<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">env<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">env<\/span><span style=\"font-weight: 400;\"> command can display the environment variables associated with the current execution environment. It can also be used to run a command with a modified environment. For example, running <\/span><span style=\"font-weight: 400;\">env<\/span><span style=\"font-weight: 400;\"> without arguments generally displays environment variable assignments such as <\/span><span style=\"font-weight: 400;\">HOME<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">PATH<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">USER<\/span><span style=\"font-weight: 400;\">. Environment variables differ from ordinary shell variables because exported variables are inherited by child processes. The commands <\/span><span style=\"font-weight: 400;\">vars<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">environment<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">showenv<\/span><span style=\"font-weight: 400;\"> are not the standard Linux utility represented here. Therefore, <\/span><span style=\"font-weight: 400;\">env<\/span><span style=\"font-weight: 400;\"> is the correct command for viewing or manipulating the execution environment.<\/span><\/p>\n<p><b>Question: 79. Which shell variable contains the exit status of the most recently executed foreground command?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">$STATUS<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">$EXIT<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">$RESULT<\/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:<\/b><span style=\"font-weight: 400;\"> 4. <\/span><span style=\"font-weight: 400;\">$?<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The special shell parameter <\/span><span style=\"font-weight: 400;\">$?<\/span><span style=\"font-weight: 400;\"> contains the exit status returned by the most recently executed foreground pipeline or command, depending on the shell context. A value of <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\"> conventionally indicates successful completion, while a nonzero value generally indicates some form of failure or special condition. Scripts can test this value to make decisions based on whether a previous command succeeded. For example, <\/span><span style=\"font-weight: 400;\">command; echo $?<\/span><span style=\"font-weight: 400;\"> can display the command&#8217;s exit status. <\/span><span style=\"font-weight: 400;\">$STATUS<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">$EXIT<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">$RESULT<\/span><span style=\"font-weight: 400;\"> are not the standard special parameter used by POSIX shells for this purpose.<\/span><\/p>\n<p><b>Question: 80. Which shell operator executes the command on the right only if the command on the left 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:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">&amp;&amp;<\/span><\/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 allows commands to be conditionally chained so that the command on the right is executed only when the command on the left returns a successful exit status. For example, <\/span><span style=\"font-weight: 400;\">mkdir test &amp;&amp; cd test<\/span><span style=\"font-weight: 400;\"> attempts to change into the directory only if creating the directory succeeds. The <\/span><span style=\"font-weight: 400;\">||<\/span><span style=\"font-weight: 400;\"> operator provides the opposite conditional behavior, executing the right-hand command when the left-hand command fails. The pipe <\/span><span style=\"font-weight: 400;\">|<\/span><span style=\"font-weight: 400;\"> connects standard output to standard input, while <\/span><span style=\"font-weight: 400;\">;;<\/span><span style=\"font-weight: 400;\"> has specific uses within shell constructs such as <\/span><span style=\"font-weight: 400;\">case<\/span><span style=\"font-weight: 400;\">. Therefore, <\/span><span style=\"font-weight: 400;\">&amp;&amp;<\/span><span style=\"font-weight: 400;\"> is the correct operator for success-based command chaining.<\/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: 61. Which command is commonly used to view a text file one screen at a time with support for scrolling backward and forward? less 2. cat 3. head 4. echo Correct Answer: 1. less Explanation: The less command is commonly used to view [&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\/18613"}],"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=18613"}],"version-history":[{"count":2,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18613\/revisions"}],"predecessor-version":[{"id":18615,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18613\/revisions\/18615"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=18613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=18613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=18613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}