{"id":18609,"date":"2026-09-22T08:07:13","date_gmt":"2026-09-22T08:07:13","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=18609"},"modified":"2026-09-22T08:07:13","modified_gmt":"2026-09-22T08:07:13","slug":"lpi-101-500-practice-test-questions-and-exam-dumps-part-2-q21-40","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/lpi-101-500-practice-test-questions-and-exam-dumps-part-2-q21-40\/","title":{"rendered":"LPI 101-500 Practice Test Questions and Exam Dumps Part 2 Q21-40"},"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: 21. Which command is used to display the first lines of a text file by default?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">more<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">head<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 4. <\/span><span style=\"font-weight: 400;\">head<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> command displays the beginning of a file or standard input. By default, it normally displays the first 10 lines. The number of lines can be changed with an option such as <\/span><span style=\"font-weight: 400;\">head -n 20 file.txt<\/span><span style=\"font-weight: 400;\">, which displays the first 20 lines. This makes <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> useful when quickly inspecting the beginning of logs, configuration files, scripts, or other text documents. The <\/span><span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"> command works primarily with the end of a file, while <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">more<\/span><span style=\"font-weight: 400;\"> are interactive pagers for viewing larger amounts of text. Therefore, <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> is the appropriate command when the requirement is to display the beginning of a file.<\/span><\/p>\n<p><b>Question: 22. Which command is normally used to display the last lines of a text file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">lastline<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">begin<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">tail<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"> command displays the end of a file or stream. Like <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\">, it normally displays 10 lines by default, but the number can be controlled with options. A particularly important feature is <\/span><span style=\"font-weight: 400;\">tail -f<\/span><span style=\"font-weight: 400;\">, which continuously follows a file as new data is appended. This is frequently useful when monitoring log files while a service or application is running. The <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> command displays the beginning rather than the end of a file. <\/span><span style=\"font-weight: 400;\">begin<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">lastline<\/span><span style=\"font-weight: 400;\"> are not standard commands for this purpose. Understanding <\/span><span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\">, especially its follow functionality, is useful for basic Linux troubleshooting and log monitoring.<\/span><\/p>\n<p><b>Question: 23. Which command is commonly used to determine the type of a file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">file<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">identify<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">typeof<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">ls<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">file<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">file<\/span><span style=\"font-weight: 400;\"> command examines a file and attempts to determine its type by inspecting its contents and, where relevant, filesystem information. This is useful because a Linux filename extension does not necessarily determine what the file actually contains. For example, <\/span><span style=\"font-weight: 400;\">file document<\/span><span style=\"font-weight: 400;\"> might identify a file as an ASCII text document, executable program, image, archive, or another recognized format. The <\/span><span style=\"font-weight: 400;\">ls<\/span><span style=\"font-weight: 400;\"> command primarily lists directory information, while <\/span><span style=\"font-weight: 400;\">typeof<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">identify<\/span><span style=\"font-weight: 400;\"> are not the standard general-purpose Linux commands for this task. The <\/span><span style=\"font-weight: 400;\">file<\/span><span style=\"font-weight: 400;\"> command is therefore an important utility for identifying unknown files and understanding their actual format.<\/span><\/p>\n<p><b>Question: 24. Which command is used to create an empty file or update a file&#8217;s modification timestamp?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">create<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">touch<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">newfile<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">make<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">touch<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">touch<\/span><span style=\"font-weight: 400;\"> command can create a new empty file if the specified file does not exist. If the file already exists, it normally updates its access and modification timestamps rather than replacing its contents. For example, <\/span><span style=\"font-weight: 400;\">touch notes.txt<\/span><span style=\"font-weight: 400;\"> creates <\/span><span style=\"font-weight: 400;\">notes.txt<\/span><span style=\"font-weight: 400;\"> if necessary. The command is often used in shell scripts, testing, and filesystem operations where a file with a particular timestamp or existence state is needed. It does not serve as a general text editor and does not automatically insert content into a file. The other choices are not standard Linux commands for this common filesystem operation.<\/span><\/p>\n<p><b>Question: 25. Which command can be used to count lines, words, and bytes in a file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">measure<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">stats<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">wc<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">count<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">wc<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">wc<\/span><span style=\"font-weight: 400;\"> command provides counts of lines, words, and bytes or characters, depending on the options used. Running <\/span><span style=\"font-weight: 400;\">wc file.txt<\/span><span style=\"font-weight: 400;\"> commonly reports several counts together, while options such as <\/span><span style=\"font-weight: 400;\">wc -l<\/span><span style=\"font-weight: 400;\"> count lines, <\/span><span style=\"font-weight: 400;\">wc -w<\/span><span style=\"font-weight: 400;\"> count words, and <\/span><span style=\"font-weight: 400;\">wc -c<\/span><span style=\"font-weight: 400;\"> count bytes. It can also receive input through a pipeline, making it useful for quickly counting command output. The commands <\/span><span style=\"font-weight: 400;\">count<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">stats<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">measure<\/span><span style=\"font-weight: 400;\"> are not standard replacements for <\/span><span style=\"font-weight: 400;\">wc<\/span><span style=\"font-weight: 400;\">. Because Linux utilities are frequently combined using pipes, <\/span><span style=\"font-weight: 400;\">wc<\/span><span style=\"font-weight: 400;\"> is especially useful for processing the results generated by other commands.<\/span><\/p>\n<p><b>Question: 26. Which redirection operator sends standard output to a file and overwrites the file if it already exists?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">2&gt;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">&gt;&gt;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">&gt;<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 4. <\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\"> shell redirection operator sends standard output to a specified file. If the file already exists, its previous contents are normally overwritten. For example, <\/span><span style=\"font-weight: 400;\">echo &#8220;Linux&#8221; &gt; note.txt<\/span><span style=\"font-weight: 400;\"> creates <\/span><span style=\"font-weight: 400;\">note.txt<\/span><span style=\"font-weight: 400;\"> or replaces its existing contents with the new output. In contrast, <\/span><span style=\"font-weight: 400;\">&gt;&gt;<\/span><span style=\"font-weight: 400;\"> appends standard output to the end of a file rather than overwriting it. The <\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\"> operator redirects standard input from a file, while <\/span><span style=\"font-weight: 400;\">2&gt;<\/span><span style=\"font-weight: 400;\"> redirects standard error. Understanding these distinctions is essential for shell scripting and command-line work because incorrect redirection can unintentionally destroy existing data.<\/span><\/p>\n<p><b>Question: 27. Which shell operator appends standard output to an existing file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">&gt;&gt;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">&lt;&lt;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">|&gt;<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">&gt;&gt;<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">&gt;&gt;<\/span><span style=\"font-weight: 400;\"> operator redirects standard output to a file while appending the new output to the existing contents. If the target file does not exist, the shell normally creates it. For example, <\/span><span style=\"font-weight: 400;\">echo &#8220;New entry&#8221; &gt;&gt; log.txt<\/span><span style=\"font-weight: 400;\"> adds the text to the end of <\/span><span style=\"font-weight: 400;\">log.txt<\/span><span style=\"font-weight: 400;\"> without replacing existing data. This differs from <\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\">, which normally truncates the file before writing new output. The <\/span><span style=\"font-weight: 400;\">|<\/span><span style=\"font-weight: 400;\"> character is used for pipelines, while <\/span><span style=\"font-weight: 400;\">&lt;&lt;<\/span><span style=\"font-weight: 400;\"> introduces a here-document rather than ordinary append redirection. Understanding the difference between <\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">&gt;&gt;<\/span><span style=\"font-weight: 400;\"> is particularly important when working with logs and shell scripts.<\/span><\/p>\n<p><b>Question: 28. What does the pipe character <\/b><b>|<\/b><b> do in a Linux shell?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> Deletes the output of the first command<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> Sends the standard output of one command to another command&#8217;s standard input<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> Runs two commands as root<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b><span style=\"font-weight: 400;\"> Redirects standard output to a file<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. Sends the standard output of one command to another command&#8217;s standard input<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The pipe operator <\/span><span style=\"font-weight: 400;\">|<\/span><span style=\"font-weight: 400;\"> connects commands so that the standard output produced by one command becomes the standard input of the next command. For example, <\/span><span style=\"font-weight: 400;\">ls -l | grep &#8220;.txt&#8221;<\/span><span style=\"font-weight: 400;\"> sends the directory listing into <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\">, which then filters the lines containing <\/span><span style=\"font-weight: 400;\">.txt<\/span><span style=\"font-weight: 400;\">. Pipes allow small Unix utilities to be combined into more useful processing chains without requiring intermediate files. The pipe does not automatically create a file and does not grant administrative privileges. Understanding pipelines is one of the most important shell concepts because many Linux commands are designed to work together through standard input and standard output.<\/span><\/p>\n<p><b>Question: 29. Which file descriptor represents standard error in a typical Linux process?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">0<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">2<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Linux processes conventionally use file descriptor <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\"> for standard input, file descriptor <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\"> for standard output, and file descriptor <\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\"> for standard error. Standard error is intended for diagnostic and error messages and is separate from normal command output. This distinction allows users to redirect successful output and error messages independently. For example, <\/span><span style=\"font-weight: 400;\">command 2&gt; errors.txt<\/span><span style=\"font-weight: 400;\"> redirects standard error to <\/span><span style=\"font-weight: 400;\">errors.txt<\/span><span style=\"font-weight: 400;\">, while <\/span><span style=\"font-weight: 400;\">command &gt; output.txt<\/span><span style=\"font-weight: 400;\"> redirects standard output. Knowing these three standard descriptors is essential for understanding shell redirection, pipelines, and basic scripting. Therefore, file descriptor <\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\"> represents standard error.<\/span><\/p>\n<p><b>Question: 30. Which command is commonly used to display the current date and time?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">calendar<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">time-now<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">clockshow<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">date<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 4. <\/span><span style=\"font-weight: 400;\">date<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">date<\/span><span style=\"font-weight: 400;\"> command displays the current system date and time and can also format or manipulate date representations depending on its options. Running <\/span><span style=\"font-weight: 400;\">date<\/span><span style=\"font-weight: 400;\"> without arguments typically produces a human-readable representation of the current date and time. Custom formatting can be requested using format specifiers, making the command useful in shell scripts. It should be distinguished from the <\/span><span style=\"font-weight: 400;\">time<\/span><span style=\"font-weight: 400;\"> utility, which is commonly used to measure how long a command takes to execute. The other choices are not standard Linux commands for displaying the current system date and time. Therefore, <\/span><span style=\"font-weight: 400;\">date<\/span><span style=\"font-weight: 400;\"> is the appropriate command for this task.<\/span><\/p>\n<p><b>Question: 31. Which command is used to create a symbolic link?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">mklink<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">ln -s<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">symlink<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">link &#8211;symbolic<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">ln -s<\/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, and the <\/span><span style=\"font-weight: 400;\">-s<\/span><span style=\"font-weight: 400;\"> option specifies a symbolic link. For example, <\/span><span style=\"font-weight: 400;\">ln -s \/var\/log\/application.log app.log<\/span><span style=\"font-weight: 400;\"> creates a symbolic link named <\/span><span style=\"font-weight: 400;\">app.log<\/span><span style=\"font-weight: 400;\"> pointing to the specified target. Symbolic links store a reference to another pathname rather than directly referring to the same filesystem data in the way a hard link does. They can point to directories and can cross filesystem boundaries, although they can become broken if their target is removed or moved. <\/span><span style=\"font-weight: 400;\">symlink<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">mklink<\/span><span style=\"font-weight: 400;\"> are not the standard Linux command forms used for creating symbolic links.<\/span><\/p>\n<p><b>Question: 32. Which command displays the amount of free and used disk space on mounted filesystems?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">free<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">diskfree<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">du<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">df<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 4. <\/span><span style=\"font-weight: 400;\">df<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">df<\/span><span style=\"font-weight: 400;\"> command reports filesystem disk-space usage, including the amount of space used, available, and allocated on mounted filesystems. Running <\/span><span style=\"font-weight: 400;\">df -h<\/span><span style=\"font-weight: 400;\"> is especially common because the <\/span><span style=\"font-weight: 400;\">-h<\/span><span style=\"font-weight: 400;\"> option presents sizes in human-readable units such as KiB, MiB, or GiB. The <\/span><span style=\"font-weight: 400;\">du<\/span><span style=\"font-weight: 400;\"> command serves a different purpose: it estimates the disk space used by files and directories. The <\/span><span style=\"font-weight: 400;\">free<\/span><span style=\"font-weight: 400;\"> command reports memory and swap usage rather than filesystem storage. Therefore, <\/span><span style=\"font-weight: 400;\">df<\/span><span style=\"font-weight: 400;\"> is the appropriate command when an administrator wants an overview of available and used filesystem space.<\/span><\/p>\n<p><b>Question: 33. Which command is primarily used to estimate the disk space consumed by files and directories?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">du<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">diskuse<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">df<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">space<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 1. <\/span><span style=\"font-weight: 400;\">du<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">du<\/span><span style=\"font-weight: 400;\"> command reports disk usage associated with files and directories. It is particularly useful for finding which directories are consuming significant amounts of storage. For example, <\/span><span style=\"font-weight: 400;\">du -sh \/home\/user<\/span><span style=\"font-weight: 400;\"> provides a summarized, human-readable estimate of the space used by that directory. This differs from <\/span><span style=\"font-weight: 400;\">df<\/span><span style=\"font-weight: 400;\">, which reports free and used space at the filesystem level. The distinction is important when troubleshooting a full disk: <\/span><span style=\"font-weight: 400;\">df<\/span><span style=\"font-weight: 400;\"> can identify the affected filesystem, while <\/span><span style=\"font-weight: 400;\">du<\/span><span style=\"font-weight: 400;\"> can help locate directories consuming space within it. The commands <\/span><span style=\"font-weight: 400;\">space<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">diskuse<\/span><span style=\"font-weight: 400;\"> are not standard Linux replacements for <\/span><span style=\"font-weight: 400;\">du<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><b>Question: 34. Which directory usually contains user home directories?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">\/users<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">\/var<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">\/home<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">\/usr<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">\/home<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">\/home<\/span><span style=\"font-weight: 400;\"> directory normally contains the home directories of ordinary users on a Linux system. For example, a user account named <\/span><span style=\"font-weight: 400;\">alex<\/span><span style=\"font-weight: 400;\"> will commonly have a home directory such as <\/span><span style=\"font-weight: 400;\">\/home\/alex<\/span><span style=\"font-weight: 400;\">. Users typically store personal files, shell configuration files, documents, and other account-specific data there. The root user&#8217;s home directory is normally <\/span><span style=\"font-weight: 400;\">\/root<\/span><span style=\"font-weight: 400;\">, which is separate from <\/span><span style=\"font-weight: 400;\">\/home<\/span><span style=\"font-weight: 400;\">. The <\/span><span style=\"font-weight: 400;\">\/usr<\/span><span style=\"font-weight: 400;\"> hierarchy contains many installed programs and shared read-only data, while <\/span><span style=\"font-weight: 400;\">\/var<\/span><span style=\"font-weight: 400;\"> contains variable data such as logs and caches. <\/span><span style=\"font-weight: 400;\">\/users<\/span><span style=\"font-weight: 400;\"> is not the standard location defined by the conventional Linux filesystem hierarchy for ordinary user home directories.<\/span><\/p>\n<p><b>Question: 35. Which directory commonly contains variable data such as system logs?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">\/srv<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">\/var<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">\/etc<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">\/opt<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">\/var<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">\/var<\/span><span style=\"font-weight: 400;\"> directory is intended for variable data, meaning data whose contents or size can change during normal system operation. Common examples include logs, spool files, caches, and certain application data. System logs are frequently stored under <\/span><span style=\"font-weight: 400;\">\/var\/log<\/span><span style=\"font-weight: 400;\">. In contrast, <\/span><span style=\"font-weight: 400;\">\/etc<\/span><span style=\"font-weight: 400;\"> is primarily used for configuration files, <\/span><span style=\"font-weight: 400;\">\/opt<\/span><span style=\"font-weight: 400;\"> is traditionally associated with optional application software, and <\/span><span style=\"font-weight: 400;\">\/srv<\/span><span style=\"font-weight: 400;\"> can contain data served by system services. Exact directory contents vary across Linux distributions, but the general purpose of <\/span><span style=\"font-weight: 400;\">\/var<\/span><span style=\"font-weight: 400;\"> remains consistent. Recognizing these filesystem hierarchy conventions is important for navigating Linux systems and locating operational data.<\/span><\/p>\n<p><b>Question: 36. Which command can display information about currently logged-in users?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">activeusers<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">who<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">users<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">loginlist<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">who<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">who<\/span><span style=\"font-weight: 400;\"> command displays information about users currently logged into the system. Its output commonly includes usernames, terminal or pseudo-terminal information, login times, and sometimes the remote source of a login. The related <\/span><span style=\"font-weight: 400;\">w<\/span><span style=\"font-weight: 400;\"> command provides additional information about what logged-in users are doing and system activity. The <\/span><span style=\"font-weight: 400;\">users<\/span><span style=\"font-weight: 400;\"> command can also provide a concise list of currently logged-in usernames, but <\/span><span style=\"font-weight: 400;\">who<\/span><span style=\"font-weight: 400;\"> supplies more session details. <\/span><span style=\"font-weight: 400;\">loginlist<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">activeusers<\/span><span style=\"font-weight: 400;\"> are not standard commands. For LPI objectives, understanding basic user and session commands such as <\/span><span style=\"font-weight: 400;\">who<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">w<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">users<\/span><span style=\"font-weight: 400;\"> is useful for system monitoring.<\/span><\/p>\n<p><b>Question: 37. Which command is commonly used to show the username, UID, GID, and group memberships of a user?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">userinfo<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">identity<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">whoami<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">id<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\"> command displays identity information associated with a user. When run without arguments, it commonly reports the effective username, user ID (UID), primary group ID (GID), and supplementary group memberships. For example, this information can help determine which groups a user belongs to and therefore which resources they may be permitted to access. <\/span><span style=\"font-weight: 400;\">whoami<\/span><span style=\"font-weight: 400;\"> generally reports only the effective username, while <\/span><span style=\"font-weight: 400;\">identity<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">userinfo<\/span><span style=\"font-weight: 400;\"> are not standard commands for this purpose. Because Linux permissions and access controls are closely tied to UIDs and GIDs, <\/span><span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\"> is a valuable command for understanding and troubleshooting user-account permissions.<\/span><\/p>\n<p><b>Question: 38. Which command is commonly used to change the owner of a file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">chgrp<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">chown<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">owner<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">chmod<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">chown<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">chown<\/span><span style=\"font-weight: 400;\"> command changes the ownership of files and directories. It can change the user owner and, with appropriate syntax, the associated group as well. For example, an administrator might use <\/span><span style=\"font-weight: 400;\">chown alice report.txt<\/span><span style=\"font-weight: 400;\"> to change the owner of a file to user <\/span><span style=\"font-weight: 400;\">alice<\/span><span style=\"font-weight: 400;\">. The <\/span><span style=\"font-weight: 400;\">chgrp<\/span><span style=\"font-weight: 400;\"> command specifically changes the group ownership, while <\/span><span style=\"font-weight: 400;\">chmod<\/span><span style=\"font-weight: 400;\"> changes permission bits rather than ownership. Ownership changes generally require sufficient privileges, particularly when assigning files to another user. Understanding the relationship between <\/span><span style=\"font-weight: 400;\">chown<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">chgrp<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">chmod<\/span><span style=\"font-weight: 400;\"> is important because Linux access control depends on both ownership information and permission settings.<\/span><\/p>\n<p><b>Question: 39. Which command changes the group ownership of a file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">setgroup<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">groupmod<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">chgrp<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">chmod<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 3. <\/span><span style=\"font-weight: 400;\">chgrp<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">chgrp<\/span><span style=\"font-weight: 400;\"> command changes the group ownership associated with a file or directory. For example, <\/span><span style=\"font-weight: 400;\">chgrp developers project.txt<\/span><span style=\"font-weight: 400;\"> changes the file&#8217;s group to <\/span><span style=\"font-weight: 400;\">developers<\/span><span style=\"font-weight: 400;\">, assuming the user has the necessary permissions. Group ownership is significant because the group permission bits in a file&#8217;s mode determine what members of that group can do with the file. <\/span><span style=\"font-weight: 400;\">chmod<\/span><span style=\"font-weight: 400;\"> modifies permission bits, while <\/span><span style=\"font-weight: 400;\">groupmod<\/span><span style=\"font-weight: 400;\"> is used to modify group-account properties rather than directly changing a file&#8217;s group ownership. <\/span><span style=\"font-weight: 400;\">setgroup<\/span><span style=\"font-weight: 400;\"> is not the standard command for this operation. Thus, <\/span><span style=\"font-weight: 400;\">chgrp<\/span><span style=\"font-weight: 400;\"> is the correct command for changing filesystem group ownership.<\/span><\/p>\n<p><b>Question: 40. Which command is commonly used to terminate a process by sending it a signal?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">endproc<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">kill<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">stop<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">terminate<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer:<\/b><span style=\"font-weight: 400;\"> 2. <\/span><span style=\"font-weight: 400;\">kill<\/span><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">kill<\/span><span style=\"font-weight: 400;\"> command sends a signal to a process identified by its process ID (PID). Despite its name, <\/span><span style=\"font-weight: 400;\">kill<\/span><span style=\"font-weight: 400;\"> is not limited to forcibly terminating processes; it can send different signals for different purposes. For example, <\/span><span style=\"font-weight: 400;\">kill PID<\/span><span style=\"font-weight: 400;\"> normally sends the default <\/span><span style=\"font-weight: 400;\">SIGTERM<\/span><span style=\"font-weight: 400;\">, allowing the process an opportunity to terminate cleanly. A stronger signal such as <\/span><span style=\"font-weight: 400;\">SIGKILL<\/span><span style=\"font-weight: 400;\"> can be requested with <\/span><span style=\"font-weight: 400;\">kill -9 PID<\/span><span style=\"font-weight: 400;\">, although it should be used carefully because the target process cannot catch or handle <\/span><span style=\"font-weight: 400;\">SIGKILL<\/span><span style=\"font-weight: 400;\">. Commands such as <\/span><span style=\"font-weight: 400;\">stop<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">terminate<\/span><span style=\"font-weight: 400;\">, and <\/span><span style=\"font-weight: 400;\">endproc<\/span><span style=\"font-weight: 400;\"> are not the standard general-purpose Linux command for sending process signals.<\/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: 21. Which command is used to display the first lines of a text file by default? more 2. tail 3. less 4. head Correct Answer: 4. head Explanation: The head command displays the beginning of a file or standard input. By default, it [&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\/18609"}],"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=18609"}],"version-history":[{"count":1,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18609\/revisions"}],"predecessor-version":[{"id":18610,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18609\/revisions\/18610"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=18609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=18609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=18609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}