{"id":18632,"date":"2026-09-22T08:56:41","date_gmt":"2026-09-22T08:56:41","guid":{"rendered":"https:\/\/www.examlabs.com\/certification\/?p=18632"},"modified":"2026-09-22T08:56:41","modified_gmt":"2026-09-22T08:56:41","slug":"lpi-101-500-practice-test-questions-and-exam-dumps-part-14-q261-280","status":"publish","type":"post","link":"https:\/\/www.examlabs.com\/certification\/lpi-101-500-practice-test-questions-and-exam-dumps-part-14-q261-280\/","title":{"rendered":"LPI 101-500 Practice Test Questions and Exam Dumps Part 14 Q261-280"},"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: 261. Which command can display the current user&#8217;s login name in a simple form?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">uname<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">whoami<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">hostname<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">id<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. <\/b><b>whoami<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">whoami<\/span><span style=\"font-weight: 400;\"> command displays the effective username associated with the current shell process. It is useful when an administrator or user needs to quickly confirm which account is currently being used. This can be especially helpful when switching between users or working with commands that require elevated privileges. The <\/span><span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\"> command provides more detailed identity information, including user and group IDs. <\/span><span style=\"font-weight: 400;\">uname<\/span><span style=\"font-weight: 400;\"> reports system information, while <\/span><span style=\"font-weight: 400;\">hostname<\/span><span style=\"font-weight: 400;\"> identifies the system&#8217;s hostname. Therefore, when the specific goal is to display the current effective username in a straightforward form, <\/span><span style=\"font-weight: 400;\">whoami<\/span><span style=\"font-weight: 400;\"> is the appropriate command.<\/span><\/p>\n<p><b>Question: 262. Which command displays information about the operating system kernel and machine architecture?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">uname<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">passwd<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">groups<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">alias<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. <\/b><b>uname<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">uname<\/span><span style=\"font-weight: 400;\"> command displays system information associated with the operating system and kernel. Depending on the options used, it can report information such as the kernel name, kernel release, machine hardware architecture, hostname, and operating-system information. For example, <\/span><span style=\"font-weight: 400;\">uname -a<\/span><span style=\"font-weight: 400;\"> requests a broad set of available system details. <\/span><span style=\"font-weight: 400;\">groups<\/span><span style=\"font-weight: 400;\"> displays group memberships, <\/span><span style=\"font-weight: 400;\">passwd<\/span><span style=\"font-weight: 400;\"> is used to change account passwords, and <\/span><span style=\"font-weight: 400;\">alias<\/span><span style=\"font-weight: 400;\"> manages shell aliases. <\/span><span style=\"font-weight: 400;\">uname<\/span><span style=\"font-weight: 400;\"> is therefore a useful diagnostic command when an administrator needs to identify the environment in which Linux is running.<\/span><\/p>\n<p><b>Question: 263. Which command can show the groups to which the current user belongs?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">groups<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">sleep<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">diff<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">mount<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. <\/b><b>groups<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">groups<\/span><span style=\"font-weight: 400;\"> command displays the group memberships associated with a specified user or, when no username is supplied, the current user. Linux uses groups to organize permissions and allow multiple users to share access to files and resources. A user can have a primary group and may also belong to additional supplementary groups. The <\/span><span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\"> command can provide similar group information along with numeric user and group IDs. <\/span><span style=\"font-weight: 400;\">mount<\/span><span style=\"font-weight: 400;\"> manages filesystem attachments, <\/span><span style=\"font-weight: 400;\">diff<\/span><span style=\"font-weight: 400;\"> compares files, and <\/span><span style=\"font-weight: 400;\">sleep<\/span><span style=\"font-weight: 400;\"> pauses execution. Therefore, <\/span><span style=\"font-weight: 400;\">groups<\/span><span style=\"font-weight: 400;\"> is the straightforward command for viewing group membership.<\/span><\/p>\n<p><b>Question: 264. Which command can display both the numeric user ID and group IDs associated with a user?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">alias<\/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;\">jobs<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">pwd<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. <\/b><b>id<\/b><\/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 for a user, including the numeric user ID, primary group ID, and supplementary group memberships. When used without a username, it normally reports information about the current user. This is useful when troubleshooting permissions because Linux permissions are ultimately associated with numeric user and group identities. Although <\/span><span style=\"font-weight: 400;\">groups<\/span><span style=\"font-weight: 400;\"> can display group names, <\/span><span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\"> provides a broader identity summary. <\/span><span style=\"font-weight: 400;\">pwd<\/span><span style=\"font-weight: 400;\"> displays the current working directory, <\/span><span style=\"font-weight: 400;\">jobs<\/span><span style=\"font-weight: 400;\"> manages shell jobs, and <\/span><span style=\"font-weight: 400;\">alias<\/span><span style=\"font-weight: 400;\"> handles command aliases. Understanding <\/span><span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\"> is therefore important when investigating account and permission behavior.<\/span><\/p>\n<p><b>Question: 265. Which command can display the permissions, ownership, size, and timestamps of a file in a detailed listing?<\/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;\">cd<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">rm<\/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: 1. <\/b><b>ls -l<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">ls -l<\/span><span style=\"font-weight: 400;\"> command produces a long-format directory listing containing information such as file permissions, link count, owner, group, file size, modification time, and filename. This makes it one of the most commonly used commands for examining filesystem metadata from the shell. The first field contains the file type and permission information, while later fields identify ownership and other attributes. <\/span><span style=\"font-weight: 400;\">cd<\/span><span style=\"font-weight: 400;\"> changes directories, <\/span><span style=\"font-weight: 400;\">rm<\/span><span style=\"font-weight: 400;\"> removes files, and <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> writes text to standard output. Therefore, <\/span><span style=\"font-weight: 400;\">ls -l<\/span><span style=\"font-weight: 400;\"> is the appropriate command when detailed file information is required.<\/span><\/p>\n<p><b>Question: 266. Which command can compare two text files and report their differences line by line?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">cmp<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">diff<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">wc<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. <\/b><b>diff<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">diff<\/span><span style=\"font-weight: 400;\"> command compares two files and reports differences between them, commonly in a line-oriented format. It is widely used when comparing configuration files, source code, or versions of text documents. The output can indicate which lines need to be added, removed, or changed to transform one file into another. <\/span><span style=\"font-weight: 400;\">cmp<\/span><span style=\"font-weight: 400;\"> also compares files but works at a lower byte-oriented level and is useful for determining whether files differ without providing the same line-oriented analysis. <\/span><span style=\"font-weight: 400;\">sort<\/span><span style=\"font-weight: 400;\"> orders lines, while <\/span><span style=\"font-weight: 400;\">wc<\/span><span style=\"font-weight: 400;\"> counts lines, words, and bytes. Thus, <\/span><span style=\"font-weight: 400;\">diff<\/span><span style=\"font-weight: 400;\"> is the standard choice for line-by-line text comparison.<\/span><\/p>\n<p><b>Question: 267. Which command compares two files byte by byte and reports the first difference it encounters?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">awk<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">cmp<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">cut<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. <\/b><b>cmp<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">cmp<\/span><span style=\"font-weight: 400;\"> command compares two files byte by byte and can report the location of the first difference. It is useful when the exact byte-level equality of two files needs to be checked. Unlike <\/span><span style=\"font-weight: 400;\">diff<\/span><span style=\"font-weight: 400;\">, which is designed to provide a line-oriented description of changes between text files, <\/span><span style=\"font-weight: 400;\">cmp<\/span><span style=\"font-weight: 400;\"> focuses on direct file comparison. It can therefore be useful for binary files as well as text files. <\/span><span style=\"font-weight: 400;\">grep<\/span><span style=\"font-weight: 400;\"> searches text for patterns, <\/span><span style=\"font-weight: 400;\">awk<\/span><span style=\"font-weight: 400;\"> processes structured text, and <\/span><span style=\"font-weight: 400;\">cut<\/span><span style=\"font-weight: 400;\"> extracts fields or character ranges. Understanding the distinction between <\/span><span style=\"font-weight: 400;\">cmp<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">diff<\/span><span style=\"font-weight: 400;\"> helps select the correct comparison tool.<\/span><\/p>\n<p><b>Question: 268. Which command is commonly used to display the first several lines of a text file?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">head<\/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;\">more<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. <\/b><b>head<\/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 or input stream. By default, implementations commonly display the first several lines, while options can be used to request a specific number of lines or bytes. This is useful when quickly inspecting the structure or header of a large file without reading the entire contents. <\/span><span style=\"font-weight: 400;\">tail<\/span><span style=\"font-weight: 400;\"> focuses on the end of a file, while <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> provides an interactive pager for viewing larger amounts of text. The <\/span><span style=\"font-weight: 400;\">more<\/span><span style=\"font-weight: 400;\"> utility can also page through text, but <\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\"> is specifically designed for extracting the beginning of input.<\/span><\/p>\n<p><b>Question: 269. Which command is most appropriate for interactively viewing a long text file one screen at a time?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">touch<\/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;\">mkdir<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">ln<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. <\/b><b>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 terminal pager designed for interactively viewing text that may be longer than the available screen. Users can move forward and backward through the content, search for text, and navigate without loading the entire file into a simple command-line output stream. This makes <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> particularly useful for logs, manuals, configuration files, and large text documents. <\/span><span style=\"font-weight: 400;\">touch<\/span><span style=\"font-weight: 400;\"> changes timestamps or creates files, <\/span><span style=\"font-weight: 400;\">mkdir<\/span><span style=\"font-weight: 400;\"> creates directories, and <\/span><span style=\"font-weight: 400;\">ln<\/span><span style=\"font-weight: 400;\"> creates links. Therefore, <\/span><span style=\"font-weight: 400;\">less<\/span><span style=\"font-weight: 400;\"> is the appropriate choice when interactive navigation through lengthy text is required.<\/span><\/p>\n<p><b>Question: 270. Which command removes an empty directory?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">rmdir<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">rm<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">unlink<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">erase<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 1. <\/b><b>rmdir<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">rmdir<\/span><span style=\"font-weight: 400;\"> command removes directories that are empty. Its requirement that the directory contain no entries provides an additional safeguard against accidentally deleting files contained inside the directory. If a directory contains files or subdirectories, <\/span><span style=\"font-weight: 400;\">rmdir<\/span><span style=\"font-weight: 400;\"> normally reports an error rather than recursively removing its contents. The <\/span><span style=\"font-weight: 400;\">rm<\/span><span style=\"font-weight: 400;\"> command can remove files and, with appropriate options, directories and their contents. <\/span><span style=\"font-weight: 400;\">unlink<\/span><span style=\"font-weight: 400;\"> is generally associated with removing a directory entry for a file, while <\/span><span style=\"font-weight: 400;\">erase<\/span><span style=\"font-weight: 400;\"> is not the standard Linux command for this purpose. Thus, <\/span><span style=\"font-weight: 400;\">rmdir<\/span><span style=\"font-weight: 400;\"> is specifically suited to removing empty directories.<\/span><\/p>\n<p><b>Question: 271. Which command creates a new directory named <\/b><b>reports<\/b><b>?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">touch reports<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">mkdir reports<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">cd reports<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">cat reports<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. <\/b><b>mkdir reports<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">mkdir<\/span><span style=\"font-weight: 400;\"> command creates directories. Therefore, <\/span><span style=\"font-weight: 400;\">mkdir reports<\/span><span style=\"font-weight: 400;\"> requests creation of a directory named <\/span><span style=\"font-weight: 400;\">reports<\/span><span style=\"font-weight: 400;\"> in the current working directory. The command can also accept options for creating parent directories when necessary and for setting permissions at creation time. <\/span><span style=\"font-weight: 400;\">touch reports<\/span><span style=\"font-weight: 400;\"> creates a regular file if the specified path does not already exist, while <\/span><span style=\"font-weight: 400;\">cd reports<\/span><span style=\"font-weight: 400;\"> attempts to change into an existing directory. <\/span><span style=\"font-weight: 400;\">cat reports<\/span><span style=\"font-weight: 400;\"> attempts to display file contents. Understanding the distinction between creating a directory and creating or accessing a file is a fundamental Linux command-line skill.<\/span><\/p>\n<p><b>Question: 272. Which command changes the current working directory to <\/b><b>\/var\/log<\/b><b>?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">pwd \/var\/log<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">ls \/var\/log<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">cd \/var\/log<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">cat \/var\/log<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. <\/b><b>cd \/var\/log<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">cd<\/span><span style=\"font-weight: 400;\"> command changes the shell&#8217;s current working directory. Therefore, <\/span><span style=\"font-weight: 400;\">cd \/var\/log<\/span><span style=\"font-weight: 400;\"> moves the current shell session into the <\/span><span style=\"font-weight: 400;\">\/var\/log<\/span><span style=\"font-weight: 400;\"> directory, assuming the path exists and the user has appropriate permissions to access it. <\/span><span style=\"font-weight: 400;\">pwd<\/span><span style=\"font-weight: 400;\"> displays the current directory rather than changing it. <\/span><span style=\"font-weight: 400;\">ls<\/span><span style=\"font-weight: 400;\"> lists directory contents, while <\/span><span style=\"font-weight: 400;\">cat<\/span><span style=\"font-weight: 400;\"> displays file contents and is not normally used for directory navigation. Because the current working directory affects how relative paths are interpreted, understanding <\/span><span style=\"font-weight: 400;\">cd<\/span><span style=\"font-weight: 400;\"> is essential for effective command-line navigation and shell scripting.<\/span><\/p>\n<p><b>Question: 273. Which symbol represents the parent directory in a relative pathname?<\/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;\">~<\/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><b>..<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The special pathname component <\/span><span style=\"font-weight: 400;\">..<\/span><span style=\"font-weight: 400;\"> represents the parent directory of the current directory. For example, <\/span><span style=\"font-weight: 400;\">cd ..<\/span><span style=\"font-weight: 400;\"> moves the shell one directory level upward in the filesystem hierarchy. A single dot (<\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">) represents the current directory, while <\/span><span style=\"font-weight: 400;\">\/<\/span><span style=\"font-weight: 400;\"> represents the root directory when used as the beginning of an absolute pathname. The tilde (<\/span><span style=\"font-weight: 400;\">~<\/span><span style=\"font-weight: 400;\">) is commonly expanded by the shell to represent the current user&#8217;s home directory. These pathname shortcuts are fundamental to navigating Linux filesystems and are frequently used in relative paths and shell commands.<\/span><\/p>\n<p><b>Question: 274. Which shell expansion commonly represents the current user&#8217;s home directory?<\/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;\">..<\/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: 1. <\/b><b>~<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The tilde (<\/span><span style=\"font-weight: 400;\">~<\/span><span style=\"font-weight: 400;\">) is commonly expanded by the shell to represent the current user&#8217;s home directory. For example, <\/span><span style=\"font-weight: 400;\">cd ~<\/span><span style=\"font-weight: 400;\"> normally changes to the user&#8217;s home directory, while <\/span><span style=\"font-weight: 400;\">~\/documents<\/span><span style=\"font-weight: 400;\"> refers to a <\/span><span style=\"font-weight: 400;\">documents<\/span><span style=\"font-weight: 400;\"> path beneath that home directory. The exact expansion is performed by the shell before the command is executed. A single dot represents the current directory, two dots represent the parent directory, and <\/span><span style=\"font-weight: 400;\">\/<\/span><span style=\"font-weight: 400;\"> represents the root of the filesystem hierarchy. Tilde expansion is therefore a convenient way to refer to user-specific paths without typing the complete home-directory pathname.<\/span><\/p>\n<p><b>Question: 275. Which command can display the absolute pathname of the current working directory?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">cd<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">pwd<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">ls<\/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: 2. <\/b><b>pwd<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">pwd<\/span><span style=\"font-weight: 400;\"> command displays the pathname of the shell&#8217;s current working directory. This is useful when navigating through directories because it provides an exact location rather than requiring the user to infer the path from the prompt. By default, <\/span><span style=\"font-weight: 400;\">pwd<\/span><span style=\"font-weight: 400;\"> commonly presents an absolute pathname. <\/span><span style=\"font-weight: 400;\">cd<\/span><span style=\"font-weight: 400;\"> changes the current directory, <\/span><span style=\"font-weight: 400;\">ls<\/span><span style=\"font-weight: 400;\"> lists directory contents, and <\/span><span style=\"font-weight: 400;\">echo<\/span><span style=\"font-weight: 400;\"> displays supplied text or variable values. Knowing the current working directory is especially important when using relative paths, because relative pathnames are interpreted from that location.<\/span><\/p>\n<p><b>Question: 276. Which command can rename a file from <\/b><b>old.txt<\/b><b> to <\/b><b>new.txt<\/b><b>?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">cp old.txt new.txt<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>2.<\/b> <span style=\"font-weight: 400;\">mv old.txt new.txt<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">ln old.txt new.txt<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">cat old.txt &gt; new.txt<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. <\/b><b>mv old.txt new.txt<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400;\">mv<\/span><span style=\"font-weight: 400;\"> command is used to move files or directories and can also rename them when the source and destination are within the same filesystem context. Therefore, <\/span><span style=\"font-weight: 400;\">mv old.txt new.txt<\/span><span style=\"font-weight: 400;\"> changes the directory entry name from <\/span><span style=\"font-weight: 400;\">old.txt<\/span><span style=\"font-weight: 400;\"> to <\/span><span style=\"font-weight: 400;\">new.txt<\/span><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\">cp<\/span><span style=\"font-weight: 400;\"> creates a copy while leaving the original in place, and <\/span><span style=\"font-weight: 400;\">ln<\/span><span style=\"font-weight: 400;\"> creates a link rather than performing a normal rename. Redirecting <\/span><span style=\"font-weight: 400;\">cat<\/span><span style=\"font-weight: 400;\"> output can create another file containing copied data but is not an appropriate general-purpose rename operation. <\/span><span style=\"font-weight: 400;\">mv<\/span><span style=\"font-weight: 400;\"> is therefore the standard command for renaming files and directories.<\/span><\/p>\n<p><b>Question: 277. Which redirection operator appends standard output to an existing file instead of overwriting it?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">&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;\">2&gt;<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. <\/b><b>&gt;&gt;<\/b><\/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;\"> redirection operator appends standard output to a file. If the specified file already contains data, the new output is added to the end rather than replacing the existing contents. If the file does not exist, the shell normally creates it. In contrast, <\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\"> redirects standard output while normally overwriting an existing file, <\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\"> redirects standard input from a file, and <\/span><span style=\"font-weight: 400;\">2&gt;<\/span><span style=\"font-weight: 400;\"> redirects standard error. Understanding these operators is essential when working with logs, command output, and shell scripts because choosing the wrong redirection can unintentionally destroy existing data.<\/span><\/p>\n<p><b>Question: 278. Which file descriptor represents standard error in a Linux shell?<\/b><\/p>\n<ol>\n<li><b><\/b> <span style=\"font-weight: 400;\">0<\/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;\">3<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. <\/b><b>2<\/b><\/p>\n<p><b>Explanation:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">File descriptor <\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\"> represents standard error, commonly abbreviated as <\/span><span style=\"font-weight: 400;\">stderr<\/span><span style=\"font-weight: 400;\">. It is used by commands to report diagnostic or error messages separately from normal standard output. File descriptor <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\"> represents standard input, while <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\"> represents standard output. This separation allows shell users to redirect normal results and error messages independently. For example, <\/span><span style=\"font-weight: 400;\">2&gt;errors.txt<\/span><span style=\"font-weight: 400;\"> redirects standard error to a file. Understanding the three standard file descriptors is fundamental to Linux command-line redirection and is especially important when writing scripts that need to handle normal output and errors separately.<\/span><\/p>\n<p><b>Question: 279. Which operator connects the standard output of one command to the standard input of another command?<\/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;\">|<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">&amp;&amp;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">;<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 2. <\/b><b>|<\/b><\/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 by sending the standard output produced by the command on its left to the standard input of the command on its right. This allows multiple simple utilities to be combined into powerful processing pipelines. For example, the output of one command can be filtered, sorted, counted, or transformed by another command. The <\/span><span style=\"font-weight: 400;\">&gt;&gt;<\/span><span style=\"font-weight: 400;\"> operator appends output to a file, <\/span><span style=\"font-weight: 400;\">&amp;&amp;<\/span><span style=\"font-weight: 400;\"> conditionally runs a following command when the previous command succeeds, and <\/span><span style=\"font-weight: 400;\">;<\/span><span style=\"font-weight: 400;\"> separates sequential commands. Pipes are one of the most important mechanisms for combining Linux command-line tools.<\/span><\/p>\n<p><b>Question: 280. Which command changes 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;\">chmod<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>3.<\/b> <span style=\"font-weight: 400;\">chown<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>4.<\/b> <span style=\"font-weight: 400;\">umask<\/span><\/li>\n<\/ol>\n<p><b>Correct Answer: 3. <\/b><b>chown<\/b><\/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 associated with a file or directory. Depending on the syntax and privileges available, it can change the user owner, the group owner, or both. For example, an administrator can use <\/span><span style=\"font-weight: 400;\">chown user:group file<\/span><span style=\"font-weight: 400;\"> to assign a particular user and group ownership. <\/span><span style=\"font-weight: 400;\">chgrp<\/span><span style=\"font-weight: 400;\"> specifically changes the group ownership, while <\/span><span style=\"font-weight: 400;\">chmod<\/span><span style=\"font-weight: 400;\"> modifies permission bits. <\/span><span style=\"font-weight: 400;\">umask<\/span><span style=\"font-weight: 400;\"> controls the default permission mask applied when new filesystem objects are created. Understanding the distinction between ownership and permissions is important because both affect access to files and directories but are managed through different commands.<\/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: 261. Which command can display the current user&#8217;s login name in a simple form? uname 2. whoami 3. hostname 4. id Correct Answer: 2. whoami Explanation: The whoami command displays the effective username associated with the current shell process. It is useful when [&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\/18632"}],"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=18632"}],"version-history":[{"count":1,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18632\/revisions"}],"predecessor-version":[{"id":18633,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/posts\/18632\/revisions\/18633"}],"wp:attachment":[{"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/media?parent=18632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/categories?post=18632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.examlabs.com\/certification\/wp-json\/wp\/v2\/tags?post=18632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}