101-500 Exam Question 46
Which of the following commands changes the ownership of file.txt to the user dan and the group staff?
Correct Answer: B
The correct command to change the ownership of file.txt to the user dan and the group staff is chown dan:
staff file.txt. This command uses the colon (:) as a separator between the user and the group. The other options are incorrect because they use the wrong syntax or options for the chown command. Option A uses a slash (/) instead of a colon, which is not valid. Option C uses the -u and -g options, which are not supported by the chown command. Option D uses the -g option, which only changes the group, not the user. References:
* [LPI Linux Essentials - 1.3 Basic File Management]
* [LPI Linux Essentials - 2.1 Using Devices, Linux Filesystems, Filesystem Hierarchy Standard]
* [LPI Linux Essentials - 2.2 Mounting, Unmounting Filesystems]
* [LPI Linux Essentials - 2.3 Disk Partitions]
* Chown Command in Linux: How to Change File Ownership - phoenixNAP
* chown command in Linux with Examples - GeeksforGeeks
* Chown Command in Linux: How to Use It - Help Desk Geek
* Chown Command in Linux (File Ownership) | Linuxize
staff file.txt. This command uses the colon (:) as a separator between the user and the group. The other options are incorrect because they use the wrong syntax or options for the chown command. Option A uses a slash (/) instead of a colon, which is not valid. Option C uses the -u and -g options, which are not supported by the chown command. Option D uses the -g option, which only changes the group, not the user. References:
* [LPI Linux Essentials - 1.3 Basic File Management]
* [LPI Linux Essentials - 2.1 Using Devices, Linux Filesystems, Filesystem Hierarchy Standard]
* [LPI Linux Essentials - 2.2 Mounting, Unmounting Filesystems]
* [LPI Linux Essentials - 2.3 Disk Partitions]
* Chown Command in Linux: How to Change File Ownership - phoenixNAP
* chown command in Linux with Examples - GeeksforGeeks
* Chown Command in Linux: How to Use It - Help Desk Geek
* Chown Command in Linux (File Ownership) | Linuxize
101-500 Exam Question 47
Which of the following commands list all files and directories within the /tmp/ directory and its subdirectories which are owned by the user root? (Choose two.)
Correct Answer: A,D
The find command can be used to search for files and directories that match certain criteria, such as ownership, permissions, size, type, name, etc. The syntax of the find command is:
find [options] [path...] [expression]
The options can modify the behavior of the find command, such as how to handle symbolic links, how to optimize the search, or how to enable debugging. The path argument specifies the starting point of the search, which can be one or more directories. The expression argument consists of one or more tests, actions, and operators that are applied to each file or directory that is found.
The -user test matches files or directories that are owned by a given user. The user can be specified by name or by numeric user ID (UID). The -print action prints the full file name of the matching file or directory on the standard output, followed by a newline. If no action is specified, -print is assumed by default.
Therefore, to list all files and directories within the /tmp/ directory and its subdirectories which are owned by the user root, we can use either of the following commands:
* find /tmp -user root -print
* find /tmp -user root
Both commands will search recursively from the /tmp/ directory and print the full file names of the files or directories that are owned by the user root. The -print action is optional in this case, since it is the default action.
The other commands are incorrect for the following reasons:
* find -path /tmp -uid root : The -path test matches files or directories whose full file name matches the given pattern. This command will not search recursively from the /tmp/ directory, but only match files or directories whose name is exactly /tmp. The -uid test is equivalent to the -user test, but it requires a numeric UID instead of a user name. This command will not match any files or directories, unless there is a file or directory named /tmp that is owned by the user with UID root (which is usually 0).
* find -path /tmp -user root -print : This command has the same problem as the previous one. It will not search recursively from the /tmp/ directory, but only match files or directories whose name is exactly
/tmp and are owned by the user root. This command will not match any files or directories, unless there is a file or directory named /tmp that is owned by the user root.
* find /tmp -uid root -print : This command will search recursively from the /tmp/ directory, but it will use the -uid test instead of the -user test. The -uid test requires a numeric UID instead of a user name.
This command will match files or directories that are owned by the user with UID root (which is usually 0), but it will not match files or directories that are owned by other users who have the same user name as root (such as root2 or root3).
:
find(1) - Linux manual page - man7.org
How to Use the find Command in Linux - How-To Geek
find command in Linux with examples - GeeksforGeeks
find | Microsoft Learn
Linux Find Command Help and Examples - Computer Hope
find [options] [path...] [expression]
The options can modify the behavior of the find command, such as how to handle symbolic links, how to optimize the search, or how to enable debugging. The path argument specifies the starting point of the search, which can be one or more directories. The expression argument consists of one or more tests, actions, and operators that are applied to each file or directory that is found.
The -user test matches files or directories that are owned by a given user. The user can be specified by name or by numeric user ID (UID). The -print action prints the full file name of the matching file or directory on the standard output, followed by a newline. If no action is specified, -print is assumed by default.
Therefore, to list all files and directories within the /tmp/ directory and its subdirectories which are owned by the user root, we can use either of the following commands:
* find /tmp -user root -print
* find /tmp -user root
Both commands will search recursively from the /tmp/ directory and print the full file names of the files or directories that are owned by the user root. The -print action is optional in this case, since it is the default action.
The other commands are incorrect for the following reasons:
* find -path /tmp -uid root : The -path test matches files or directories whose full file name matches the given pattern. This command will not search recursively from the /tmp/ directory, but only match files or directories whose name is exactly /tmp. The -uid test is equivalent to the -user test, but it requires a numeric UID instead of a user name. This command will not match any files or directories, unless there is a file or directory named /tmp that is owned by the user with UID root (which is usually 0).
* find -path /tmp -user root -print : This command has the same problem as the previous one. It will not search recursively from the /tmp/ directory, but only match files or directories whose name is exactly
/tmp and are owned by the user root. This command will not match any files or directories, unless there is a file or directory named /tmp that is owned by the user root.
* find /tmp -uid root -print : This command will search recursively from the /tmp/ directory, but it will use the -uid test instead of the -user test. The -uid test requires a numeric UID instead of a user name.
This command will match files or directories that are owned by the user with UID root (which is usually 0), but it will not match files or directories that are owned by other users who have the same user name as root (such as root2 or root3).
:
find(1) - Linux manual page - man7.org
How to Use the find Command in Linux - How-To Geek
find command in Linux with examples - GeeksforGeeks
find | Microsoft Learn
Linux Find Command Help and Examples - Computer Hope
101-500 Exam Question 48
After modifying GNU GRUB's configuration file, which command must be run for the changes to take effect?
Correct Answer: B
After modifying GNU GRUB's configuration file, which is usually located at /etc/default/grub, the command that must be run for the changes to take effect is grub-install12. The grub-install command is used to install GRUB on a device or partition, and to update the boot sector and the core image of GRUB3. The command takes the following basic syntax:
$ grub-install [options] install_device
The install_device argument specifies the device or partition where GRUB should be installed, such as /dev
/sda or /dev/sda1. The options can be used to control various aspects of the installation, such as the target platform, the boot directory, the force mode, the verbosity level, etc3.
The grub-install command also invokes the grub-mkconfig command, which generates the GRUB configuration file (usually located at /boot/grub/grub.cfg) based on the settings in /etc/default/grub and the scripts in /etc/grub.d4. The grub-mkconfig command can also be run separately to update the GRUB configuration file without reinstalling GRUB on the device or partition4.
The other options in the question are not correct because:
* A. kill -HUP $(pidof grub): This command would send the hangup signal (HUP) to the process ID (PID) of grub, which is a command-line interface for GRUB. This would not update the GRUB configuration file or install GRUB on the device or partition.
* C. grub: This command would run the command-line interface for GRUB, which allows the user to interact with GRUB and execute various commands. This would not update the GRUB configuration file or install GRUB on the device or partition, unless the user explicitly runs the appropriate commands within the interface.
* D. No action is required: This option is false, because modifying the /etc/default/grub file alone does not affect the GRUB configuration file or the GRUB installation. The user needs to run either grub- install or grub-mkconfig to apply the changes.
:
1: How to Update Grub on Ubuntu and Other Linux Distributions - It's FOSS 2: How to Configure the GRUB2 Boot Loader's Settings 3: Ubuntu Manpage: grub-install - install GRUB on a device 4: [GNU GRUB Manual 2.06: Invoking grub-mkconfig] : [GNU GRUB Manual 2.06: Invoking grub] : [kill(1) - Linux manual page] : [pidof(8) - Linux manual page] : [grub(8) - Linux manual page]
$ grub-install [options] install_device
The install_device argument specifies the device or partition where GRUB should be installed, such as /dev
/sda or /dev/sda1. The options can be used to control various aspects of the installation, such as the target platform, the boot directory, the force mode, the verbosity level, etc3.
The grub-install command also invokes the grub-mkconfig command, which generates the GRUB configuration file (usually located at /boot/grub/grub.cfg) based on the settings in /etc/default/grub and the scripts in /etc/grub.d4. The grub-mkconfig command can also be run separately to update the GRUB configuration file without reinstalling GRUB on the device or partition4.
The other options in the question are not correct because:
* A. kill -HUP $(pidof grub): This command would send the hangup signal (HUP) to the process ID (PID) of grub, which is a command-line interface for GRUB. This would not update the GRUB configuration file or install GRUB on the device or partition.
* C. grub: This command would run the command-line interface for GRUB, which allows the user to interact with GRUB and execute various commands. This would not update the GRUB configuration file or install GRUB on the device or partition, unless the user explicitly runs the appropriate commands within the interface.
* D. No action is required: This option is false, because modifying the /etc/default/grub file alone does not affect the GRUB configuration file or the GRUB installation. The user needs to run either grub- install or grub-mkconfig to apply the changes.
:
1: How to Update Grub on Ubuntu and Other Linux Distributions - It's FOSS 2: How to Configure the GRUB2 Boot Loader's Settings 3: Ubuntu Manpage: grub-install - install GRUB on a device 4: [GNU GRUB Manual 2.06: Invoking grub-mkconfig] : [GNU GRUB Manual 2.06: Invoking grub] : [kill(1) - Linux manual page] : [pidof(8) - Linux manual page] : [grub(8) - Linux manual page]
101-500 Exam Question 49
Which of the following commands redirects the output of ls to standard error?
Correct Answer: C
This command redirects the output of ls to standard error, which is file descriptor 2 by default. The syntax of the command is:
ls >& file_descriptor
The ls command is a utility that lists the files and directories in the current working directory or a specified directory. The >& symbol is a redirection operator that redirects the standard output of a command to another file descriptor, which can be a file, a device, or another stream. The file_descriptor is the number of the file descriptor to which the output is redirected.
Therefore, the command ls >&2 will run the ls command and redirect its output to file descriptor 2, which is standard error. This means that the output of ls will not be displayed on the screen, but sent to the standard error stream, which can be used for error handling or logging purposes.
The other commands are incorrect for the following reasons:
* A, ls >-1: This command will not redirect the output of ls to standard error, but it will cause an error.
The > symbol is a redirection operator that redirects the standard output of a command to a file or device, overwriting any existing content. The -1 argument is not a valid file name or device name, and it will cause the shell to report an error and exit.
* B, ls <<ERR: This command will not redirect the output of ls to standard error, but it will use a here document as the standard input of ls. The << symbol is a redirection operator that redirects the standard input of a command from a here document, which is a block of text that follows the command. The ERR argument is the delimiter that marks the end of the here document. However, the ls command does not read from the standard input, and it will ignore the here document. The command will display the files and directories in the current working directory on the screen, as usual.
* D, ls >>2: This command will not redirect the output of ls to standard error, but it will append the output of ls to a file named 2. The >> symbol is a redirection operator that redirects the standard output of a command to a file or device, appending to any existing content. The 2 argument is the name of the file to which the output is appended. If the file does not exist, it will be created. The command will not display anything on the screen, but write the output of ls to the file 2.
* E, ls |error: This command will not redirect the output of ls to standard error, but it will pipe the output of ls to another command named error. The | symbol is a pipe operator that redirects the standard output of one command to the standard input of another command. The error argument is the name of the command that receives the output of ls as its input. However, there is no such command named error in the Linux system, and the shell will report an error and exit.
ls >& file_descriptor
The ls command is a utility that lists the files and directories in the current working directory or a specified directory. The >& symbol is a redirection operator that redirects the standard output of a command to another file descriptor, which can be a file, a device, or another stream. The file_descriptor is the number of the file descriptor to which the output is redirected.
Therefore, the command ls >&2 will run the ls command and redirect its output to file descriptor 2, which is standard error. This means that the output of ls will not be displayed on the screen, but sent to the standard error stream, which can be used for error handling or logging purposes.
The other commands are incorrect for the following reasons:
* A, ls >-1: This command will not redirect the output of ls to standard error, but it will cause an error.
The > symbol is a redirection operator that redirects the standard output of a command to a file or device, overwriting any existing content. The -1 argument is not a valid file name or device name, and it will cause the shell to report an error and exit.
* B, ls <<ERR: This command will not redirect the output of ls to standard error, but it will use a here document as the standard input of ls. The << symbol is a redirection operator that redirects the standard input of a command from a here document, which is a block of text that follows the command. The ERR argument is the delimiter that marks the end of the here document. However, the ls command does not read from the standard input, and it will ignore the here document. The command will display the files and directories in the current working directory on the screen, as usual.
* D, ls >>2: This command will not redirect the output of ls to standard error, but it will append the output of ls to a file named 2. The >> symbol is a redirection operator that redirects the standard output of a command to a file or device, appending to any existing content. The 2 argument is the name of the file to which the output is appended. If the file does not exist, it will be created. The command will not display anything on the screen, but write the output of ls to the file 2.
* E, ls |error: This command will not redirect the output of ls to standard error, but it will pipe the output of ls to another command named error. The | symbol is a pipe operator that redirects the standard output of one command to the standard input of another command. The error argument is the name of the command that receives the output of ls as its input. However, there is no such command named error in the Linux system, and the shell will report an error and exit.
101-500 Exam Question 50
Which of the following signals is sent to a process when the key combination CTRL+C is pressed on the keyboard?
Correct Answer: B
The SIGINT signal is sent to a process when the user presses the key combination CTRL+C on the keyboard.
This signal is used to interrupt the process and cause it to terminate, unless the process catches or ignores the signal. The SIGTERM signal is the default signal sent by the kill command to request a process to terminate gracefully. The SIGSTOP signal is used to pause a process and make it stop executing until it receives a SIGCONT signal. The SIGKILL signal is used to force a process to terminate immediately and cannot be caught or ignored by the process. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.2 Process management
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
This signal is used to interrupt the process and cause it to terminate, unless the process catches or ignores the signal. The SIGTERM signal is the default signal sent by the kill command to request a process to terminate gracefully. The SIGSTOP signal is used to pause a process and make it stop executing until it receives a SIGCONT signal. The SIGKILL signal is used to force a process to terminate immediately and cannot be caught or ignored by the process. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.2 Process management
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
- Other Version
- 4108Lpi.101-500.v2022-11-30.q106
- 103Lpi.Prep4king.101-500.v2022-04-27.by.morton.131q.pdf
- 6163Lpi.101-500.v2022-02-03.q131
- 4861Lpi.101-500.v2021-10-31.q110
- 62Lpi.Prepawaytest.101-500.v2021-08-15.by.una.105q.pdf
- Latest Upload
- 116SAP.C_THR84_2505.v2026-01-12.q37
- 106Salesforce.CRT-261.v2026-01-12.q83
- 156Microsoft.SC-400.v2026-01-11.q164
- 134SAP.C_THR88_2505.v2026-01-11.q67
- 136CIPS.L4M6.v2026-01-11.q106
- 122SAP.C_S4CS_2502.v2026-01-11.q35
- 157Lpi.101-500.v2026-01-11.q128
- 110Salesforce.Health-Cloud-Accredited-Professional.v2026-01-10.q45
- 162Microsoft.AZ-900.v2026-01-10.q234
- 141VMware.3V0-32.23.v2026-01-10.q133
[×]
Download PDF File
Enter your email address to download Lpi.101-500.v2026-01-11.q128 Practice Test
