You have already completed the Test before. Hence you can not start it again.
Test is loading...
You must sign in or sign up to start the Test.
You have to finish following quiz, to start this Test:
Your results are here!! for" Linux LPIC-1 (101-500) Practice Test 4 "
0 of 60 questions answered correctly
Your time:
Time has elapsed
Your Final Score is : 0
You have attempted : 0
Number of Correct Questions : 0 and scored 0
Number of Incorrect Questions : 0 and Negative marks 0
Average score
Your score
Linux LPIC-1 (101-500)
You have attempted: 0
Number of Correct Questions: 0 and scored 0
Number of Incorrect Questions: 0 and Negative marks 0
You can review your answers by clicking on “View Answers” option. Important Note : Open Reference Documentation Links in New Tab (Right Click and Open in New Tab).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Answered
Review
Question 1 of 60
1. Question
On a system using SysVinit, you need to halt the system immediately without sending termination signals to running processes, making sure they do not get a chance to perform clean-up actions. Which of the following telinit commands would achieve this?
Correct
Correct Answer: B. telinit -h Explanation: In SysVinit systems, telinit with the -h option can be used to halt the system immediately without sending any signals to processes. This means that processes do not get the opportunity to perform any clean-up before the system halts. Option A is incorrect. While telinit 0 will halt the system, it sends the termination signals to processes, allowing them to perform clean-up before halting. Option C is incorrect. telinit h is not a standard command to halt the system. Option D is incorrect. telinit 6 is used to reboot the system, not halt it.
Incorrect
Correct Answer: B. telinit -h Explanation: In SysVinit systems, telinit with the -h option can be used to halt the system immediately without sending any signals to processes. This means that processes do not get the opportunity to perform any clean-up before the system halts. Option A is incorrect. While telinit 0 will halt the system, it sends the termination signals to processes, allowing them to perform clean-up before halting. Option C is incorrect. telinit h is not a standard command to halt the system. Option D is incorrect. telinit 6 is used to reboot the system, not halt it.
Unattempted
Correct Answer: B. telinit -h Explanation: In SysVinit systems, telinit with the -h option can be used to halt the system immediately without sending any signals to processes. This means that processes do not get the opportunity to perform any clean-up before the system halts. Option A is incorrect. While telinit 0 will halt the system, it sends the termination signals to processes, allowing them to perform clean-up before halting. Option C is incorrect. telinit h is not a standard command to halt the system. Option D is incorrect. telinit 6 is used to reboot the system, not halt it.
Question 2 of 60
2. Question
Sophia is currently in her home directory and wants to copy a file named report.doc from her documents folder to a USB drive mounted at /media/usb-drive. Which command should she use to achieve this without changing her current directory?
Correct
Correct Answer: C. cp ~/documents/report.doc /media/usb-drive/ Explanation: The tilde (~) is a shorthand for the user‘s home directory. Given that Sophia wants to copy a file from the “documents“ folder inside her home directory, the path would be ~/documents/report.doc. The destination is correctly specified as /media/usb-drive/. Option A is incorrect. The file path provided suggests that “report.doc“ is directly inside her home directory, not the “documents“ folder. Option B is incorrect. The file path provided suggests that “report.doc“ is in her current directory, but the scenario specifies that the file is in the “documents“ folder inside her home directory. Option D is incorrect. This command would copy the entire “documents“ directory recursively to the USB drive, not just the “report.doc“ file.
Incorrect
Correct Answer: C. cp ~/documents/report.doc /media/usb-drive/ Explanation: The tilde (~) is a shorthand for the user‘s home directory. Given that Sophia wants to copy a file from the “documents“ folder inside her home directory, the path would be ~/documents/report.doc. The destination is correctly specified as /media/usb-drive/. Option A is incorrect. The file path provided suggests that “report.doc“ is directly inside her home directory, not the “documents“ folder. Option B is incorrect. The file path provided suggests that “report.doc“ is in her current directory, but the scenario specifies that the file is in the “documents“ folder inside her home directory. Option D is incorrect. This command would copy the entire “documents“ directory recursively to the USB drive, not just the “report.doc“ file.
Unattempted
Correct Answer: C. cp ~/documents/report.doc /media/usb-drive/ Explanation: The tilde (~) is a shorthand for the user‘s home directory. Given that Sophia wants to copy a file from the “documents“ folder inside her home directory, the path would be ~/documents/report.doc. The destination is correctly specified as /media/usb-drive/. Option A is incorrect. The file path provided suggests that “report.doc“ is directly inside her home directory, not the “documents“ folder. Option B is incorrect. The file path provided suggests that “report.doc“ is in her current directory, but the scenario specifies that the file is in the “documents“ folder inside her home directory. Option D is incorrect. This command would copy the entire “documents“ directory recursively to the USB drive, not just the “report.doc“ file.
Question 3 of 60
3. Question
Tom, a junior system administrator, has been assigned a task to ensure that all new files created by users in the system have no execute permissions for both owner and group by default. Which command should Tom use to accomplish this?
Correct
Correct Answer: B. umask 033 Explanation: The umask command defines the default permissions when a new file or directory is created. The mask value subtracts from the full permissions (which are 777 for files). A umask value of 033 would subtract execute permission from both owner and group, resulting in a default file permission of 744. Option A is incorrect. This sets the default permissions to ′774′, which means the others won‘t have any permissions, but the owner and group still have execute permissions. Option C is incorrect. This sets the default permissions to ′755′, which only subtracts write permission for group and others but does not subtract execute permissions. Option D is incorrect. This sets the default permissions to ′700′, which means only the owner can read, write, and execute, while the group and others have no permissions.
Incorrect
Correct Answer: B. umask 033 Explanation: The umask command defines the default permissions when a new file or directory is created. The mask value subtracts from the full permissions (which are 777 for files). A umask value of 033 would subtract execute permission from both owner and group, resulting in a default file permission of 744. Option A is incorrect. This sets the default permissions to ′774′, which means the others won‘t have any permissions, but the owner and group still have execute permissions. Option C is incorrect. This sets the default permissions to ′755′, which only subtracts write permission for group and others but does not subtract execute permissions. Option D is incorrect. This sets the default permissions to ′700′, which means only the owner can read, write, and execute, while the group and others have no permissions.
Unattempted
Correct Answer: B. umask 033 Explanation: The umask command defines the default permissions when a new file or directory is created. The mask value subtracts from the full permissions (which are 777 for files). A umask value of 033 would subtract execute permission from both owner and group, resulting in a default file permission of 744. Option A is incorrect. This sets the default permissions to ′774′, which means the others won‘t have any permissions, but the owner and group still have execute permissions. Option C is incorrect. This sets the default permissions to ′755′, which only subtracts write permission for group and others but does not subtract execute permissions. Option D is incorrect. This sets the default permissions to ′700′, which means only the owner can read, write, and execute, while the group and others have no permissions.
Question 4 of 60
4. Question
Michael wants to find all files in the /home/michael/documents directory that have been modified in the last 2 days. Which of the following commands should he use?
Correct
Correct Answer: B. find /home/michael/documents -mtime -2 Explanation: The -mtime option of the find command searches for files based on their modification time. When -mtime is followed by a negative number (like -2), it matches files that have been modified within the last 2 days. Option A is incorrect. Using ′-mtime 2′ without the negative sign would find files that were exactly modified 2 days ago, not within the last 2 days. Option C is incorrect. There‘s no ′-mdate′ option in the ′find′ command. Option D is incorrect. The ′-modified′ is not a valid option for the ′find′ command.
Incorrect
Correct Answer: B. find /home/michael/documents -mtime -2 Explanation: The -mtime option of the find command searches for files based on their modification time. When -mtime is followed by a negative number (like -2), it matches files that have been modified within the last 2 days. Option A is incorrect. Using ′-mtime 2′ without the negative sign would find files that were exactly modified 2 days ago, not within the last 2 days. Option C is incorrect. There‘s no ′-mdate′ option in the ′find′ command. Option D is incorrect. The ′-modified′ is not a valid option for the ′find′ command.
Unattempted
Correct Answer: B. find /home/michael/documents -mtime -2 Explanation: The -mtime option of the find command searches for files based on their modification time. When -mtime is followed by a negative number (like -2), it matches files that have been modified within the last 2 days. Option A is incorrect. Using ′-mtime 2′ without the negative sign would find files that were exactly modified 2 days ago, not within the last 2 days. Option C is incorrect. There‘s no ′-mdate′ option in the ′find′ command. Option D is incorrect. The ′-modified′ is not a valid option for the ′find′ command.
Question 5 of 60
5. Question
Samantha is a junior systems administrator. She has been asked to modify the configuration of a specific systemd service. Instead of editing the primary service file directly, she wants to create an override file in the appropriate directory. Where should Samantha place this override file?
Correct
Correct Answer: A. /etc/systemd/system/service-name.service.d/ Explanation: When one wants to override or add certain configurations to a systemd service without editing the main service file, they should place the override file in the /etc/systemd/system/service-name.service.d/ directory. The files in this directory are read in alphabetical order and can be used to add or overwrite settings of the primary service file. Option B is incorrect. While this directory holds the custom service and target units, placing override files directly in this directory won‘t affect the service‘s behavior. Option C is incorrect. There is no default directory /etc/systemd/override/. Option D is incorrect. The directory /etc/systemd/config/ does not exist by default for systemd service configurations.
Incorrect
Correct Answer: A. /etc/systemd/system/service-name.service.d/ Explanation: When one wants to override or add certain configurations to a systemd service without editing the main service file, they should place the override file in the /etc/systemd/system/service-name.service.d/ directory. The files in this directory are read in alphabetical order and can be used to add or overwrite settings of the primary service file. Option B is incorrect. While this directory holds the custom service and target units, placing override files directly in this directory won‘t affect the service‘s behavior. Option C is incorrect. There is no default directory /etc/systemd/override/. Option D is incorrect. The directory /etc/systemd/config/ does not exist by default for systemd service configurations.
Unattempted
Correct Answer: A. /etc/systemd/system/service-name.service.d/ Explanation: When one wants to override or add certain configurations to a systemd service without editing the main service file, they should place the override file in the /etc/systemd/system/service-name.service.d/ directory. The files in this directory are read in alphabetical order and can be used to add or overwrite settings of the primary service file. Option B is incorrect. While this directory holds the custom service and target units, placing override files directly in this directory won‘t affect the service‘s behavior. Option C is incorrect. There is no default directory /etc/systemd/override/. Option D is incorrect. The directory /etc/systemd/config/ does not exist by default for systemd service configurations.
Question 6 of 60
6. Question
Julia, a system administrator, noticed that the file project-notes.txt should be accessible (both read and write) only by members of the group developers. She wants to ensure that only members of this group can read and write the file while no one else can. Which of the following commands should Julia use?
Correct
Correct Answer: D. chmod 660 project-notes.txt Explanation: Using chmod 660 sets the file permissions so that the owner and the group members have read and write access, while others have no permissions. If Julia ensures that the file belongs to the group “developers“, only members of that group and the owner of the file will have access. Option A is incorrect. ′chmod 664′ allows everyone to read the file, which is not the desired behavior. Option B is incorrect. ′chmod 760′ provides the owner full permissions but restricts the group to only reading and writing. Although it restricts access from others, it unnecessarily grants execute permission to the owner. Option C is incorrect. ′chmod 770′ grants read, write, and execute permissions to both the owner and the group, which isn‘t required.
Incorrect
Correct Answer: D. chmod 660 project-notes.txt Explanation: Using chmod 660 sets the file permissions so that the owner and the group members have read and write access, while others have no permissions. If Julia ensures that the file belongs to the group “developers“, only members of that group and the owner of the file will have access. Option A is incorrect. ′chmod 664′ allows everyone to read the file, which is not the desired behavior. Option B is incorrect. ′chmod 760′ provides the owner full permissions but restricts the group to only reading and writing. Although it restricts access from others, it unnecessarily grants execute permission to the owner. Option C is incorrect. ′chmod 770′ grants read, write, and execute permissions to both the owner and the group, which isn‘t required.
Unattempted
Correct Answer: D. chmod 660 project-notes.txt Explanation: Using chmod 660 sets the file permissions so that the owner and the group members have read and write access, while others have no permissions. If Julia ensures that the file belongs to the group “developers“, only members of that group and the owner of the file will have access. Option A is incorrect. ′chmod 664′ allows everyone to read the file, which is not the desired behavior. Option B is incorrect. ′chmod 760′ provides the owner full permissions but restricts the group to only reading and writing. Although it restricts access from others, it unnecessarily grants execute permission to the owner. Option C is incorrect. ′chmod 770′ grants read, write, and execute permissions to both the owner and the group, which isn‘t required.
Question 7 of 60
7. Question
Jessica wants to create a compressed archive of a directory named projects and save it as projects.tar.gz. Which command should she use to accomplish this?
Correct
Correct Answer: A. tar -czvf projects.tar.gz projects Explanation: The tar command with the -czvf options creates a gzipped (compressed) archive. -c stands for create a new archive, -z stands for compress using gzip, -v stands for verbose mode (showing the progress in the terminal), and -f allows specifying the filename. Option B is incorrect. The ′-cvf′ options would create an archive without compression, resulting in a ′.tar′ file, not a ′.tar.gz′ file. Option C is incorrect. The ′-zxvf′ options are used for extracting a gzipped archive, not for creating one. Option D is incorrect. The ′-cf′ options would create an archive without compression, much like option B.
Incorrect
Correct Answer: A. tar -czvf projects.tar.gz projects Explanation: The tar command with the -czvf options creates a gzipped (compressed) archive. -c stands for create a new archive, -z stands for compress using gzip, -v stands for verbose mode (showing the progress in the terminal), and -f allows specifying the filename. Option B is incorrect. The ′-cvf′ options would create an archive without compression, resulting in a ′.tar′ file, not a ′.tar.gz′ file. Option C is incorrect. The ′-zxvf′ options are used for extracting a gzipped archive, not for creating one. Option D is incorrect. The ′-cf′ options would create an archive without compression, much like option B.
Unattempted
Correct Answer: A. tar -czvf projects.tar.gz projects Explanation: The tar command with the -czvf options creates a gzipped (compressed) archive. -c stands for create a new archive, -z stands for compress using gzip, -v stands for verbose mode (showing the progress in the terminal), and -f allows specifying the filename. Option B is incorrect. The ′-cvf′ options would create an archive without compression, resulting in a ′.tar′ file, not a ′.tar.gz′ file. Option C is incorrect. The ′-zxvf′ options are used for extracting a gzipped archive, not for creating one. Option D is incorrect. The ′-cf′ options would create an archive without compression, much like option B.
Question 8 of 60
8. Question
As a system administrator, you have created a custom service for an application. In which directory under /etc/systemd/ should the unit file for this custom service be placed?
Correct
Correct Answer: C. /etc/systemd/system/ Explanation: For custom services and modifications, the appropriate location to place the unit file is within /etc/systemd/system/. This allows for the customization of any unit without altering the default system unit files. Option A is incorrect. There is no /etc/systemd/systemd-services/ directory by default. Custom service unit files should be placed in /etc/systemd/system/. Option B is incorrect. /etc/systemd/services.d/ is not the standard directory for custom service unit files. The right directory is /etc/systemd/system/. Option D is incorrect. There isn‘t a standard /etc/systemd/units/ directory. The appropriate directory is /etc/systemd/system/.
Incorrect
Correct Answer: C. /etc/systemd/system/ Explanation: For custom services and modifications, the appropriate location to place the unit file is within /etc/systemd/system/. This allows for the customization of any unit without altering the default system unit files. Option A is incorrect. There is no /etc/systemd/systemd-services/ directory by default. Custom service unit files should be placed in /etc/systemd/system/. Option B is incorrect. /etc/systemd/services.d/ is not the standard directory for custom service unit files. The right directory is /etc/systemd/system/. Option D is incorrect. There isn‘t a standard /etc/systemd/units/ directory. The appropriate directory is /etc/systemd/system/.
Unattempted
Correct Answer: C. /etc/systemd/system/ Explanation: For custom services and modifications, the appropriate location to place the unit file is within /etc/systemd/system/. This allows for the customization of any unit without altering the default system unit files. Option A is incorrect. There is no /etc/systemd/systemd-services/ directory by default. Custom service unit files should be placed in /etc/systemd/system/. Option B is incorrect. /etc/systemd/services.d/ is not the standard directory for custom service unit files. The right directory is /etc/systemd/system/. Option D is incorrect. There isn‘t a standard /etc/systemd/units/ directory. The appropriate directory is /etc/systemd/system/.
Question 9 of 60
9. Question
As a system administrator, you want to send a message to all logged-in users notifying them of an upcoming server reboot. Which command would you use to send this broadcast message?
Correct
Correct Answer: A. echo “Server reboot in 10 minutes“ | wall Explanation: The wall command is used to send a message to all logged-in users. You can pipe a message into wall using echo to broadcast it to all users. Option B is incorrect. The syntax used here is incorrect. The cat command cannot send a message in this manner, and > is used for redirection and not for sending messages. Option C is incorrect. The wall command doesn‘t have a -m option for sending messages. Option D is incorrect. The send command is not a standard command for this purpose, and the syntax is incorrect.
Incorrect
Correct Answer: A. echo “Server reboot in 10 minutes“ | wall Explanation: The wall command is used to send a message to all logged-in users. You can pipe a message into wall using echo to broadcast it to all users. Option B is incorrect. The syntax used here is incorrect. The cat command cannot send a message in this manner, and > is used for redirection and not for sending messages. Option C is incorrect. The wall command doesn‘t have a -m option for sending messages. Option D is incorrect. The send command is not a standard command for this purpose, and the syntax is incorrect.
Unattempted
Correct Answer: A. echo “Server reboot in 10 minutes“ | wall Explanation: The wall command is used to send a message to all logged-in users. You can pipe a message into wall using echo to broadcast it to all users. Option B is incorrect. The syntax used here is incorrect. The cat command cannot send a message in this manner, and > is used for redirection and not for sending messages. Option C is incorrect. The wall command doesn‘t have a -m option for sending messages. Option D is incorrect. The send command is not a standard command for this purpose, and the syntax is incorrect.
Question 10 of 60
10. Question
Jeremy, a Linux system administrator, has been provided with a package named editor.rpm. He wants to install this package on his system. Which of the following commands should he use?
Correct
Correct Answer: B. rpm -ivh editor.rpm Explanation: The rpm -ivh command is used to install an RPM package. The ‘i‘ stands for install, ‘v‘ stands for verbose (so it shows more information), and ‘h‘ shows hash marks as the package installs. Option A is incorrect. While yum can be used to install packages, the preferred way to directly install an RPM file is using the rpm command. Option C is incorrect. zypper search is used to search for packages in the Zypper repositories, not to install a package. Option D is incorrect. rpm -q is used to query the RPM database to check if a package is installed or to get information about an installed package.
Incorrect
Correct Answer: B. rpm -ivh editor.rpm Explanation: The rpm -ivh command is used to install an RPM package. The ‘i‘ stands for install, ‘v‘ stands for verbose (so it shows more information), and ‘h‘ shows hash marks as the package installs. Option A is incorrect. While yum can be used to install packages, the preferred way to directly install an RPM file is using the rpm command. Option C is incorrect. zypper search is used to search for packages in the Zypper repositories, not to install a package. Option D is incorrect. rpm -q is used to query the RPM database to check if a package is installed or to get information about an installed package.
Unattempted
Correct Answer: B. rpm -ivh editor.rpm Explanation: The rpm -ivh command is used to install an RPM package. The ‘i‘ stands for install, ‘v‘ stands for verbose (so it shows more information), and ‘h‘ shows hash marks as the package installs. Option A is incorrect. While yum can be used to install packages, the preferred way to directly install an RPM file is using the rpm command. Option C is incorrect. zypper search is used to search for packages in the Zypper repositories, not to install a package. Option D is incorrect. rpm -q is used to query the RPM database to check if a package is installed or to get information about an installed package.
Question 11 of 60
11. Question
Anna, a system administrator, wants to send a broadcast message to all users currently logged into the system about an impending reboot in 10 minutes. Which command should she use to accomplish this?
Correct
Correct Answer: A. wall “System will reboot in 10 minutes“ Explanation: The wall command stands for “write to all“. It is used to send a message to all users logged into a system. By providing a message as an argument, Anna can broadcast her notification to all the users about the impending reboot. Option B is incorrect. There is no standard sendmsg command for sending broadcast messages to all users. Option C is incorrect. The broadcast command is not a standard Linux command for sending messages to users. Option D is incorrect. There is no standard announce command in Linux for sending messages to users.
Incorrect
Correct Answer: A. wall “System will reboot in 10 minutes“ Explanation: The wall command stands for “write to all“. It is used to send a message to all users logged into a system. By providing a message as an argument, Anna can broadcast her notification to all the users about the impending reboot. Option B is incorrect. There is no standard sendmsg command for sending broadcast messages to all users. Option C is incorrect. The broadcast command is not a standard Linux command for sending messages to users. Option D is incorrect. There is no standard announce command in Linux for sending messages to users.
Unattempted
Correct Answer: A. wall “System will reboot in 10 minutes“ Explanation: The wall command stands for “write to all“. It is used to send a message to all users logged into a system. By providing a message as an argument, Anna can broadcast her notification to all the users about the impending reboot. Option B is incorrect. There is no standard sendmsg command for sending broadcast messages to all users. Option C is incorrect. The broadcast command is not a standard Linux command for sending messages to users. Option D is incorrect. There is no standard announce command in Linux for sending messages to users.
Question 12 of 60
12. Question
Jason is setting up a new Debian server and needs to configure his package sources. He knows that the main configuration file for APT repositories is /etc/apt/sources.list. What is the primary purpose of this file?
Correct
Correct Answer: C. To define from where the system retrieves its packages Explanation: The /etc/apt/sources.list file in Debian and its derivatives contains repository lines that determine where the system retrieves its packages from. This includes official Debian repositories, third-party repositories, or even local repositories. Option A is incorrect. The /etc/apt/sources.list file doesn‘t list all installed packages. That‘s a function of the package database, and you would use commands like dpkg -l or apt list –installed to view installed packages. Option B is incorrect. While /etc/apt/sources.list is a configuration file, it doesn‘t store configurations for the APT tool‘s operations. Instead, it specifies the repositories that APT should use. Option D is incorrect. APT operations are not logged in the /etc/apt/sources.list file. For APT-related logs, one might look in /var/log/apt.
Incorrect
Correct Answer: C. To define from where the system retrieves its packages Explanation: The /etc/apt/sources.list file in Debian and its derivatives contains repository lines that determine where the system retrieves its packages from. This includes official Debian repositories, third-party repositories, or even local repositories. Option A is incorrect. The /etc/apt/sources.list file doesn‘t list all installed packages. That‘s a function of the package database, and you would use commands like dpkg -l or apt list –installed to view installed packages. Option B is incorrect. While /etc/apt/sources.list is a configuration file, it doesn‘t store configurations for the APT tool‘s operations. Instead, it specifies the repositories that APT should use. Option D is incorrect. APT operations are not logged in the /etc/apt/sources.list file. For APT-related logs, one might look in /var/log/apt.
Unattempted
Correct Answer: C. To define from where the system retrieves its packages Explanation: The /etc/apt/sources.list file in Debian and its derivatives contains repository lines that determine where the system retrieves its packages from. This includes official Debian repositories, third-party repositories, or even local repositories. Option A is incorrect. The /etc/apt/sources.list file doesn‘t list all installed packages. That‘s a function of the package database, and you would use commands like dpkg -l or apt list –installed to view installed packages. Option B is incorrect. While /etc/apt/sources.list is a configuration file, it doesn‘t store configurations for the APT tool‘s operations. Instead, it specifies the repositories that APT should use. Option D is incorrect. APT operations are not logged in the /etc/apt/sources.list file. For APT-related logs, one might look in /var/log/apt.
Question 13 of 60
13. Question
While troubleshooting a server, you need to switch to a single-user mode to perform some maintenance tasks without network services or other users. Which command would you use with telinit to achieve this?
Correct
Correct Answer: A. telinit 1 Explanation: The telinit command is used to change the system runlevel. Single-user mode, which is useful for maintenance tasks, is entered using runlevel 1. Thus, telinit 1 is the appropriate command to switch to single-user mode. Option B is incorrect. While the term “single“ is associated with single-user mode, the correct syntax with telinit is telinit 1 and not telinit single. Option C is incorrect. There is no “maintenance“ runlevel or command in telinit. Option D is incorrect. Though telinit S or telinit s can also be used to enter single-user mode, option A is more standard and universally recognized.
Incorrect
Correct Answer: A. telinit 1 Explanation: The telinit command is used to change the system runlevel. Single-user mode, which is useful for maintenance tasks, is entered using runlevel 1. Thus, telinit 1 is the appropriate command to switch to single-user mode. Option B is incorrect. While the term “single“ is associated with single-user mode, the correct syntax with telinit is telinit 1 and not telinit single. Option C is incorrect. There is no “maintenance“ runlevel or command in telinit. Option D is incorrect. Though telinit S or telinit s can also be used to enter single-user mode, option A is more standard and universally recognized.
Unattempted
Correct Answer: A. telinit 1 Explanation: The telinit command is used to change the system runlevel. Single-user mode, which is useful for maintenance tasks, is entered using runlevel 1. Thus, telinit 1 is the appropriate command to switch to single-user mode. Option B is incorrect. While the term “single“ is associated with single-user mode, the correct syntax with telinit is telinit 1 and not telinit single. Option C is incorrect. There is no “maintenance“ runlevel or command in telinit. Option D is incorrect. Though telinit S or telinit s can also be used to enter single-user mode, option A is more standard and universally recognized.
Question 14 of 60
14. Question
Sara, a Linux administrator, is troubleshooting an application on her Debian system. She needs to find out the version, dependencies, and whether the package example-app is currently installed or not. Which command should she use?
Correct
Correct Answer: C. dpkg -s example-app Explanation: The dpkg -s command provides detailed information about a specific package, including its version, dependencies, and installation status. This is the appropriate tool for Sara to use to gather the required details about the “example-app“ package. Option A is incorrect. apt-get does not have an “info“ option. For package information, apt show or dpkg -s would be more appropriate. Option B is incorrect. While apt show does provide information about a package, it won‘t specifically indicate if the package is currently installed. dpkg -s provides a clearer indication of installation status. Option D is incorrect. apt-file is used to search for files within Debian packages. It doesn‘t provide detailed package information like version or dependencies.
Incorrect
Correct Answer: C. dpkg -s example-app Explanation: The dpkg -s command provides detailed information about a specific package, including its version, dependencies, and installation status. This is the appropriate tool for Sara to use to gather the required details about the “example-app“ package. Option A is incorrect. apt-get does not have an “info“ option. For package information, apt show or dpkg -s would be more appropriate. Option B is incorrect. While apt show does provide information about a package, it won‘t specifically indicate if the package is currently installed. dpkg -s provides a clearer indication of installation status. Option D is incorrect. apt-file is used to search for files within Debian packages. It doesn‘t provide detailed package information like version or dependencies.
Unattempted
Correct Answer: C. dpkg -s example-app Explanation: The dpkg -s command provides detailed information about a specific package, including its version, dependencies, and installation status. This is the appropriate tool for Sara to use to gather the required details about the “example-app“ package. Option A is incorrect. apt-get does not have an “info“ option. For package information, apt show or dpkg -s would be more appropriate. Option B is incorrect. While apt show does provide information about a package, it won‘t specifically indicate if the package is currently installed. dpkg -s provides a clearer indication of installation status. Option D is incorrect. apt-file is used to search for files within Debian packages. It doesn‘t provide detailed package information like version or dependencies.
Question 15 of 60
15. Question
Lee wants to create a new directory named projects inside his current directory. Additionally, inside projects, he wishes to create two subdirectories named completed and ongoing at the same time. Which command should he use?
Correct
Correct Answer: B. mkdir -p projects/completed projects/ongoing Explanation: The mkdir command is used to create directories. The -p option allows the creation of parent directories as needed. In this case, using -p ensures that the “projects“ directory is created first, and then the “completed“ and “ongoing“ subdirectories are created inside it. Option A is incorrect. This command would try to create a directory named “ongoing“ in the current directory and another directory named “completed“ inside a “projects“ directory, but it wouldn‘t create the “projects“ directory if it didn‘t exist. Option C is incorrect. This command would create the “projects“ directory, but then it would create “completed“ and “ongoing“ directories at the same level as “projects,“ not inside it. Option D is incorrect. The first part creates the “projects“ directory, but the second part tries to create both “completed“ and “ongoing“ inside “projects“ without ensuring both are created.
Incorrect
Correct Answer: B. mkdir -p projects/completed projects/ongoing Explanation: The mkdir command is used to create directories. The -p option allows the creation of parent directories as needed. In this case, using -p ensures that the “projects“ directory is created first, and then the “completed“ and “ongoing“ subdirectories are created inside it. Option A is incorrect. This command would try to create a directory named “ongoing“ in the current directory and another directory named “completed“ inside a “projects“ directory, but it wouldn‘t create the “projects“ directory if it didn‘t exist. Option C is incorrect. This command would create the “projects“ directory, but then it would create “completed“ and “ongoing“ directories at the same level as “projects,“ not inside it. Option D is incorrect. The first part creates the “projects“ directory, but the second part tries to create both “completed“ and “ongoing“ inside “projects“ without ensuring both are created.
Unattempted
Correct Answer: B. mkdir -p projects/completed projects/ongoing Explanation: The mkdir command is used to create directories. The -p option allows the creation of parent directories as needed. In this case, using -p ensures that the “projects“ directory is created first, and then the “completed“ and “ongoing“ subdirectories are created inside it. Option A is incorrect. This command would try to create a directory named “ongoing“ in the current directory and another directory named “completed“ inside a “projects“ directory, but it wouldn‘t create the “projects“ directory if it didn‘t exist. Option C is incorrect. This command would create the “projects“ directory, but then it would create “completed“ and “ongoing“ directories at the same level as “projects,“ not inside it. Option D is incorrect. The first part creates the “projects“ directory, but the second part tries to create both “completed“ and “ongoing“ inside “projects“ without ensuring both are created.
Question 16 of 60
16. Question
Alex, a system administrator, needs to find out which package provides a specific file called samplefile.conf on his Debian-based system. Which command should he use to achieve this?
Correct
Correct Answer: C. apt-file find samplefile.conf Explanation: The apt-file tool is used to search for files within packages, even if they aren‘t installed. When looking for a file inside a package, the apt-file find command is appropriate. Option A is incorrect. apt-get does not have a “file search“ option. The correct utility for this purpose is apt-file. Option B is incorrect. dpkg-query -S can be used to search for a file within installed packages, but Alex wants to search even in packages that are not installed. Option D is incorrect. Using dpkg -l will list installed packages, and piping that to grep will search for the package name, not the files contained within the package.
Incorrect
Correct Answer: C. apt-file find samplefile.conf Explanation: The apt-file tool is used to search for files within packages, even if they aren‘t installed. When looking for a file inside a package, the apt-file find command is appropriate. Option A is incorrect. apt-get does not have a “file search“ option. The correct utility for this purpose is apt-file. Option B is incorrect. dpkg-query -S can be used to search for a file within installed packages, but Alex wants to search even in packages that are not installed. Option D is incorrect. Using dpkg -l will list installed packages, and piping that to grep will search for the package name, not the files contained within the package.
Unattempted
Correct Answer: C. apt-file find samplefile.conf Explanation: The apt-file tool is used to search for files within packages, even if they aren‘t installed. When looking for a file inside a package, the apt-file find command is appropriate. Option A is incorrect. apt-get does not have a “file search“ option. The correct utility for this purpose is apt-file. Option B is incorrect. dpkg-query -S can be used to search for a file within installed packages, but Alex wants to search even in packages that are not installed. Option D is incorrect. Using dpkg -l will list installed packages, and piping that to grep will search for the package name, not the files contained within the package.
Question 17 of 60
17. Question
Jacob is a new systems administrator and he is exploring the structure of systemd on a Linux system. He wants to locate the standard unit files provided by installed packages. Where would Jacob typically find these unit files?
Correct
Correct Answer: C. /usr/lib/systemd/system/ Explanation: The directory /usr/lib/systemd/system/ is where the standard unit files that come with installed packages are typically stored. These unit files define how the service or unit will behave, and the directory serves as a base which can be overridden or customized by user-specific configurations. Option A is incorrect. While /etc/systemd/ contains systemd configuration and custom unit files, the default unit files from installed packages are not stored here. Option B is incorrect. /usr/lib/systemd/user/ holds user-specific systemd units, not the default units that come with installed packages. Option D is incorrect. /usr/local/systemd/ is not a standard directory for storing systemd unit files.
Incorrect
Correct Answer: C. /usr/lib/systemd/system/ Explanation: The directory /usr/lib/systemd/system/ is where the standard unit files that come with installed packages are typically stored. These unit files define how the service or unit will behave, and the directory serves as a base which can be overridden or customized by user-specific configurations. Option A is incorrect. While /etc/systemd/ contains systemd configuration and custom unit files, the default unit files from installed packages are not stored here. Option B is incorrect. /usr/lib/systemd/user/ holds user-specific systemd units, not the default units that come with installed packages. Option D is incorrect. /usr/local/systemd/ is not a standard directory for storing systemd unit files.
Unattempted
Correct Answer: C. /usr/lib/systemd/system/ Explanation: The directory /usr/lib/systemd/system/ is where the standard unit files that come with installed packages are typically stored. These unit files define how the service or unit will behave, and the directory serves as a base which can be overridden or customized by user-specific configurations. Option A is incorrect. While /etc/systemd/ contains systemd configuration and custom unit files, the default unit files from installed packages are not stored here. Option B is incorrect. /usr/lib/systemd/user/ holds user-specific systemd units, not the default units that come with installed packages. Option D is incorrect. /usr/local/systemd/ is not a standard directory for storing systemd unit files.
Question 18 of 60
18. Question
Laura is a system administrator and she wants to search for all available packages related to firewall in her Debian system. Which command should she use to accomplish this?
Correct
Correct Answer: B. apt-cache search firewall Explanation: The apt-cache search command allows you to search the package cache for a specific keyword. In this case, it would display all packages related to the term “firewall“. Option A is incorrect. apt-cache policy displays the priority of installed and available versions of a specific package, not for searching with keywords. Option C is incorrect. apt-cache show provides a detailed description of the package but isn‘t used for keyword searches. Option D is incorrect. apt-cache depends shows the dependencies of a package.
Incorrect
Correct Answer: B. apt-cache search firewall Explanation: The apt-cache search command allows you to search the package cache for a specific keyword. In this case, it would display all packages related to the term “firewall“. Option A is incorrect. apt-cache policy displays the priority of installed and available versions of a specific package, not for searching with keywords. Option C is incorrect. apt-cache show provides a detailed description of the package but isn‘t used for keyword searches. Option D is incorrect. apt-cache depends shows the dependencies of a package.
Unattempted
Correct Answer: B. apt-cache search firewall Explanation: The apt-cache search command allows you to search the package cache for a specific keyword. In this case, it would display all packages related to the term “firewall“. Option A is incorrect. apt-cache policy displays the priority of installed and available versions of a specific package, not for searching with keywords. Option C is incorrect. apt-cache show provides a detailed description of the package but isn‘t used for keyword searches. Option D is incorrect. apt-cache depends shows the dependencies of a package.
Question 19 of 60
19. Question
Anna, a systems administrator, has just configured a new service on a Linux server using systemd. She needs to ensure the service starts automatically at boot time. Which systemctl command should she use?
Correct
Correct Answer: C. systemctl enable service-name.service Explanation: To ensure that a service starts automatically at boot time, the systemctl enable command is used. This command creates the necessary symbolic links to start the service during the boot process. Option A is incorrect. There‘s no systemctl boot command. Option B is incorrect. systemctl run isn‘t a valid command in systemd. Option D is incorrect. systemctl initiate isn‘t a valid systemctl command.
Incorrect
Correct Answer: C. systemctl enable service-name.service Explanation: To ensure that a service starts automatically at boot time, the systemctl enable command is used. This command creates the necessary symbolic links to start the service during the boot process. Option A is incorrect. There‘s no systemctl boot command. Option B is incorrect. systemctl run isn‘t a valid command in systemd. Option D is incorrect. systemctl initiate isn‘t a valid systemctl command.
Unattempted
Correct Answer: C. systemctl enable service-name.service Explanation: To ensure that a service starts automatically at boot time, the systemctl enable command is used. This command creates the necessary symbolic links to start the service during the boot process. Option A is incorrect. There‘s no systemctl boot command. Option B is incorrect. systemctl run isn‘t a valid command in systemd. Option D is incorrect. systemctl initiate isn‘t a valid systemctl command.
Question 20 of 60
20. Question
Lisa is currently inside a directory named projects. She wants to view a long listing of files and directories, including hidden ones, within her current directory. Which command should she use?
Correct
Correct Answer: C. ls -al or ls -la Explanation: The ls command in UNIX or Linux is used to list files and directories. The -l option displays the items in a long listing format, while the -a option displays all items, including hidden ones (those starting with a dot). Combining the two options (as in -al or -la) will display all items in a long listing format. Option A is incorrect. The ′-l′ option alone will only display items in a long listing format, but it won‘t show hidden files or directories. Option B is incorrect. The ′-a′ option alone will display all items, including hidden ones, but it won‘t display them in a long listing format. Option D is incorrect. The ′-h′ option is used to display sizes in human-readable format (like K, M, G), but it won‘t show hidden files or display items in a long listing format.
Incorrect
Correct Answer: C. ls -al or ls -la Explanation: The ls command in UNIX or Linux is used to list files and directories. The -l option displays the items in a long listing format, while the -a option displays all items, including hidden ones (those starting with a dot). Combining the two options (as in -al or -la) will display all items in a long listing format. Option A is incorrect. The ′-l′ option alone will only display items in a long listing format, but it won‘t show hidden files or directories. Option B is incorrect. The ′-a′ option alone will display all items, including hidden ones, but it won‘t display them in a long listing format. Option D is incorrect. The ′-h′ option is used to display sizes in human-readable format (like K, M, G), but it won‘t show hidden files or display items in a long listing format.
Unattempted
Correct Answer: C. ls -al or ls -la Explanation: The ls command in UNIX or Linux is used to list files and directories. The -l option displays the items in a long listing format, while the -a option displays all items, including hidden ones (those starting with a dot). Combining the two options (as in -al or -la) will display all items in a long listing format. Option A is incorrect. The ′-l′ option alone will only display items in a long listing format, but it won‘t show hidden files or directories. Option B is incorrect. The ′-a′ option alone will display all items, including hidden ones, but it won‘t display them in a long listing format. Option D is incorrect. The ′-h′ option is used to display sizes in human-readable format (like K, M, G), but it won‘t show hidden files or display items in a long listing format.
Question 21 of 60
21. Question
You need to override some settings of a default system unit file without altering the original file. Where, under /etc/systemd/, would you place the drop-in files to achieve this?
Correct
Correct Answer: B. /etc/systemd/system/[unit-name].d/ Explanation: Drop-in files are used to override or add configurations to existing unit files without modifying the original files. For any unit, drop-in files should be placed in a directory named [unit-name].d/ under /etc/systemd/system/. Option A is incorrect. There isn‘t a standard directory named /etc/systemd/override.d/ for drop-in files. The correct location is based on the unit‘s name under /etc/systemd/system/. Option C is incorrect. There is no standard directory named /etc/systemd/systemd-drop-ins/. Option D is incorrect. There isn‘t a directory structure /etc/systemd/system-drop-ins/[unit-name]/ for drop-ins. The correct structure is /etc/systemd/system/[unit-name].d/.
Incorrect
Correct Answer: B. /etc/systemd/system/[unit-name].d/ Explanation: Drop-in files are used to override or add configurations to existing unit files without modifying the original files. For any unit, drop-in files should be placed in a directory named [unit-name].d/ under /etc/systemd/system/. Option A is incorrect. There isn‘t a standard directory named /etc/systemd/override.d/ for drop-in files. The correct location is based on the unit‘s name under /etc/systemd/system/. Option C is incorrect. There is no standard directory named /etc/systemd/systemd-drop-ins/. Option D is incorrect. There isn‘t a directory structure /etc/systemd/system-drop-ins/[unit-name]/ for drop-ins. The correct structure is /etc/systemd/system/[unit-name].d/.
Unattempted
Correct Answer: B. /etc/systemd/system/[unit-name].d/ Explanation: Drop-in files are used to override or add configurations to existing unit files without modifying the original files. For any unit, drop-in files should be placed in a directory named [unit-name].d/ under /etc/systemd/system/. Option A is incorrect. There isn‘t a standard directory named /etc/systemd/override.d/ for drop-in files. The correct location is based on the unit‘s name under /etc/systemd/system/. Option C is incorrect. There is no standard directory named /etc/systemd/systemd-drop-ins/. Option D is incorrect. There isn‘t a directory structure /etc/systemd/system-drop-ins/[unit-name]/ for drop-ins. The correct structure is /etc/systemd/system/[unit-name].d/.
Question 22 of 60
22. Question
John, a system administrator, is currently inside a directory that contains a file named report.txt. The file is owned by user paul and belongs to the group finance. John wants to change the ownership of the file to user mary while retaining the group ownership as finance. Which of the following commands should he use?
Correct
Correct Answer: B. chown mary: report.txt Explanation: The chown command with the syntax username: changes the owner of the file to the specified username while retaining the current group ownership of the file. Option A is incorrect. Using just the username without the colon (:) will change the ownership but may potentially alter the group depending on the environment settings. Option C is incorrect. The leading colon without a preceding username would attempt to change the group ownership, not the user ownership. Option D is incorrect. While this will achieve the desired outcome in this scenario, it is unnecessary to specify the group if it‘s remaining the same.
Incorrect
Correct Answer: B. chown mary: report.txt Explanation: The chown command with the syntax username: changes the owner of the file to the specified username while retaining the current group ownership of the file. Option A is incorrect. Using just the username without the colon (:) will change the ownership but may potentially alter the group depending on the environment settings. Option C is incorrect. The leading colon without a preceding username would attempt to change the group ownership, not the user ownership. Option D is incorrect. While this will achieve the desired outcome in this scenario, it is unnecessary to specify the group if it‘s remaining the same.
Unattempted
Correct Answer: B. chown mary: report.txt Explanation: The chown command with the syntax username: changes the owner of the file to the specified username while retaining the current group ownership of the file. Option A is incorrect. Using just the username without the colon (:) will change the ownership but may potentially alter the group depending on the environment settings. Option C is incorrect. The leading colon without a preceding username would attempt to change the group ownership, not the user ownership. Option D is incorrect. While this will achieve the desired outcome in this scenario, it is unnecessary to specify the group if it‘s remaining the same.
Question 23 of 60
23. Question
Jeremy has a directory named reports that contains monthly report files. He realizes that he mistakenly named one of the files as Jun2022.txt instead of June2022.txt. Which command should he use to rename the file while keeping it in the same location?
Correct
Correct Answer: A. mv reports/Jun2022.txt reports/June2022.txt Explanation: The mv command in UNIX or Linux is used to move or rename files and directories. In the provided scenario, option A correctly uses the mv command to rename the file from Jun2022.txt to June2022.txt within the reports directory. Option B is incorrect. This command assumes that Jeremy is currently inside the ′reports′ directory, which is not specified in the scenario. Option C is incorrect. The ′cp′ command is used to copy files or directories, so this would create a copy with the new name but wouldn‘t rename the original file. Option D is incorrect. The ′rename′ command can be used for renaming files, but the syntax provided is incorrect for renaming a single file.
Incorrect
Correct Answer: A. mv reports/Jun2022.txt reports/June2022.txt Explanation: The mv command in UNIX or Linux is used to move or rename files and directories. In the provided scenario, option A correctly uses the mv command to rename the file from Jun2022.txt to June2022.txt within the reports directory. Option B is incorrect. This command assumes that Jeremy is currently inside the ′reports′ directory, which is not specified in the scenario. Option C is incorrect. The ′cp′ command is used to copy files or directories, so this would create a copy with the new name but wouldn‘t rename the original file. Option D is incorrect. The ′rename′ command can be used for renaming files, but the syntax provided is incorrect for renaming a single file.
Unattempted
Correct Answer: A. mv reports/Jun2022.txt reports/June2022.txt Explanation: The mv command in UNIX or Linux is used to move or rename files and directories. In the provided scenario, option A correctly uses the mv command to rename the file from Jun2022.txt to June2022.txt within the reports directory. Option B is incorrect. This command assumes that Jeremy is currently inside the ′reports′ directory, which is not specified in the scenario. Option C is incorrect. The ′cp′ command is used to copy files or directories, so this would create a copy with the new name but wouldn‘t rename the original file. Option D is incorrect. The ′rename′ command can be used for renaming files, but the syntax provided is incorrect for renaming a single file.
Question 24 of 60
24. Question
John noticed that there is an empty directory named tempFiles in his home directory. He wants to remove this directory. Which command should he use to achieve this?
Correct
Correct Answer: C. rmdir tempFiles Explanation: The rmdir command is specifically used to remove empty directories. If the directory is not empty, the command will not remove it and will return an error message. Option A is incorrect. The ′rm′ command without any options would attempt to remove files, not directories. Option B is incorrect. While ′rm -r tempFiles′ would remove the ′tempFiles′ directory even if it has contents, it‘s overkill for an empty directory. Option D is incorrect. ′rm -rf tempFiles′ would forcefully remove the directory and its contents, which is unnecessary for an empty directory and might be risky.
Incorrect
Correct Answer: C. rmdir tempFiles Explanation: The rmdir command is specifically used to remove empty directories. If the directory is not empty, the command will not remove it and will return an error message. Option A is incorrect. The ′rm′ command without any options would attempt to remove files, not directories. Option B is incorrect. While ′rm -r tempFiles′ would remove the ′tempFiles′ directory even if it has contents, it‘s overkill for an empty directory. Option D is incorrect. ′rm -rf tempFiles′ would forcefully remove the directory and its contents, which is unnecessary for an empty directory and might be risky.
Unattempted
Correct Answer: C. rmdir tempFiles Explanation: The rmdir command is specifically used to remove empty directories. If the directory is not empty, the command will not remove it and will return an error message. Option A is incorrect. The ′rm′ command without any options would attempt to remove files, not directories. Option B is incorrect. While ′rm -r tempFiles′ would remove the ′tempFiles′ directory even if it has contents, it‘s overkill for an empty directory. Option D is incorrect. ′rm -rf tempFiles′ would forcefully remove the directory and its contents, which is unnecessary for an empty directory and might be risky.
Question 25 of 60
25. Question
As a system administrator, youve noticed that the vendor-provided unit file for a service has settings you want to change. After modifying the default file directly in /usr/lib/systemd/system/, what potential problem could arise?
Correct
Correct Answer: C. The changes could be overwritten during a system update Explanation: Modifying vendor-provided unit files directly is discouraged. When the package that provides that unit file is updated, the file could be replaced, thus overwriting any custom changes made. Instead, customizations should be made using drop-in files or by copying the unit file to /etc/systemd/system/ and making modifications there. Option A is incorrect. Modifying the unit file directly doesn‘t disable the unit permanently. However, bad configurations can prevent it from starting correctly. Option B is incorrect. Directly modifying a unit file in /usr/lib/systemd/system/ won‘t disrupt user sessions unless the unit in question directly relates to user sessions and it‘s restarted or reloaded with the faulty configurations. Option D is incorrect. While a faulty configuration can cause a service to fail, simply modifying the default unit file doesn‘t make the service enter a failed state immediately. It would need to be restarted or reloaded with the faulty configuration to potentially cause a failure.
Incorrect
Correct Answer: C. The changes could be overwritten during a system update Explanation: Modifying vendor-provided unit files directly is discouraged. When the package that provides that unit file is updated, the file could be replaced, thus overwriting any custom changes made. Instead, customizations should be made using drop-in files or by copying the unit file to /etc/systemd/system/ and making modifications there. Option A is incorrect. Modifying the unit file directly doesn‘t disable the unit permanently. However, bad configurations can prevent it from starting correctly. Option B is incorrect. Directly modifying a unit file in /usr/lib/systemd/system/ won‘t disrupt user sessions unless the unit in question directly relates to user sessions and it‘s restarted or reloaded with the faulty configurations. Option D is incorrect. While a faulty configuration can cause a service to fail, simply modifying the default unit file doesn‘t make the service enter a failed state immediately. It would need to be restarted or reloaded with the faulty configuration to potentially cause a failure.
Unattempted
Correct Answer: C. The changes could be overwritten during a system update Explanation: Modifying vendor-provided unit files directly is discouraged. When the package that provides that unit file is updated, the file could be replaced, thus overwriting any custom changes made. Instead, customizations should be made using drop-in files or by copying the unit file to /etc/systemd/system/ and making modifications there. Option A is incorrect. Modifying the unit file directly doesn‘t disable the unit permanently. However, bad configurations can prevent it from starting correctly. Option B is incorrect. Directly modifying a unit file in /usr/lib/systemd/system/ won‘t disrupt user sessions unless the unit in question directly relates to user sessions and it‘s restarted or reloaded with the faulty configurations. Option D is incorrect. While a faulty configuration can cause a service to fail, simply modifying the default unit file doesn‘t make the service enter a failed state immediately. It would need to be restarted or reloaded with the faulty configuration to potentially cause a failure.
Question 26 of 60
26. Question
Amanda wants to create a compressed archive of her projects directory using tar and save it as backup.tar.gz. Which command should she use to achieve this?
Correct
Correct Answer: A. tar -czvf projects backup.tar.gz Explanation: The -c option tells tar to create a new archive, -z compresses the archive using gzip, -v displays the progress in the terminal (verbose), and -f allows you to specify the name of the archive. Option B is incorrect. The ′-x′ option tells ′tar′ to extract, not create an archive. Also, the order of options and arguments is incorrect. Option C is incorrect. The command does not utilize the necessary ′-z′ option for compression and incorrectly uses the redirection. Option D is incorrect. The order of the arguments is wrong, and it‘s missing the ′-z′ option for compression.
Incorrect
Correct Answer: A. tar -czvf projects backup.tar.gz Explanation: The -c option tells tar to create a new archive, -z compresses the archive using gzip, -v displays the progress in the terminal (verbose), and -f allows you to specify the name of the archive. Option B is incorrect. The ′-x′ option tells ′tar′ to extract, not create an archive. Also, the order of options and arguments is incorrect. Option C is incorrect. The command does not utilize the necessary ′-z′ option for compression and incorrectly uses the redirection. Option D is incorrect. The order of the arguments is wrong, and it‘s missing the ′-z′ option for compression.
Unattempted
Correct Answer: A. tar -czvf projects backup.tar.gz Explanation: The -c option tells tar to create a new archive, -z compresses the archive using gzip, -v displays the progress in the terminal (verbose), and -f allows you to specify the name of the archive. Option B is incorrect. The ′-x′ option tells ′tar′ to extract, not create an archive. Also, the order of options and arguments is incorrect. Option C is incorrect. The command does not utilize the necessary ′-z′ option for compression and incorrectly uses the redirection. Option D is incorrect. The order of the arguments is wrong, and it‘s missing the ′-z′ option for compression.
Question 27 of 60
27. Question
You have been assigned to start a service named exampleService on a server running an older version of Linux. Which command would you use from the /etc/init.d/ directory to start this service?
Correct
Correct Answer: A. ./exampleService start Explanation: The /etc/init.d/ directory contains scripts for starting and stopping services in traditional SysVinit systems. To control a service, you invoke its script with a command such as ‘start‘, ‘stop‘, ‘restart‘, etc. Therefore, to start exampleService, you would use ./exampleService start. Option B is incorrect. The syntax start exampleService is used in Upstart, not in traditional SysVinit scripts. Option C is incorrect. There‘s no standard run command in the /etc/init.d/ scripts to control services. Option D is incorrect. The boot command is not used in the /etc/init.d/ scripts to control services.
Incorrect
Correct Answer: A. ./exampleService start Explanation: The /etc/init.d/ directory contains scripts for starting and stopping services in traditional SysVinit systems. To control a service, you invoke its script with a command such as ‘start‘, ‘stop‘, ‘restart‘, etc. Therefore, to start exampleService, you would use ./exampleService start. Option B is incorrect. The syntax start exampleService is used in Upstart, not in traditional SysVinit scripts. Option C is incorrect. There‘s no standard run command in the /etc/init.d/ scripts to control services. Option D is incorrect. The boot command is not used in the /etc/init.d/ scripts to control services.
Unattempted
Correct Answer: A. ./exampleService start Explanation: The /etc/init.d/ directory contains scripts for starting and stopping services in traditional SysVinit systems. To control a service, you invoke its script with a command such as ‘start‘, ‘stop‘, ‘restart‘, etc. Therefore, to start exampleService, you would use ./exampleService start. Option B is incorrect. The syntax start exampleService is used in Upstart, not in traditional SysVinit scripts. Option C is incorrect. There‘s no standard run command in the /etc/init.d/ scripts to control services. Option D is incorrect. The boot command is not used in the /etc/init.d/ scripts to control services.
Question 28 of 60
28. Question
In a systemd-based Linux distribution, where are the vendor-provided (or default) unit files primarily stored?
Correct
Correct Answer: B. /usr/lib/systemd/system/ Explanation: The /usr/lib/systemd/system/ directory contains the vendor-provided (or default) unit files. These files are shipped with the distribution and define how services, sockets, devices, and other units function and operate on the system by default. Option A is incorrect. There is no standard directory named /usr/lib/systemd/default/ for systemd unit files. Option C is incorrect. There is no standard directory named /usr/lib/systemd/units/ for systemd unit files. Option D is incorrect. There is no standard directory named /usr/lib/systemd/vendor/ for systemd unit files.
Incorrect
Correct Answer: B. /usr/lib/systemd/system/ Explanation: The /usr/lib/systemd/system/ directory contains the vendor-provided (or default) unit files. These files are shipped with the distribution and define how services, sockets, devices, and other units function and operate on the system by default. Option A is incorrect. There is no standard directory named /usr/lib/systemd/default/ for systemd unit files. Option C is incorrect. There is no standard directory named /usr/lib/systemd/units/ for systemd unit files. Option D is incorrect. There is no standard directory named /usr/lib/systemd/vendor/ for systemd unit files.
Unattempted
Correct Answer: B. /usr/lib/systemd/system/ Explanation: The /usr/lib/systemd/system/ directory contains the vendor-provided (or default) unit files. These files are shipped with the distribution and define how services, sockets, devices, and other units function and operate on the system by default. Option A is incorrect. There is no standard directory named /usr/lib/systemd/default/ for systemd unit files. Option C is incorrect. There is no standard directory named /usr/lib/systemd/units/ for systemd unit files. Option D is incorrect. There is no standard directory named /usr/lib/systemd/vendor/ for systemd unit files.
Question 29 of 60
29. Question
After making changes to a service script named exampleService in the /etc/init.d/ directory, you want to ensure the changes take effect without rebooting the server. What should you do after modifying the service script?
Correct
Correct Answer: B. Restart the service using ./exampleService restart Explanation: After making changes to a service script in the /etc/init.d/ directory, the service needs to be restarted to ensure that the changes take effect. This can be achieved with the restart command specific to the service script. Option A is incorrect. Merely saving the script does not automatically apply the changes. The service needs to be restarted. Option C is incorrect. The update-rc.d command is used to install or remove scripts, not to apply changes to a currently installed script. Option D is incorrect. Rebooting the server is an excessive measure and is not necessary if you just want the changes in a service script to take effect.
Incorrect
Correct Answer: B. Restart the service using ./exampleService restart Explanation: After making changes to a service script in the /etc/init.d/ directory, the service needs to be restarted to ensure that the changes take effect. This can be achieved with the restart command specific to the service script. Option A is incorrect. Merely saving the script does not automatically apply the changes. The service needs to be restarted. Option C is incorrect. The update-rc.d command is used to install or remove scripts, not to apply changes to a currently installed script. Option D is incorrect. Rebooting the server is an excessive measure and is not necessary if you just want the changes in a service script to take effect.
Unattempted
Correct Answer: B. Restart the service using ./exampleService restart Explanation: After making changes to a service script in the /etc/init.d/ directory, the service needs to be restarted to ensure that the changes take effect. This can be achieved with the restart command specific to the service script. Option A is incorrect. Merely saving the script does not automatically apply the changes. The service needs to be restarted. Option C is incorrect. The update-rc.d command is used to install or remove scripts, not to apply changes to a currently installed script. Option D is incorrect. Rebooting the server is an excessive measure and is not necessary if you just want the changes in a service script to take effect.
Question 30 of 60
30. Question
Jane, a system administrator, sets the default umask value to 027 in a system. When she creates a new file, what would be its default permissions?
Correct
Correct Answer: B. -rw-r—– Explanation: The umask value is subtracted from the default permissions. For files, the default permissions are 666 (read and write for owner, group, and others). With a umask of 027, the permissions are 666 – 027 = 640, which translates to -rw-r—–. Option A is incorrect. This represents the permission set of ′644′, not what you get from subtracting the ′umask′ of ′027′. Option C is incorrect. This represents the permission set of ′664′, which would be from a ′umask′ of ′002′, not ′027′. Option D is incorrect. This represents a read-only file for the owner and group which is not the result of the ′umask′ ′027′.
Incorrect
Correct Answer: B. -rw-r—– Explanation: The umask value is subtracted from the default permissions. For files, the default permissions are 666 (read and write for owner, group, and others). With a umask of 027, the permissions are 666 – 027 = 640, which translates to -rw-r—–. Option A is incorrect. This represents the permission set of ′644′, not what you get from subtracting the ′umask′ of ′027′. Option C is incorrect. This represents the permission set of ′664′, which would be from a ′umask′ of ′002′, not ′027′. Option D is incorrect. This represents a read-only file for the owner and group which is not the result of the ′umask′ ′027′.
Unattempted
Correct Answer: B. -rw-r—– Explanation: The umask value is subtracted from the default permissions. For files, the default permissions are 666 (read and write for owner, group, and others). With a umask of 027, the permissions are 666 – 027 = 640, which translates to -rw-r—–. Option A is incorrect. This represents the permission set of ′644′, not what you get from subtracting the ′umask′ of ′027′. Option C is incorrect. This represents the permission set of ′664′, which would be from a ′umask′ of ′002′, not ′027′. Option D is incorrect. This represents a read-only file for the owner and group which is not the result of the ′umask′ ′027′.
Question 31 of 60
31. Question
Your colleague left a note stating that the system needs to be switched to single-user mode using the init process for maintenance purposes. Which of the following commands will achieve this?
Correct
Correct Answer: B. init 1 Explanation: The init 1 command changes the system to single-user mode. Single-user mode is typically used for maintenance and troubleshooting, as it only allows the root user to access the system, and all other services and users are shut down. Option A is incorrect. init 6 is used to reboot the system, not to bring it to single-user mode. Option C is incorrect. init 0 is used to halt or power down the system, not to switch to single-user mode. Option D is incorrect. init 3 usually switches the system to multi-user mode with networking, but without a graphical user interface.
Incorrect
Correct Answer: B. init 1 Explanation: The init 1 command changes the system to single-user mode. Single-user mode is typically used for maintenance and troubleshooting, as it only allows the root user to access the system, and all other services and users are shut down. Option A is incorrect. init 6 is used to reboot the system, not to bring it to single-user mode. Option C is incorrect. init 0 is used to halt or power down the system, not to switch to single-user mode. Option D is incorrect. init 3 usually switches the system to multi-user mode with networking, but without a graphical user interface.
Unattempted
Correct Answer: B. init 1 Explanation: The init 1 command changes the system to single-user mode. Single-user mode is typically used for maintenance and troubleshooting, as it only allows the root user to access the system, and all other services and users are shut down. Option A is incorrect. init 6 is used to reboot the system, not to bring it to single-user mode. Option C is incorrect. init 0 is used to halt or power down the system, not to switch to single-user mode. Option D is incorrect. init 3 usually switches the system to multi-user mode with networking, but without a graphical user interface.
Question 32 of 60
32. Question
A Linux server administrator wants to ensure that the SSH service does not start automatically on system boot. Which of the following commands should be used?
Correct
Correct Answer: D. systemctl disable ssh Explanation: The correct command to disable a service from starting automatically on system boot using systemctl is “systemctl disable [service]“. In this case, the service is SSH, so the correct command would be “systemctl disable ssh“. This command removes the symbolic links and configuration files that enable automatic startup of the SSH service during system boot. Option A is incorrect: “systemctl enable ssh“ would enable the SSH service to start automatically on system boot, which is the opposite of the desired action. It does not meet the requirement of disabling automatic startup. Option B is incorrect: “systemctl start ssh“ would start the SSH service but does not disable it from starting automatically on system boot. It does not meet the requirement of disabling automatic startup. Option C is incorrect: “systemctl reload ssh“ is used to reload the configuration of the SSH service but does not disable it from starting automatically on system boot. It does not meet the requirement of disabling automatic startup.
Incorrect
Correct Answer: D. systemctl disable ssh Explanation: The correct command to disable a service from starting automatically on system boot using systemctl is “systemctl disable [service]“. In this case, the service is SSH, so the correct command would be “systemctl disable ssh“. This command removes the symbolic links and configuration files that enable automatic startup of the SSH service during system boot. Option A is incorrect: “systemctl enable ssh“ would enable the SSH service to start automatically on system boot, which is the opposite of the desired action. It does not meet the requirement of disabling automatic startup. Option B is incorrect: “systemctl start ssh“ would start the SSH service but does not disable it from starting automatically on system boot. It does not meet the requirement of disabling automatic startup. Option C is incorrect: “systemctl reload ssh“ is used to reload the configuration of the SSH service but does not disable it from starting automatically on system boot. It does not meet the requirement of disabling automatic startup.
Unattempted
Correct Answer: D. systemctl disable ssh Explanation: The correct command to disable a service from starting automatically on system boot using systemctl is “systemctl disable [service]“. In this case, the service is SSH, so the correct command would be “systemctl disable ssh“. This command removes the symbolic links and configuration files that enable automatic startup of the SSH service during system boot. Option A is incorrect: “systemctl enable ssh“ would enable the SSH service to start automatically on system boot, which is the opposite of the desired action. It does not meet the requirement of disabling automatic startup. Option B is incorrect: “systemctl start ssh“ would start the SSH service but does not disable it from starting automatically on system boot. It does not meet the requirement of disabling automatic startup. Option C is incorrect: “systemctl reload ssh“ is used to reload the configuration of the SSH service but does not disable it from starting automatically on system boot. It does not meet the requirement of disabling automatic startup.
Question 33 of 60
33. Question
John, a system administrator, wants to ensure that a filesystem is checked for errors during the boot process. In the /etc/fstab file, which field should he adjust to set the order in which the filesystem checks are conducted?
Correct
Correct Answer: D. Pass Explanation: The “pass“ field in the /etc/fstab file determines the order in which fsck checks the filesystems at boot time. A value of “0“ means the filesystem will not be checked, “1“ means it‘s the root filesystem and will be checked first, and “2“ indicates all other filesystems that should be checked. Option A is incorrect. The mount point specifies where the filesystem will be mounted, not the order of filesystem checks. Option B is incorrect. The filesystem type specifies the type of the filesystem, like ext4 or xfs, but not the order of filesystem checks. Option C is incorrect. The dump field indicates if the filesystem should be dumped or not. A value of “0“ means no dump, and “1“ means dump.
Incorrect
Correct Answer: D. Pass Explanation: The “pass“ field in the /etc/fstab file determines the order in which fsck checks the filesystems at boot time. A value of “0“ means the filesystem will not be checked, “1“ means it‘s the root filesystem and will be checked first, and “2“ indicates all other filesystems that should be checked. Option A is incorrect. The mount point specifies where the filesystem will be mounted, not the order of filesystem checks. Option B is incorrect. The filesystem type specifies the type of the filesystem, like ext4 or xfs, but not the order of filesystem checks. Option C is incorrect. The dump field indicates if the filesystem should be dumped or not. A value of “0“ means no dump, and “1“ means dump.
Unattempted
Correct Answer: D. Pass Explanation: The “pass“ field in the /etc/fstab file determines the order in which fsck checks the filesystems at boot time. A value of “0“ means the filesystem will not be checked, “1“ means it‘s the root filesystem and will be checked first, and “2“ indicates all other filesystems that should be checked. Option A is incorrect. The mount point specifies where the filesystem will be mounted, not the order of filesystem checks. Option B is incorrect. The filesystem type specifies the type of the filesystem, like ext4 or xfs, but not the order of filesystem checks. Option C is incorrect. The dump field indicates if the filesystem should be dumped or not. A value of “0“ means no dump, and “1“ means dump.
Question 34 of 60
34. Question
A system administrator is setting up a new Linux server. They need to ensure that certain system libraries are available for applications to run. Which of the following is the typical directory where system libraries reside in a Linux file system?
Correct
Correct Answer: C. /lib Explanation: In the Linux file system hierarchy, the /lib directory typically contains the shared libraries that are required to boot the system and to run the commands in the root file system. Option A is incorrect. /var/lib typically contains dynamic data libraries and files like rpm database files. It does not store the main system libraries. Option B is incorrect. /etc/lib is not a standard directory in the Linux file system for storing system libraries. Option D is incorrect. /bin/libraries is not a standard directory in the Linux file system hierarchy.
Incorrect
Correct Answer: C. /lib Explanation: In the Linux file system hierarchy, the /lib directory typically contains the shared libraries that are required to boot the system and to run the commands in the root file system. Option A is incorrect. /var/lib typically contains dynamic data libraries and files like rpm database files. It does not store the main system libraries. Option B is incorrect. /etc/lib is not a standard directory in the Linux file system for storing system libraries. Option D is incorrect. /bin/libraries is not a standard directory in the Linux file system hierarchy.
Unattempted
Correct Answer: C. /lib Explanation: In the Linux file system hierarchy, the /lib directory typically contains the shared libraries that are required to boot the system and to run the commands in the root file system. Option A is incorrect. /var/lib typically contains dynamic data libraries and files like rpm database files. It does not store the main system libraries. Option B is incorrect. /etc/lib is not a standard directory in the Linux file system for storing system libraries. Option D is incorrect. /bin/libraries is not a standard directory in the Linux file system hierarchy.
Question 35 of 60
35. Question
A system administrator needs to reboot a production server. Before doing so, they want to send an alert to all logged-in users, notifying them about the impending reboot. Which command should the administrator use to notify all users?
Correct
Correct Answer: A. echo “Server will reboot in 10 minutes!“ | wall Explanation: The wall command is used to broadcast a message to all users logged into the system. By piping the echo output to wall, the message will be displayed on the terminal of all currently logged-in users. Option B is incorrect. The reboot command doesn‘t have a -message option. Option C is incorrect. The shutdown command doesn‘t have a -message option. Instead, it uses a message argument after specifying the time. Option D is incorrect. While writing to /dev/pts/* may seem like a way to send a message to all terminal sessions, it‘s not a standard or reliable method to broadcast messages to all users.
Incorrect
Correct Answer: A. echo “Server will reboot in 10 minutes!“ | wall Explanation: The wall command is used to broadcast a message to all users logged into the system. By piping the echo output to wall, the message will be displayed on the terminal of all currently logged-in users. Option B is incorrect. The reboot command doesn‘t have a -message option. Option C is incorrect. The shutdown command doesn‘t have a -message option. Instead, it uses a message argument after specifying the time. Option D is incorrect. While writing to /dev/pts/* may seem like a way to send a message to all terminal sessions, it‘s not a standard or reliable method to broadcast messages to all users.
Unattempted
Correct Answer: A. echo “Server will reboot in 10 minutes!“ | wall Explanation: The wall command is used to broadcast a message to all users logged into the system. By piping the echo output to wall, the message will be displayed on the terminal of all currently logged-in users. Option B is incorrect. The reboot command doesn‘t have a -message option. Option C is incorrect. The shutdown command doesn‘t have a -message option. Instead, it uses a message argument after specifying the time. Option D is incorrect. While writing to /dev/pts/* may seem like a way to send a message to all terminal sessions, it‘s not a standard or reliable method to broadcast messages to all users.
Question 36 of 60
36. Question
Emily wants to list all files in the current directory that have a .txt extension and begin with either report or summary. Which command should she use?
Correct
Correct Answer: C. ls {report,summary}*.txt Explanation: The {} braces allow you to specify a set of strings to match. In this case, it matches either “report“ or “summary“. The asterisk * wildcard then matches any sequence of characters following “report“ or “summary“. Option A is incorrect. The use of space separates the two patterns, meaning it will search for files named “*report.txt“ and then “*summary.txt“, which isn‘t the intended pattern. Option B is incorrect. The use of square brackets ′[]′ specifies a class of characters to match, not sequences of characters or words. Option D is incorrect. This pattern tries to combine square brackets and commas, which is not a valid wildcard specification in this context.
Incorrect
Correct Answer: C. ls {report,summary}*.txt Explanation: The {} braces allow you to specify a set of strings to match. In this case, it matches either “report“ or “summary“. The asterisk * wildcard then matches any sequence of characters following “report“ or “summary“. Option A is incorrect. The use of space separates the two patterns, meaning it will search for files named “*report.txt“ and then “*summary.txt“, which isn‘t the intended pattern. Option B is incorrect. The use of square brackets ′[]′ specifies a class of characters to match, not sequences of characters or words. Option D is incorrect. This pattern tries to combine square brackets and commas, which is not a valid wildcard specification in this context.
Unattempted
Correct Answer: C. ls {report,summary}*.txt Explanation: The {} braces allow you to specify a set of strings to match. In this case, it matches either “report“ or “summary“. The asterisk * wildcard then matches any sequence of characters following “report“ or “summary“. Option A is incorrect. The use of space separates the two patterns, meaning it will search for files named “*report.txt“ and then “*summary.txt“, which isn‘t the intended pattern. Option B is incorrect. The use of square brackets ′[]′ specifies a class of characters to match, not sequences of characters or words. Option D is incorrect. This pattern tries to combine square brackets and commas, which is not a valid wildcard specification in this context.
Question 37 of 60
37. Question
You have a large log file named server.log which is 10GB in size. For ease of analysis, you need to split this file into smaller chunks, each 1GB in size. Which command will help you achieve this?
Correct
Correct Answer: B. split –bytes=1G server.log Explanation: The –bytes option allows you to specify the size of each split file. 1G denotes 1 gigabyte, which will split the file into 1GB chunks. Option A is incorrect. The ′-l′ option is used to specify the number of lines. ′1000′ would only result in files with 1000 lines each. Option C is incorrect. While ′-c′ is related to bytes, it is not the appropriate way to denote gigabytes for the ′split′ command. Option D is incorrect. There is no ′-s′ option for the ′split′ command.
Incorrect
Correct Answer: B. split –bytes=1G server.log Explanation: The –bytes option allows you to specify the size of each split file. 1G denotes 1 gigabyte, which will split the file into 1GB chunks. Option A is incorrect. The ′-l′ option is used to specify the number of lines. ′1000′ would only result in files with 1000 lines each. Option C is incorrect. While ′-c′ is related to bytes, it is not the appropriate way to denote gigabytes for the ′split′ command. Option D is incorrect. There is no ′-s′ option for the ′split′ command.
Unattempted
Correct Answer: B. split –bytes=1G server.log Explanation: The –bytes option allows you to specify the size of each split file. 1G denotes 1 gigabyte, which will split the file into 1GB chunks. Option A is incorrect. The ′-l′ option is used to specify the number of lines. ′1000′ would only result in files with 1000 lines each. Option C is incorrect. While ′-c′ is related to bytes, it is not the appropriate way to denote gigabytes for the ′split′ command. Option D is incorrect. There is no ′-s′ option for the ′split′ command.
Question 38 of 60
38. Question
A new administrator is unfamiliar with systemd and asks how to view the current systems default boot target. Which command would you advise them to use?
Correct
Correct Answer: C. systemctl get-default Explanation: In systemd, the boot targets (equivalent to the older concept of runlevels) can be checked using the systemctl command. To determine the default target the system is configured to boot into, the correct command is systemctl get-default. Option A is incorrect. There‘s no systemctl get-target command in systemd. Option B is incorrect. The command systemctl default-target is not valid. The correct way to retrieve the default boot target is with systemctl get-default. Option D is incorrect. The command systemctl show-target doesn‘t exist. To retrieve the default target, systemctl get-default should be used.
Incorrect
Correct Answer: C. systemctl get-default Explanation: In systemd, the boot targets (equivalent to the older concept of runlevels) can be checked using the systemctl command. To determine the default target the system is configured to boot into, the correct command is systemctl get-default. Option A is incorrect. There‘s no systemctl get-target command in systemd. Option B is incorrect. The command systemctl default-target is not valid. The correct way to retrieve the default boot target is with systemctl get-default. Option D is incorrect. The command systemctl show-target doesn‘t exist. To retrieve the default target, systemctl get-default should be used.
Unattempted
Correct Answer: C. systemctl get-default Explanation: In systemd, the boot targets (equivalent to the older concept of runlevels) can be checked using the systemctl command. To determine the default target the system is configured to boot into, the correct command is systemctl get-default. Option A is incorrect. There‘s no systemctl get-target command in systemd. Option B is incorrect. The command systemctl default-target is not valid. The correct way to retrieve the default boot target is with systemctl get-default. Option D is incorrect. The command systemctl show-target doesn‘t exist. To retrieve the default target, systemctl get-default should be used.
Question 39 of 60
39. Question
Carlos, a system administrator, noticed that there is a high I/O activity on an NFS share mounted at /mnt/nfs_share. Before troubleshooting, he needs to ensure no users are accessing the share. What command should Carlos use to safely unmount the share?
Correct
Correct Answer: A. umount -l /mnt/nfs_share Explanation: The command umount -l /mnt/nfs_share performs a lazy unmount, which means it will detach the filesystem from the filesystem hierarchy immediately and cleanup all references to the filesystem once it is not busy anymore. Option B is incorrect. While this will attempt to unmount the share, it will not succeed if the filesystem is busy. Option C is incorrect. The ′-f′ option is forceful and can cause data loss or corruption. It‘s not recommended unless absolutely necessary. Option D is incorrect. There is no ′–users′ option for the ′umount′ command.
Incorrect
Correct Answer: A. umount -l /mnt/nfs_share Explanation: The command umount -l /mnt/nfs_share performs a lazy unmount, which means it will detach the filesystem from the filesystem hierarchy immediately and cleanup all references to the filesystem once it is not busy anymore. Option B is incorrect. While this will attempt to unmount the share, it will not succeed if the filesystem is busy. Option C is incorrect. The ′-f′ option is forceful and can cause data loss or corruption. It‘s not recommended unless absolutely necessary. Option D is incorrect. There is no ′–users′ option for the ′umount′ command.
Unattempted
Correct Answer: A. umount -l /mnt/nfs_share Explanation: The command umount -l /mnt/nfs_share performs a lazy unmount, which means it will detach the filesystem from the filesystem hierarchy immediately and cleanup all references to the filesystem once it is not busy anymore. Option B is incorrect. While this will attempt to unmount the share, it will not succeed if the filesystem is busy. Option C is incorrect. The ′-f′ option is forceful and can cause data loss or corruption. It‘s not recommended unless absolutely necessary. Option D is incorrect. There is no ′–users′ option for the ′umount′ command.
Question 40 of 60
40. Question
Michael is troubleshooting a system that doesnt boot correctly. He suspects that the MBR might be corrupt. Which of the following tools can he use to install GRUB in the MBR?
Correct
Correct Answer: B. grub-install Explanation: The grub-install command is used to install the GRUB bootloader. When targeting a disk (like /dev/sda), it installs GRUB in the MBR of that disk. Option A is incorrect. mkfs.mbr does not exist. Moreover, mkfs commands are used for creating file systems, not for dealing with boot loaders. Option C is incorrect. There isn‘t a tool named mbr-config. Tools related to MBR manipulation include grub-install, fdisk, and others, but not mbr-config. Option D is incorrect. fstab is a file that describes how disk drives and partitions should be mounted into the Linux filesystem. It is not a tool or command for manipulating the MBR.
Incorrect
Correct Answer: B. grub-install Explanation: The grub-install command is used to install the GRUB bootloader. When targeting a disk (like /dev/sda), it installs GRUB in the MBR of that disk. Option A is incorrect. mkfs.mbr does not exist. Moreover, mkfs commands are used for creating file systems, not for dealing with boot loaders. Option C is incorrect. There isn‘t a tool named mbr-config. Tools related to MBR manipulation include grub-install, fdisk, and others, but not mbr-config. Option D is incorrect. fstab is a file that describes how disk drives and partitions should be mounted into the Linux filesystem. It is not a tool or command for manipulating the MBR.
Unattempted
Correct Answer: B. grub-install Explanation: The grub-install command is used to install the GRUB bootloader. When targeting a disk (like /dev/sda), it installs GRUB in the MBR of that disk. Option A is incorrect. mkfs.mbr does not exist. Moreover, mkfs commands are used for creating file systems, not for dealing with boot loaders. Option C is incorrect. There isn‘t a tool named mbr-config. Tools related to MBR manipulation include grub-install, fdisk, and others, but not mbr-config. Option D is incorrect. fstab is a file that describes how disk drives and partitions should be mounted into the Linux filesystem. It is not a tool or command for manipulating the MBR.
Question 41 of 60
41. Question
You have been assigned a task to change the default runlevel of a Linux server to multi-user mode with networking but without a GUI. Which entry would you modify in /etc/inittab to achieve this?
Correct
Correct Answer: C. id:3:initdefault: Explanation: In traditional SysVinit systems, the /etc/inittab file is used to set the default runlevel. The runlevel 3 typically represents multi-user mode with networking but without a graphical user interface (GUI). Option A is incorrect. Runlevel 1 is single-user mode and is used primarily for maintenance or recovery. Option B is incorrect. Runlevel 2 is multi-user mode without networking. Option D is incorrect. Runlevel 5 is multi-user mode with networking and a GUI.
Incorrect
Correct Answer: C. id:3:initdefault: Explanation: In traditional SysVinit systems, the /etc/inittab file is used to set the default runlevel. The runlevel 3 typically represents multi-user mode with networking but without a graphical user interface (GUI). Option A is incorrect. Runlevel 1 is single-user mode and is used primarily for maintenance or recovery. Option B is incorrect. Runlevel 2 is multi-user mode without networking. Option D is incorrect. Runlevel 5 is multi-user mode with networking and a GUI.
Unattempted
Correct Answer: C. id:3:initdefault: Explanation: In traditional SysVinit systems, the /etc/inittab file is used to set the default runlevel. The runlevel 3 typically represents multi-user mode with networking but without a graphical user interface (GUI). Option A is incorrect. Runlevel 1 is single-user mode and is used primarily for maintenance or recovery. Option B is incorrect. Runlevel 2 is multi-user mode without networking. Option D is incorrect. Runlevel 5 is multi-user mode with networking and a GUI.
Question 42 of 60
42. Question
Jenny is setting up her systems /etc/fstab file. To ensure the integrity of her system during boot-up, she wishes to use the UUID of her /dev/sda1 partition instead of its device name. Which command should Jenny use to find the UUID of the /dev/sda1 partition?
Correct
Correct Answer: D. blkid /dev/sda1 Explanation: The blkid /dev/sda1 command displays attribute information (like UUID and filesystem type) for the given partition. This allows Jenny to identify the UUID for /dev/sda1 which she can then use in her /etc/fstab file. Option A is incorrect. This would attempt to retrieve information for the entire disk rather than the specific partition. Option B is incorrect. While ′–output′ is a valid option for ′blkid′, using it in this context would not yield the desired result. Option C is incorrect. Running ′blkid′ without any arguments would list attributes for all the available block devices, which could be more information than Jenny needs.
Incorrect
Correct Answer: D. blkid /dev/sda1 Explanation: The blkid /dev/sda1 command displays attribute information (like UUID and filesystem type) for the given partition. This allows Jenny to identify the UUID for /dev/sda1 which she can then use in her /etc/fstab file. Option A is incorrect. This would attempt to retrieve information for the entire disk rather than the specific partition. Option B is incorrect. While ′–output′ is a valid option for ′blkid′, using it in this context would not yield the desired result. Option C is incorrect. Running ′blkid′ without any arguments would list attributes for all the available block devices, which could be more information than Jenny needs.
Unattempted
Correct Answer: D. blkid /dev/sda1 Explanation: The blkid /dev/sda1 command displays attribute information (like UUID and filesystem type) for the given partition. This allows Jenny to identify the UUID for /dev/sda1 which she can then use in her /etc/fstab file. Option A is incorrect. This would attempt to retrieve information for the entire disk rather than the specific partition. Option B is incorrect. While ′–output′ is a valid option for ′blkid′, using it in this context would not yield the desired result. Option C is incorrect. Running ′blkid′ without any arguments would list attributes for all the available block devices, which could be more information than Jenny needs.
Question 43 of 60
43. Question
Jane is attempting to install a boot loader on a system with a traditional BIOS. She realizes she must place the boot loader in a specific location for the system to recognize and load it upon start-up. Where should the boot loader be placed for successful booting?
Correct
Correct Answer: C. In the MBR (Master Boot Record) Explanation: For systems with a traditional BIOS, the boot loader should be placed in the MBR (Master Boot Record) of the disk. The MBR is the first 512 bytes of the storage device and is read by the BIOS to initiate the booting process. Option A is incorrect. While some configurations might place boot files in a separate boot partition, the boot loader itself, for systems using traditional BIOS, should be in the MBR for the system to start booting. Option B is incorrect. The root directory of the file system is not where the BIOS looks to start the booting process. It looks at the MBR. Option D is incorrect. While the /boot directory contains kernel and boot-related files, the boot loader for systems with a traditional BIOS should be placed in the MBR for the system to start booting.
Incorrect
Correct Answer: C. In the MBR (Master Boot Record) Explanation: For systems with a traditional BIOS, the boot loader should be placed in the MBR (Master Boot Record) of the disk. The MBR is the first 512 bytes of the storage device and is read by the BIOS to initiate the booting process. Option A is incorrect. While some configurations might place boot files in a separate boot partition, the boot loader itself, for systems using traditional BIOS, should be in the MBR for the system to start booting. Option B is incorrect. The root directory of the file system is not where the BIOS looks to start the booting process. It looks at the MBR. Option D is incorrect. While the /boot directory contains kernel and boot-related files, the boot loader for systems with a traditional BIOS should be placed in the MBR for the system to start booting.
Unattempted
Correct Answer: C. In the MBR (Master Boot Record) Explanation: For systems with a traditional BIOS, the boot loader should be placed in the MBR (Master Boot Record) of the disk. The MBR is the first 512 bytes of the storage device and is read by the BIOS to initiate the booting process. Option A is incorrect. While some configurations might place boot files in a separate boot partition, the boot loader itself, for systems using traditional BIOS, should be in the MBR for the system to start booting. Option B is incorrect. The root directory of the file system is not where the BIOS looks to start the booting process. It looks at the MBR. Option D is incorrect. While the /boot directory contains kernel and boot-related files, the boot loader for systems with a traditional BIOS should be placed in the MBR for the system to start booting.
Question 44 of 60
44. Question
A colleague sends you a large log file named server.log. You are asked to determine the total number of lines in this file. Which command should you use to accomplish this?
Correct
Correct Answer: B. wc -l server.log Explanation: The wc command is used for counting lines, words, and bytes/characters in files. The -l option specifically counts the number of lines. Option A is incorrect. The ′-c′ option is used to count bytes, not lines. Option C is incorrect. The ′-w′ option is used to count words, not lines. Option D is incorrect. The ′-m′ option counts characters, which is not what‘s needed here.
Incorrect
Correct Answer: B. wc -l server.log Explanation: The wc command is used for counting lines, words, and bytes/characters in files. The -l option specifically counts the number of lines. Option A is incorrect. The ′-c′ option is used to count bytes, not lines. Option C is incorrect. The ′-w′ option is used to count words, not lines. Option D is incorrect. The ′-m′ option counts characters, which is not what‘s needed here.
Unattempted
Correct Answer: B. wc -l server.log Explanation: The wc command is used for counting lines, words, and bytes/characters in files. The -l option specifically counts the number of lines. Option A is incorrect. The ′-c′ option is used to count bytes, not lines. Option C is incorrect. The ′-w′ option is used to count words, not lines. Option D is incorrect. The ′-m′ option counts characters, which is not what‘s needed here.
Question 45 of 60
45. Question
An administrator has recently made changes to a systems boot options and wishes to generate a new GRUB 2 configuration file to reflect those changes. Which command will help generate this configuration and output it to /boot/grub/grub.cfg?
Correct
Correct Answer: C. grub-mkconfig -o /boot/grub/grub.cfg Explanation: The grub-mkconfig command generates a GRUB 2 configuration file based on the system‘s current setup and scripts in /etc/grub.d/. Using the -o or –output option allows you to specify where the configuration file will be written. The default location for GRUB‘s configuration is /boot/grub/grub.cfg. Option A is incorrect. While grub-mkconfig will generate the configuration, it will output it to standard output (typically the screen) unless redirected elsewhere. Option B is incorrect. Using the redirection > will indeed send the output of grub-mkconfig to the specified file, but this is not the recommended method. Instead, the -o option should be used to ensure appropriate permissions and handling by the command. Option D is incorrect. There is no command named grub-config. The correct command to generate the configuration is grub-mkconfig.
Incorrect
Correct Answer: C. grub-mkconfig -o /boot/grub/grub.cfg Explanation: The grub-mkconfig command generates a GRUB 2 configuration file based on the system‘s current setup and scripts in /etc/grub.d/. Using the -o or –output option allows you to specify where the configuration file will be written. The default location for GRUB‘s configuration is /boot/grub/grub.cfg. Option A is incorrect. While grub-mkconfig will generate the configuration, it will output it to standard output (typically the screen) unless redirected elsewhere. Option B is incorrect. Using the redirection > will indeed send the output of grub-mkconfig to the specified file, but this is not the recommended method. Instead, the -o option should be used to ensure appropriate permissions and handling by the command. Option D is incorrect. There is no command named grub-config. The correct command to generate the configuration is grub-mkconfig.
Unattempted
Correct Answer: C. grub-mkconfig -o /boot/grub/grub.cfg Explanation: The grub-mkconfig command generates a GRUB 2 configuration file based on the system‘s current setup and scripts in /etc/grub.d/. Using the -o or –output option allows you to specify where the configuration file will be written. The default location for GRUB‘s configuration is /boot/grub/grub.cfg. Option A is incorrect. While grub-mkconfig will generate the configuration, it will output it to standard output (typically the screen) unless redirected elsewhere. Option B is incorrect. Using the redirection > will indeed send the output of grub-mkconfig to the specified file, but this is not the recommended method. Instead, the -o option should be used to ensure appropriate permissions and handling by the command. Option D is incorrect. There is no command named grub-config. The correct command to generate the configuration is grub-mkconfig.
Question 46 of 60
46. Question
The system administrator needs to send a custom alert to all users notifying them of an upcoming maintenance window. However, they want the alert to persist on users terminals even after they acknowledge it. Which command achieves this?
Correct
Correct Answer: B. echo “Scheduled maintenance in 1 hour“ | wall Explanation: The wall command sends a message to everybody‘s terminal. By default, wall doesn‘t provide an option to let users “acknowledge“ the message. When piped with echo, it sends the output of the echo command to all logged-in users‘ terminals, and the message will persist until users clear their terminal or it scrolls off due to other output. Option A is incorrect. The wall command does not have a -n option. Option C is incorrect. The write command sends a message to a specific user‘s terminal, not to all users. Option D is incorrect. There isn‘t a –persist option for the wall command. The message will naturally persist on users‘ terminals until they clear it or it scrolls off.
Incorrect
Correct Answer: B. echo “Scheduled maintenance in 1 hour“ | wall Explanation: The wall command sends a message to everybody‘s terminal. By default, wall doesn‘t provide an option to let users “acknowledge“ the message. When piped with echo, it sends the output of the echo command to all logged-in users‘ terminals, and the message will persist until users clear their terminal or it scrolls off due to other output. Option A is incorrect. The wall command does not have a -n option. Option C is incorrect. The write command sends a message to a specific user‘s terminal, not to all users. Option D is incorrect. There isn‘t a –persist option for the wall command. The message will naturally persist on users‘ terminals until they clear it or it scrolls off.
Unattempted
Correct Answer: B. echo “Scheduled maintenance in 1 hour“ | wall Explanation: The wall command sends a message to everybody‘s terminal. By default, wall doesn‘t provide an option to let users “acknowledge“ the message. When piped with echo, it sends the output of the echo command to all logged-in users‘ terminals, and the message will persist until users clear their terminal or it scrolls off due to other output. Option A is incorrect. The wall command does not have a -n option. Option C is incorrect. The write command sends a message to a specific user‘s terminal, not to all users. Option D is incorrect. There isn‘t a –persist option for the wall command. The message will naturally persist on users‘ terminals until they clear it or it scrolls off.
Question 47 of 60
47. Question
While on a conference call, a colleague instructs you to send the telinit command to the server to update the systems runlevel to a multi-user mode without any graphical environment. Which command should you execute?
Correct
Correct Answer: A. telinit 3 Explanation: In many Linux distributions, runlevel 3 is designed for a multi-user mode without a graphical environment. The telinit command can be used to change the system‘s runlevel to achieve this. Option B is incorrect. telinit S or telinit s transitions the system to single-user mode, not a multi-user mode. Option C is incorrect. telinit 7 is not a standard runlevel in typical Linux distributions. The common runlevels are 0-6. Option D is incorrect. telinit Q or telinit q tells the init process to re-examine the /etc/inittab file. It does not change the runlevel.
Incorrect
Correct Answer: A. telinit 3 Explanation: In many Linux distributions, runlevel 3 is designed for a multi-user mode without a graphical environment. The telinit command can be used to change the system‘s runlevel to achieve this. Option B is incorrect. telinit S or telinit s transitions the system to single-user mode, not a multi-user mode. Option C is incorrect. telinit 7 is not a standard runlevel in typical Linux distributions. The common runlevels are 0-6. Option D is incorrect. telinit Q or telinit q tells the init process to re-examine the /etc/inittab file. It does not change the runlevel.
Unattempted
Correct Answer: A. telinit 3 Explanation: In many Linux distributions, runlevel 3 is designed for a multi-user mode without a graphical environment. The telinit command can be used to change the system‘s runlevel to achieve this. Option B is incorrect. telinit S or telinit s transitions the system to single-user mode, not a multi-user mode. Option C is incorrect. telinit 7 is not a standard runlevel in typical Linux distributions. The common runlevels are 0-6. Option D is incorrect. telinit Q or telinit q tells the init process to re-examine the /etc/inittab file. It does not change the runlevel.
Question 48 of 60
48. Question
You are given a file named data.txt that contains a series of phone numbers. However, instead of hyphens, the numbers are separated by underscores (e.g., 123_456_7890). You want to replace all underscores with hyphens in this file. Which of the following commands will achieve this?
Correct
Correct Answer: A. tr ‘_‘ ‘-‘ < data.txt > newdata.txt Explanation: The tr command translates or replaces characters. In this case, it replaces each underscore (_) with a hyphen (-). Option B is incorrect. This command will replace hyphens with underscores, which is the opposite of what‘s needed. Option C is incorrect. The ′-s′ option is used to squeeze or replace repeated occurrences of characters. It doesn‘t serve the purpose here. Option D is incorrect. The ′-d′ option is used to delete characters. This syntax is incorrect and will not serve the desired purpose.
Incorrect
Correct Answer: A. tr ‘_‘ ‘-‘ < data.txt > newdata.txt Explanation: The tr command translates or replaces characters. In this case, it replaces each underscore (_) with a hyphen (-). Option B is incorrect. This command will replace hyphens with underscores, which is the opposite of what‘s needed. Option C is incorrect. The ′-s′ option is used to squeeze or replace repeated occurrences of characters. It doesn‘t serve the purpose here. Option D is incorrect. The ′-d′ option is used to delete characters. This syntax is incorrect and will not serve the desired purpose.
Unattempted
Correct Answer: A. tr ‘_‘ ‘-‘ < data.txt > newdata.txt Explanation: The tr command translates or replaces characters. In this case, it replaces each underscore (_) with a hyphen (-). Option B is incorrect. This command will replace hyphens with underscores, which is the opposite of what‘s needed. Option C is incorrect. The ′-s′ option is used to squeeze or replace repeated occurrences of characters. It doesn‘t serve the purpose here. Option D is incorrect. The ′-d′ option is used to delete characters. This syntax is incorrect and will not serve the desired purpose.
Question 49 of 60
49. Question
Maria is debugging an application issue and suspects that a shared library might be the cause. Which of the following commands can she use to identify the shared libraries an executable is linked against?
Correct
Correct Answer: A. ldd Explanation: The ldd command displays the shared libraries required by each program or shared library specified on the command line. It‘s used to identify the shared libraries an executable is linked against. Option B is incorrect. While ldconfig is used for managing shared libraries, the -l option is used to show libraries and their versions. It does not show what an executable is linked against. Option C is incorrect. There is no standard command named libinfo. Option D is incorrect. grep is a text search utility. The -l option with grep displays only the names of files containing the matched pattern, and it‘s not used for identifying shared libraries for an executable.
Incorrect
Correct Answer: A. ldd Explanation: The ldd command displays the shared libraries required by each program or shared library specified on the command line. It‘s used to identify the shared libraries an executable is linked against. Option B is incorrect. While ldconfig is used for managing shared libraries, the -l option is used to show libraries and their versions. It does not show what an executable is linked against. Option C is incorrect. There is no standard command named libinfo. Option D is incorrect. grep is a text search utility. The -l option with grep displays only the names of files containing the matched pattern, and it‘s not used for identifying shared libraries for an executable.
Unattempted
Correct Answer: A. ldd Explanation: The ldd command displays the shared libraries required by each program or shared library specified on the command line. It‘s used to identify the shared libraries an executable is linked against. Option B is incorrect. While ldconfig is used for managing shared libraries, the -l option is used to show libraries and their versions. It does not show what an executable is linked against. Option C is incorrect. There is no standard command named libinfo. Option D is incorrect. grep is a text search utility. The -l option with grep displays only the names of files containing the matched pattern, and it‘s not used for identifying shared libraries for an executable.
Question 50 of 60
50. Question
You are a system administrator, and a user named David reports that he cant execute a script named runme.sh located in his home directory. You check the permissions of the file and it shows -rw-rr. Which command will correctly give execute permissions to the owner of the file?
Correct
Correct Answer: A. chmod u+x ~/runme.sh Explanation: Option A is correct because the command chmod u+x grants execute permissions (x) to the user/owner (u) of the file. Option B is incorrect. While this command does grant execute permissions, it grants them to the owner, group, and everyone else which might not be desired. Option C is incorrect. Although this command grants execute permissions to the file, it also modifies other existing permissions which might not be the intention. Option D is incorrect. The command will not change the execute permissions on the file; it merely sets the permissions to what they already were.
Incorrect
Correct Answer: A. chmod u+x ~/runme.sh Explanation: Option A is correct because the command chmod u+x grants execute permissions (x) to the user/owner (u) of the file. Option B is incorrect. While this command does grant execute permissions, it grants them to the owner, group, and everyone else which might not be desired. Option C is incorrect. Although this command grants execute permissions to the file, it also modifies other existing permissions which might not be the intention. Option D is incorrect. The command will not change the execute permissions on the file; it merely sets the permissions to what they already were.
Unattempted
Correct Answer: A. chmod u+x ~/runme.sh Explanation: Option A is correct because the command chmod u+x grants execute permissions (x) to the user/owner (u) of the file. Option B is incorrect. While this command does grant execute permissions, it grants them to the owner, group, and everyone else which might not be desired. Option C is incorrect. Although this command grants execute permissions to the file, it also modifies other existing permissions which might not be the intention. Option D is incorrect. The command will not change the execute permissions on the file; it merely sets the permissions to what they already were.
Question 51 of 60
51. Question
Jennifer, a new system administrator, is trying to install a package named web-editor on her Debian system. Shes aware of the apt tool but is unsure about the exact command. Which command should she execute to install the web-editor package using apt?
Correct
Correct Answer: C. apt install web-editor Explanation: The apt install command is the standard way to install a package using the apt tool on a Debian-based system. It will retrieve the package and its dependencies, then install them. Option A is incorrect. While apt-get install is a valid command and can be used to install packages, the more modern and streamlined command is apt install, which offers a more user-friendly interface and combines the best of apt-get and apt-cache. Option B is incorrect. The apt download command is used to download packages without installing them. It will not install the “web-editor“ package. Option D is incorrect. apt-query isn‘t a standard apt command. Furthermore, even if it was, “search“ would imply searching for a package and not installing it.
Incorrect
Correct Answer: C. apt install web-editor Explanation: The apt install command is the standard way to install a package using the apt tool on a Debian-based system. It will retrieve the package and its dependencies, then install them. Option A is incorrect. While apt-get install is a valid command and can be used to install packages, the more modern and streamlined command is apt install, which offers a more user-friendly interface and combines the best of apt-get and apt-cache. Option B is incorrect. The apt download command is used to download packages without installing them. It will not install the “web-editor“ package. Option D is incorrect. apt-query isn‘t a standard apt command. Furthermore, even if it was, “search“ would imply searching for a package and not installing it.
Unattempted
Correct Answer: C. apt install web-editor Explanation: The apt install command is the standard way to install a package using the apt tool on a Debian-based system. It will retrieve the package and its dependencies, then install them. Option A is incorrect. While apt-get install is a valid command and can be used to install packages, the more modern and streamlined command is apt install, which offers a more user-friendly interface and combines the best of apt-get and apt-cache. Option B is incorrect. The apt download command is used to download packages without installing them. It will not install the “web-editor“ package. Option D is incorrect. apt-query isn‘t a standard apt command. Furthermore, even if it was, “search“ would imply searching for a package and not installing it.
Question 52 of 60
52. Question
Sarah, a Linux system administrator, has just installed a package named webtools.rpm. She wants to know all the files and directories that this package has installed on the system. Which command should she use to determine the files provided by the package?
Correct
Correct Answer: B. rpm -ql webtools Explanation: The command rpm -ql followed by the package name (without the .rpm extension) lists all the files and directories that are installed by that package. Option A is incorrect. The yum whatprovides command is used to find out which package provides a particular file or capability. It doesn‘t list all files provided by a specific package. Option C is incorrect. The rpm -qf command is used to determine the package to which a specific file belongs. It doesn‘t list all files of a particular package. Option D is incorrect. The yum list installed command displays all installed packages, but it doesn‘t show the files provided by a specific package.
Incorrect
Correct Answer: B. rpm -ql webtools Explanation: The command rpm -ql followed by the package name (without the .rpm extension) lists all the files and directories that are installed by that package. Option A is incorrect. The yum whatprovides command is used to find out which package provides a particular file or capability. It doesn‘t list all files provided by a specific package. Option C is incorrect. The rpm -qf command is used to determine the package to which a specific file belongs. It doesn‘t list all files of a particular package. Option D is incorrect. The yum list installed command displays all installed packages, but it doesn‘t show the files provided by a specific package.
Unattempted
Correct Answer: B. rpm -ql webtools Explanation: The command rpm -ql followed by the package name (without the .rpm extension) lists all the files and directories that are installed by that package. Option A is incorrect. The yum whatprovides command is used to find out which package provides a particular file or capability. It doesn‘t list all files provided by a specific package. Option C is incorrect. The rpm -qf command is used to determine the package to which a specific file belongs. It doesn‘t list all files of a particular package. Option D is incorrect. The yum list installed command displays all installed packages, but it doesn‘t show the files provided by a specific package.
Question 53 of 60
53. Question
Alex wants to change the default boot target of a Linux system managed by systemd. He has been told that he can symlink the desired target in a specific directory. Which directory should contain the symlink to set the default boot target?
Correct
Correct Answer: A. /etc/systemd/system/ Explanation: The default target (or runlevel) that systemd will use during boot can be set by creating a symbolic link in /etc/systemd/system/ that points to the desired target file. This symlink is typically named default.target. Option B is incorrect. There is no default directory named /etc/systemd/systemd-default/. Option C is incorrect. The /etc/systemd/target/ directory does not exist by default for setting default targets. Option D is incorrect. The /etc/systemd/boot/ directory does not exist by default for setting default boot targets.
Incorrect
Correct Answer: A. /etc/systemd/system/ Explanation: The default target (or runlevel) that systemd will use during boot can be set by creating a symbolic link in /etc/systemd/system/ that points to the desired target file. This symlink is typically named default.target. Option B is incorrect. There is no default directory named /etc/systemd/systemd-default/. Option C is incorrect. The /etc/systemd/target/ directory does not exist by default for setting default targets. Option D is incorrect. The /etc/systemd/boot/ directory does not exist by default for setting default boot targets.
Unattempted
Correct Answer: A. /etc/systemd/system/ Explanation: The default target (or runlevel) that systemd will use during boot can be set by creating a symbolic link in /etc/systemd/system/ that points to the desired target file. This symlink is typically named default.target. Option B is incorrect. There is no default directory named /etc/systemd/systemd-default/. Option C is incorrect. The /etc/systemd/target/ directory does not exist by default for setting default targets. Option D is incorrect. The /etc/systemd/boot/ directory does not exist by default for setting default boot targets.
Question 54 of 60
54. Question
Youre working as a system administrator and need to change the default boot target of a system using systemd to boot directly into a graphical user interface. Which command should you use to set the default target to graphical mode?
Correct
Correct Answer: A. systemctl set-default graphical.service Explanation: To set the default target in a system using systemd, you use the systemctl set-default command followed by the name of the target. In this case, to boot into a graphical user interface, the target is graphical.target. Option B is incorrect. systemctl enable is used to enable a service to start on boot but doesn‘t set it as the default target. Option C is incorrect. systemctl default is not a valid command to set the default target. Option D is incorrect. systemctl set-target is not a valid command. The correct command is systemctl set-default.
Incorrect
Correct Answer: A. systemctl set-default graphical.service Explanation: To set the default target in a system using systemd, you use the systemctl set-default command followed by the name of the target. In this case, to boot into a graphical user interface, the target is graphical.target. Option B is incorrect. systemctl enable is used to enable a service to start on boot but doesn‘t set it as the default target. Option C is incorrect. systemctl default is not a valid command to set the default target. Option D is incorrect. systemctl set-target is not a valid command. The correct command is systemctl set-default.
Unattempted
Correct Answer: A. systemctl set-default graphical.service Explanation: To set the default target in a system using systemd, you use the systemctl set-default command followed by the name of the target. In this case, to boot into a graphical user interface, the target is graphical.target. Option B is incorrect. systemctl enable is used to enable a service to start on boot but doesn‘t set it as the default target. Option C is incorrect. systemctl default is not a valid command to set the default target. Option D is incorrect. systemctl set-target is not a valid command. The correct command is systemctl set-default.
Question 55 of 60
55. Question
Anna is trying to locate all .txt files in her home directory and its subdirectories that were modified within the last 7 days. Which command should she use?
Correct
Correct Answer: A. find ~ -name “*.txt“ -mtime -7 Explanation: The find command searches for files in directories recursively. The tilde (~) represents the user‘s home directory. The -name “*.txt“ option specifies that we are looking for files with a .txt extension. The -mtime -7 option specifies that we are interested in files modified within the last 7 days. Option B is incorrect. While it correctly identifies the file type and extension, the ′-mmin 7′ option would search for files modified exactly 7 minutes ago, not within the last 7 days. Option C is incorrect. This option searches for ′.doc′ files instead of ′.txt′ files. Option D is incorrect. The ′-type d′ option specifies directories, but the scenario mentions ′.txt′ files.
Incorrect
Correct Answer: A. find ~ -name “*.txt“ -mtime -7 Explanation: The find command searches for files in directories recursively. The tilde (~) represents the user‘s home directory. The -name “*.txt“ option specifies that we are looking for files with a .txt extension. The -mtime -7 option specifies that we are interested in files modified within the last 7 days. Option B is incorrect. While it correctly identifies the file type and extension, the ′-mmin 7′ option would search for files modified exactly 7 minutes ago, not within the last 7 days. Option C is incorrect. This option searches for ′.doc′ files instead of ′.txt′ files. Option D is incorrect. The ′-type d′ option specifies directories, but the scenario mentions ′.txt′ files.
Unattempted
Correct Answer: A. find ~ -name “*.txt“ -mtime -7 Explanation: The find command searches for files in directories recursively. The tilde (~) represents the user‘s home directory. The -name “*.txt“ option specifies that we are looking for files with a .txt extension. The -mtime -7 option specifies that we are interested in files modified within the last 7 days. Option B is incorrect. While it correctly identifies the file type and extension, the ′-mmin 7′ option would search for files modified exactly 7 minutes ago, not within the last 7 days. Option C is incorrect. This option searches for ′.doc′ files instead of ′.txt′ files. Option D is incorrect. The ′-type d′ option specifies directories, but the scenario mentions ′.txt′ files.
Question 56 of 60
56. Question
Tom wants to grant read and write permissions to the owner and read-only permissions to the group and others for a file named report.txt. Which of the following commands should Tom use?
Correct
Correct Answer: B. chmod 644 report.txt Explanation: By using chmod 644, the permissions are set as -rw-r–r–. This grants read and write permissions to the owner and read-only permissions to the group and others. Option A is incorrect. ′chmod 744′ grants read, write, and execute permissions to the owner and only read permissions to the group, but also grants execute permission to others. Option C is incorrect. ′chmod 711′ grants full permissions to the owner but only execute permissions to the group and others. Option D is incorrect. ′chmod 777′ grants full permissions (read, write, and execute) to everyone, which is not the desired behavior.
Incorrect
Correct Answer: B. chmod 644 report.txt Explanation: By using chmod 644, the permissions are set as -rw-r–r–. This grants read and write permissions to the owner and read-only permissions to the group and others. Option A is incorrect. ′chmod 744′ grants read, write, and execute permissions to the owner and only read permissions to the group, but also grants execute permission to others. Option C is incorrect. ′chmod 711′ grants full permissions to the owner but only execute permissions to the group and others. Option D is incorrect. ′chmod 777′ grants full permissions (read, write, and execute) to everyone, which is not the desired behavior.
Unattempted
Correct Answer: B. chmod 644 report.txt Explanation: By using chmod 644, the permissions are set as -rw-r–r–. This grants read and write permissions to the owner and read-only permissions to the group and others. Option A is incorrect. ′chmod 744′ grants read, write, and execute permissions to the owner and only read permissions to the group, but also grants execute permission to others. Option C is incorrect. ′chmod 711′ grants full permissions to the owner but only execute permissions to the group and others. Option D is incorrect. ′chmod 777′ grants full permissions (read, write, and execute) to everyone, which is not the desired behavior.
Question 57 of 60
57. Question
You are a system administrator and you want to ensure that when a user creates a file inside the /shared_docs directory, the file will always belong to the group docs_admin. Which command will help you set this behavior?
Correct
Correct Answer: B. chmod g+s /shared_docs Explanation: Option B sets the SGID (Set Group ID) on the directory. When SGID is set on a directory, any file created within that directory will inherit the group ownership of the directory. Option A is incorrect. Setting the SUID (Set User ID) on a directory does not have a meaningful impact on most modern file systems. Option C is incorrect. The sticky bit (′+t′) ensures that only the owner of the file can delete or modify the file inside a directory. Option D is incorrect. This removes the SUID bit from the directory, which is not the intended behavior for the described scenario.
Incorrect
Correct Answer: B. chmod g+s /shared_docs Explanation: Option B sets the SGID (Set Group ID) on the directory. When SGID is set on a directory, any file created within that directory will inherit the group ownership of the directory. Option A is incorrect. Setting the SUID (Set User ID) on a directory does not have a meaningful impact on most modern file systems. Option C is incorrect. The sticky bit (′+t′) ensures that only the owner of the file can delete or modify the file inside a directory. Option D is incorrect. This removes the SUID bit from the directory, which is not the intended behavior for the described scenario.
Unattempted
Correct Answer: B. chmod g+s /shared_docs Explanation: Option B sets the SGID (Set Group ID) on the directory. When SGID is set on a directory, any file created within that directory will inherit the group ownership of the directory. Option A is incorrect. Setting the SUID (Set User ID) on a directory does not have a meaningful impact on most modern file systems. Option C is incorrect. The sticky bit (′+t′) ensures that only the owner of the file can delete or modify the file inside a directory. Option D is incorrect. This removes the SUID bit from the directory, which is not the intended behavior for the described scenario.
Question 58 of 60
58. Question
Alice is a Linux system administrator and she wants to verify the integrity and authenticity of the webapp.rpm package she downloaded. Which of the following commands will help her to check both the integrity and signatures of the RPM package?
Correct
Correct Answer: C. rpm –checksig webapp.rpm Explanation: The rpm –checksig command is used to verify the integrity of an RPM package as well as to check its signature to ensure that it‘s authentic and hasn‘t been tampered with. Option A is incorrect. The rpm -qip command can be used to view the information of a package, but it does not check the integrity or authenticity of the package. Option B is incorrect. rpm -Vp verifies the integrity of an installed package, checking that files have not been modified after installation. But it doesn‘t handle the signature verification of a yet-to-be-installed RPM package. Option D is incorrect. yum info gives information about a package, including its version, summary, description, and more. However, it does not verify the integrity or authenticity of a package.
Incorrect
Correct Answer: C. rpm –checksig webapp.rpm Explanation: The rpm –checksig command is used to verify the integrity of an RPM package as well as to check its signature to ensure that it‘s authentic and hasn‘t been tampered with. Option A is incorrect. The rpm -qip command can be used to view the information of a package, but it does not check the integrity or authenticity of the package. Option B is incorrect. rpm -Vp verifies the integrity of an installed package, checking that files have not been modified after installation. But it doesn‘t handle the signature verification of a yet-to-be-installed RPM package. Option D is incorrect. yum info gives information about a package, including its version, summary, description, and more. However, it does not verify the integrity or authenticity of a package.
Unattempted
Correct Answer: C. rpm –checksig webapp.rpm Explanation: The rpm –checksig command is used to verify the integrity of an RPM package as well as to check its signature to ensure that it‘s authentic and hasn‘t been tampered with. Option A is incorrect. The rpm -qip command can be used to view the information of a package, but it does not check the integrity or authenticity of the package. Option B is incorrect. rpm -Vp verifies the integrity of an installed package, checking that files have not been modified after installation. But it doesn‘t handle the signature verification of a yet-to-be-installed RPM package. Option D is incorrect. yum info gives information about a package, including its version, summary, description, and more. However, it does not verify the integrity or authenticity of a package.
Question 59 of 60
59. Question
You are troubleshooting an issue with a service named example.service. You want to view the status and recent logs of this service using systemctl. Which command should you execute?
Correct
Correct Answer: A. systemctl status example.service Explanation: The systemctl status command allows you to view the current status of a service, including its active state, a brief description, and recent log entries, which makes it invaluable for troubleshooting. Option B is incorrect. systemctl show example.service provides detailed properties of the service unit but doesn‘t show the recent log entries. Option C is incorrect. There‘s no systemctl list command. Option D is incorrect. There‘s no systemctl inspect command. The correct command to view the status and logs of a service is systemctl status.
Incorrect
Correct Answer: A. systemctl status example.service Explanation: The systemctl status command allows you to view the current status of a service, including its active state, a brief description, and recent log entries, which makes it invaluable for troubleshooting. Option B is incorrect. systemctl show example.service provides detailed properties of the service unit but doesn‘t show the recent log entries. Option C is incorrect. There‘s no systemctl list command. Option D is incorrect. There‘s no systemctl inspect command. The correct command to view the status and logs of a service is systemctl status.
Unattempted
Correct Answer: A. systemctl status example.service Explanation: The systemctl status command allows you to view the current status of a service, including its active state, a brief description, and recent log entries, which makes it invaluable for troubleshooting. Option B is incorrect. systemctl show example.service provides detailed properties of the service unit but doesn‘t show the recent log entries. Option C is incorrect. There‘s no systemctl list command. Option D is incorrect. There‘s no systemctl inspect command. The correct command to view the status and logs of a service is systemctl status.
Question 60 of 60
60. Question
Jake wants to switch his Linux system that uses systemd to a graphical target mode. However, he doesnt want this change to be permanent. Which command should Jake use?
Correct
Correct Answer: D. systemctl isolate graphical.target Explanation: The systemctl isolate command is used to switch the system to a new target immediately, but it doesn‘t set that target as the default for subsequent boots. Thus, if Jake wants a temporary change, isolate is the right command. Option A is incorrect. systemctl set-default sets the default target for subsequent boots, making the change permanent. Option B is incorrect. systemctl start doesn‘t change the current target of the system. It‘s primarily used to start services. Option C is incorrect. systemctl reboot is used to reboot the system, not to change its target.
Incorrect
Correct Answer: D. systemctl isolate graphical.target Explanation: The systemctl isolate command is used to switch the system to a new target immediately, but it doesn‘t set that target as the default for subsequent boots. Thus, if Jake wants a temporary change, isolate is the right command. Option A is incorrect. systemctl set-default sets the default target for subsequent boots, making the change permanent. Option B is incorrect. systemctl start doesn‘t change the current target of the system. It‘s primarily used to start services. Option C is incorrect. systemctl reboot is used to reboot the system, not to change its target.
Unattempted
Correct Answer: D. systemctl isolate graphical.target Explanation: The systemctl isolate command is used to switch the system to a new target immediately, but it doesn‘t set that target as the default for subsequent boots. Thus, if Jake wants a temporary change, isolate is the right command. Option A is incorrect. systemctl set-default sets the default target for subsequent boots, making the change permanent. Option B is incorrect. systemctl start doesn‘t change the current target of the system. It‘s primarily used to start services. Option C is incorrect. systemctl reboot is used to reboot the system, not to change its target.
X
Use Page numbers below to navigate to other practice tests