{"id":18640,"date":"2026-09-22T08:58:04","date_gmt":"2026-09-22T08:58:04","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=18640"},"modified":"2026-09-22T08:58:04","modified_gmt":"2026-09-22T08:58:04","slug":"lpi-101-500-practice-test-questions-and-exam-dumps-part-18-q341-360","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/lpi-101-500-practice-test-questions-and-exam-dumps-part-18-q341-360\/","title":{"rendered":"LPI 101-500 Practice Test Questions and Exam Dumps Part 18 Q341-360"},"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: 341. Which directory commonly contains architecture-independent shared data used by applications?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">\/usr\/share<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">\/usr\/sbin<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">\/var\/run<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">\/boot<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. \/usr\/share<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">\/usr\/share<\/span><span style=\"font-weight: 400;\"> directory commonly contains architecture-independent data used by applications and system utilities. Examples can include documentation, localization files, icons, and other data that does not depend directly on the processor architecture. Executable programs are generally placed in directories such as <\/span><span style=\"font-weight: 400;\">\/usr\/bin<\/span><span style=\"font-weight: 400;\">, while system-administration executables may be found under <\/span><span style=\"font-weight: 400;\">\/usr\/sbin<\/span><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\">\/boot<\/span><span style=\"font-weight: 400;\"> contains files needed during the boot process, and <\/span><span style=\"font-weight: 400;\">\/var\/run<\/span><span style=\"font-weight: 400;\"> or <\/span><span style=\"font-weight: 400;\">\/run<\/span><span style=\"font-weight: 400;\"> is associated with volatile runtime state. Understanding the distinction between executable directories and shared application data is useful when navigating a Linux filesystem.<\/span><\/p>\n<p><b>Question: 342. Which directory is traditionally associated with optional third-party software packages installed by the system administrator?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">\/opt<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">\/tmp<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">\/proc<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">\/etc<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. \/opt<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">\/opt<\/span><span style=\"font-weight: 400;\"> directory is traditionally used for optional software packages and add-on application software. Programs installed under <\/span><span style=\"font-weight: 400;\">\/opt<\/span><span style=\"font-weight: 400;\"> may keep their application files together in a dedicated subdirectory rather than distributing them across the standard system hierarchy. This can make third-party or self-contained software easier to manage. <\/span><span style=\"font-weight: 400;\">\/etc<\/span><span style=\"font-weight: 400;\"> is primarily for configuration files, <\/span><span style=\"font-weight: 400;\">\/tmp<\/span><span style=\"font-weight: 400;\"> is used for temporary data, and <\/span><span style=\"font-weight: 400;\">\/proc<\/span><span style=\"font-weight: 400;\"> provides a virtual filesystem exposing process and kernel information. The exact layout of installed applications varies across Linux distributions, but <\/span><span style=\"font-weight: 400;\">\/opt<\/span><span style=\"font-weight: 400;\"> has a well-established conventional purpose.<\/span><\/p>\n<p><b>Question: 343. Which command displays the filesystem type along with mounted filesystem information when used with <\/b><b>df<\/b><b>?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">df -T<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">df -i<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">df -P<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">df -h<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. df -T<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-T<\/span><span style=\"font-weight: 400;\"> option of <\/span><span style=\"font-weight: 400;\">df<\/span><span style=\"font-weight: 400;\"> adds the filesystem type to the displayed information. This is useful when an administrator needs to determine whether a mounted filesystem uses a type such as ext4, XFS, tmpfs, or another supported filesystem. The <\/span><span style=\"font-weight: 400;\">-h<\/span><span style=\"font-weight: 400;\"> option instead makes size values easier for humans to read, while <\/span><span style=\"font-weight: 400;\">-i<\/span><span style=\"font-weight: 400;\"> displays inode usage information. <\/span><span style=\"font-weight: 400;\">df -T<\/span><span style=\"font-weight: 400;\"> therefore provides both filesystem space information and the filesystem type, making it helpful during storage troubleshooting and system inventory tasks.<\/span><\/p>\n<p><b>Question: 344. Which <\/b><b>ls<\/b><b> option appends indicators such as <\/b><b>\/<\/b><b> to directory names?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">-F<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">-L<\/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;\">-G<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. -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 of <\/span><span style=\"font-weight: 400;\">ls<\/span><span style=\"font-weight: 400;\"> appends a character to filenames to indicate certain file types. For example, directories are commonly shown with a trailing <\/span><span style=\"font-weight: 400;\">\/<\/span><span style=\"font-weight: 400;\">, executable files may receive <\/span><span style=\"font-weight: 400;\">*<\/span><span style=\"font-weight: 400;\">, and symbolic links may receive <\/span><span style=\"font-weight: 400;\">@<\/span><span style=\"font-weight: 400;\">, depending on the implementation. These indicators make directory listings easier to interpret at a glance. The option does not change the underlying files or permissions. It simply adds visual information to the names in the listing. This is particularly useful during interactive shell work when users want to distinguish directories, executables, and links quickly.<\/span><\/p>\n<p><b>Question: 345. Which command can display the target of a symbolic link without following it to display the target&#8217;s metadata?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">readlink<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">linktarget<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">ls-target<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">targetof<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. readlink<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">readlink<\/span><span style=\"font-weight: 400;\"> command can display the pathname stored as the target of a symbolic link. This is useful when an administrator needs to determine what a symbolic link actually references. For example, <\/span><span style=\"font-weight: 400;\">readlink linkname<\/span><span style=\"font-weight: 400;\"> returns the link&#8217;s stored target path. Options such as <\/span><span style=\"font-weight: 400;\">-f<\/span><span style=\"font-weight: 400;\"> can additionally resolve the target through filesystem path components and symbolic links, subject to the command&#8217;s semantics. This differs from commands that inspect the target object itself. Understanding <\/span><span style=\"font-weight: 400;\">readlink<\/span><span style=\"font-weight: 400;\"> is particularly useful when troubleshooting configuration links, alternate paths, and dangling symbolic links.<\/span><\/p>\n<p><b>Question: 346. Which command displays detailed metadata about a specified file, including timestamps and inode information?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">inspect<\/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;\">metadata<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">fileinfo<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. stat<\/b><\/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 filesystem metadata about a specified file or directory. Depending on the filesystem and implementation, its output can include the inode number, file type, permissions, ownership, size, link count, and several timestamps. This makes <\/span><span style=\"font-weight: 400;\">stat<\/span><span style=\"font-weight: 400;\"> more detailed than a basic directory listing. It is particularly useful when investigating hard links, timestamps, ownership, and filesystem metadata. The <\/span><span style=\"font-weight: 400;\">file<\/span><span style=\"font-weight: 400;\"> command, by contrast, primarily attempts to identify the type or contents of a file. <\/span><span style=\"font-weight: 400;\">stat<\/span><span style=\"font-weight: 400;\"> is therefore the appropriate tool when detailed metadata is required.<\/span><\/p>\n<p><b>Question: 347. Which <\/b><b>mount<\/b><b> option requests that a filesystem be mounted using a specified filesystem type?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">-t<\/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;\">-s<\/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: 1. -t<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">-t<\/span><span style=\"font-weight: 400;\"> option of <\/span><span style=\"font-weight: 400;\">mount<\/span><span style=\"font-weight: 400;\"> specifies the filesystem type to use when mounting a filesystem. For example, an administrator can specify a type such as <\/span><span style=\"font-weight: 400;\">ext4<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">xfs<\/span><span style=\"font-weight: 400;\">, or another supported filesystem. This can be useful when the type cannot be determined automatically or when explicit configuration is required. The exact filesystem type must be supported by the kernel and available system components. Other <\/span><span style=\"font-weight: 400;\">mount<\/span><span style=\"font-weight: 400;\"> options control behavior such as read-only access, mount flags, or configuration handling. Correctly identifying the filesystem type helps prevent failed or incorrect mount operations.<\/span><\/p>\n<p><b>Question: 348. What does the <\/b><b>mount<\/b><b> option <\/b><b>-o bind<\/b><b> generally allow?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> It formats a filesystem before mounting<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> It mounts an existing directory at another location<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> It converts a symbolic link into a hard link<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b><span style=\"font-weight: 400;\"> It mounts only removable media<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. It mounts an existing directory at another location<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">A bind mount makes an existing directory tree accessible at another mount point without creating a separate filesystem. Using <\/span><span style=\"font-weight: 400;\">mount &#8211;bind source target<\/span><span style=\"font-weight: 400;\"> exposes the same underlying directory contents through the target path. This can be useful for containers, system administration, chroot environments, and reorganizing access to existing directory trees. It does not format the filesystem or create a new filesystem. A bind mount is also different from a symbolic link because it operates at the filesystem mount layer and can affect how the directory is presented to processes.<\/span><\/p>\n<p><b>Question: 349. Which <\/b><b>ls<\/b><b> option reverses the current sorting order?<\/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;\">-r<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">-v<\/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: 2. -r<\/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 sorting order used by <\/span><span style=\"font-weight: 400;\">ls<\/span><span style=\"font-weight: 400;\">. It can be combined with other sorting options to produce the opposite ordering. For example, <\/span><span style=\"font-weight: 400;\">ls -lt<\/span><span style=\"font-weight: 400;\"> normally lists entries with newer modification times first, while <\/span><span style=\"font-weight: 400;\">ls -ltr<\/span><span style=\"font-weight: 400;\"> reverses that order and places older entries first. The <\/span><span style=\"font-weight: 400;\">-R<\/span><span style=\"font-weight: 400;\"> option instead performs a recursive listing of subdirectories. The lowercase <\/span><span style=\"font-weight: 400;\">-r<\/span><span style=\"font-weight: 400;\"> should therefore not be confused with uppercase <\/span><span style=\"font-weight: 400;\">-R<\/span><span style=\"font-weight: 400;\">. Combining options is common in Linux commands, so understanding the individual meaning of each option is important.<\/span><\/p>\n<p><b>Question: 350. Which command can display the number of hard links associated with a file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">ls -l<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">ls -h<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">ls -p<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">ls -A<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. ls -l<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The long-format <\/span><span style=\"font-weight: 400;\">ls -l<\/span><span style=\"font-weight: 400;\"> listing includes a field representing the number of hard links associated with the file&#8217;s inode. For an ordinary file, this value indicates how many directory entries currently reference the same inode. Creating another hard link normally increases the link count, while removing one decreases it. This is useful when investigating relationships between filenames and shared file data. The other options listed do not specifically expose the link-count field. The link count should be distinguished from the number of symbolic links pointing to a file, which is a different concept.<\/span><\/p>\n<p><b>Question: 351. Which process identifier is normally assigned to the initial user-space process on a Linux system?<\/b><\/p>\n<ol>\n<li><b><\/b><span style=\"font-weight: 400;\"> PID 0<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b><span style=\"font-weight: 400;\"> PID 1<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b><span style=\"font-weight: 400;\"> PID 2<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">**4. PID 100<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. PID 1<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">PID 1 is normally assigned to the initial user-space process started by the Linux kernel. On many modern distributions, this process is <\/span><span style=\"font-weight: 400;\">systemd<\/span><span style=\"font-weight: 400;\">, although other initialization systems can occupy PID 1. PID 1 has special responsibilities, including adopting orphaned processes and participating in system initialization and service management. PID 0 has a special kernel-related role rather than representing an ordinary user-space init process. Understanding PID 1 is important when studying process relationships, system startup, service management, and what happens to processes whose original parent terminates.<\/span><\/p>\n<p><b>Question: 352. Which command displays the parent process ID of a process in a detailed process listing?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">ps -ef<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">ps -q<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">ps -x<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">ps -c<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. ps -ef<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">ps -ef<\/span><span style=\"font-weight: 400;\"> format includes a PPID column showing the parent process ID for each listed process. The parent process ID is useful for understanding process relationships and tracing how a process was started. For example, an administrator can use the PPID to identify which process created or launched a particular child process. <\/span><span style=\"font-weight: 400;\">ps<\/span><span style=\"font-weight: 400;\"> supports many different option combinations and output formats, but <\/span><span style=\"font-weight: 400;\">-ef<\/span><span style=\"font-weight: 400;\"> is a widely used form for obtaining a broad full-format process listing. Process relationships are particularly important when diagnosing service hierarchies, orphaned processes, and shell-launched programs.<\/span><\/p>\n<p><b>Question: 353. Which shell operator redirects standard output to a file while discarding the previous contents of that 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;\">2&gt;<\/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;\">&amp;&gt;<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. &gt;<\/b><\/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;\"> redirection operator sends standard output to a specified file and normally truncates that file before writing the new output. If the file does not already exist, the shell generally creates it. This differs from <\/span><span style=\"font-weight: 400;\">&gt;&gt;<\/span><span style=\"font-weight: 400;\">, which appends standard output to the existing contents. The <\/span><span style=\"font-weight: 400;\">2&gt;<\/span><span style=\"font-weight: 400;\"> operator specifically redirects standard error, while combined redirection syntax such as <\/span><span style=\"font-weight: 400;\">&amp;&gt;<\/span><span style=\"font-weight: 400;\"> is shell-dependent and redirects multiple output streams. Understanding the distinction between truncating and appending redirection is essential because accidental use of <\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\"> can overwrite existing data.<\/span><\/p>\n<p><b>Question: 354. Which file descriptor represents standard input?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">3<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. 0<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">File descriptor <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\"> represents standard input, commonly abbreviated as stdin. It is the default input stream from which a command reads data. File descriptor <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\"> represents standard output, while file descriptor <\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\"> represents standard error. These descriptors allow shell commands to redirect input and output between files, terminals, and other processes. For example, <\/span><span style=\"font-weight: 400;\">&lt; input.txt<\/span><span style=\"font-weight: 400;\"> redirects standard input from a file. Understanding the standard file descriptors is fundamental to Linux shell usage because pipelines and redirections rely heavily on these predefined streams.<\/span><\/p>\n<p><b>Question: 355. Which shell redirection sends standard error to the same destination currently used by standard output in a POSIX-style shell?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">2&gt;&amp;1<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">1&gt;&amp;2<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">2&gt;1<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">&amp;2&gt;1<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. 2&gt;&amp;1<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The redirection <\/span><span style=\"font-weight: 400;\">2&gt;&amp;1<\/span><span style=\"font-weight: 400;\"> duplicates file descriptor 1 onto file descriptor 2, causing standard error to use the same destination currently assigned to standard output. This is commonly used when both normal output and error messages need to be captured together. The order of redirections matters because the shell processes them from left to right. For example, <\/span><span style=\"font-weight: 400;\">command &gt;output.txt 2&gt;&amp;1<\/span><span style=\"font-weight: 400;\"> sends both standard output and standard error to <\/span><span style=\"font-weight: 400;\">output.txt<\/span><span style=\"font-weight: 400;\">. Understanding descriptor duplication is important when writing scripts that collect command output or logs reliably.<\/span><\/p>\n<p><b>Question: 356. Which command can display only the last 20 lines of a file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">tail -20<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">head -20<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">last -20<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">end -20<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. tail -20<\/b><\/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, and <\/span><span style=\"font-weight: 400;\">tail -20<\/span><span style=\"font-weight: 400;\"> requests the last 20 lines on commonly used implementations. This is useful for quickly examining recent entries in log files without displaying the entire file. The <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> command performs the opposite task by displaying content from the beginning of a file. <\/span><span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"> can also follow a growing file using options such as <\/span><span style=\"font-weight: 400;\">-f<\/span><span style=\"font-weight: 400;\">, which is especially useful for monitoring logs while applications are running. The exact numeric syntax can vary slightly across implementations, but <\/span><span style=\"font-weight: 400;\">tail -20<\/span><span style=\"font-weight: 400;\"> is widely recognized.<\/span><\/p>\n<p><b>Question: 357. Which command can display only the first 15 lines of a file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">first -15<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">top -15<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">head -15<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">start -15<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. head -15<\/b><\/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 portion of a file, and <\/span><span style=\"font-weight: 400;\">head -15<\/span><span style=\"font-weight: 400;\"> requests the first 15 lines on commonly used Linux implementations. This is useful when quickly inspecting the structure or opening records of a large file without reading its entire contents. The command can also operate on multiple files and can be combined with pipelines. <\/span><span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"> is used for the end of a file instead. Administrators frequently use <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> during troubleshooting, data inspection, and shell scripting when only the initial portion of command output is needed.<\/span><\/p>\n<p><b>Question: 358. Which command can display a file&#8217;s contents one screen at a time while allowing interactive navigation?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">cat<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">touch<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. less<\/b><\/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 a pager that allows users to view text interactively one screen at a time. It is particularly useful for large files or long command output because it avoids flooding the terminal with the entire content at once. Users can scroll forward and backward, search for text, and navigate through the displayed data. <\/span><span style=\"font-weight: 400;\">cat<\/span><span style=\"font-weight: 400;\"> normally writes the complete file directly to standard output, while <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> is primarily used to display supplied text. <\/span><span style=\"font-weight: 400;\">touch<\/span><span style=\"font-weight: 400;\"> creates or updates file timestamps rather than displaying content. <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> is therefore well suited to interactive text inspection.<\/span><\/p>\n<p><b>Question: 359. Which command changes the group ownership 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;\">chmod<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">chuser<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">groupmod<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. chgrp<\/b><\/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, an administrator can use <\/span><span style=\"font-weight: 400;\">chgrp developers project.txt<\/span><span style=\"font-weight: 400;\"> to assign the file to the <\/span><span style=\"font-weight: 400;\">developers<\/span><span style=\"font-weight: 400;\"> group, provided the user has the required permissions. <\/span><span style=\"font-weight: 400;\">chmod<\/span><span style=\"font-weight: 400;\"> changes permission bits rather than ownership, while <\/span><span style=\"font-weight: 400;\">groupmod<\/span><span style=\"font-weight: 400;\"> modifies group account information rather than assigning a group to a filesystem object. <\/span><span style=\"font-weight: 400;\">chown<\/span><span style=\"font-weight: 400;\"> can also change ownership and group ownership, making it another option for broader ownership administration. Understanding ownership and permission management is essential for controlling collaborative access to Linux files.<\/span><\/p>\n<p><b>Question: 360. Which shell construct executes the right-hand command only when the left-hand command fails?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">&amp;&amp;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">|<\/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: 3. ||<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">||<\/span><span style=\"font-weight: 400;\"> shell operator provides conditional execution based on failure. The command on the right is executed when the command on the left returns a nonzero exit status. This is useful for fallback actions, error handling, and alternative commands. For example, <\/span><span style=\"font-weight: 400;\">test -f config &amp;&amp; echo found || echo missing<\/span><span style=\"font-weight: 400;\"> can select an output based on whether the test succeeds, although more complex scripts may use explicit conditional statements for clarity. The <\/span><span style=\"font-weight: 400;\">&amp;&amp;<\/span><span style=\"font-weight: 400;\"> operator instead runs the right-hand command when the left-hand command succeeds, while <\/span><span style=\"font-weight: 400;\">;<\/span><span style=\"font-weight: 400;\"> simply separates commands without making execution conditional.<\/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: 341. Which directory commonly contains architecture-independent shared data used by applications? \/usr\/share 2. \/usr\/sbin 3. \/var\/run 4. \/boot Correct Answer: 1. \/usr\/share Explanation: The \/usr\/share directory commonly contains architecture-independent data used by applications and system utilities. Examples can include documentation, localization files, icons, [&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\/18640"}],"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=18640"}],"version-history":[{"count":1,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18640\/revisions"}],"predecessor-version":[{"id":18641,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18640\/revisions\/18641"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=18640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=18640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=18640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}