Task 4. Delete a userA year later, researcher9, decided to leave the company. In this task, you must remove them from the system.Run a command to delete researcher9 from the system:This command will output the following message:This is expected.Note: When you create a new user in Linux, a group with the same name as the user is automatically created and the user is the only member of that group. After removing users, it is good practice to clean up any such empty groups that may remain behind.Run the following command to delete the researcher9 group that is no longer required:Click Check my progress to verify that you have completed this task correctly.Delete a user
Question
Task 4. Delete a userA year later, researcher9, decided to leave the company. In this task, you must remove them from the system.Run a command to delete researcher9 from the system:This command will output the following message:This is expected.Note: When you create a new user in Linux, a group with the same name as the user is automatically created and the user is the only member of that group. After removing users, it is good practice to clean up any such empty groups that may remain behind.Run the following command to delete the researcher9 group that is no longer required:Click Check my progress to verify that you have completed this task correctly.Delete a user
Solution
To delete a user in Linux, follow these steps:
-
Open the terminal: You can do this by pressing
Ctrl + Alt + Ton your keyboard. -
Type in the command to delete the user. In this case, the user is
researcher9. The command is:sudo userdel researcher9. PressEnter. -
You will be asked for your password. Type it in and press
Enter. -
If the command is successful, you will see no output. This is expected.
-
Now, you need to delete the group that was automatically created when
researcher9was added. The command to delete a group issudo groupdel groupname. In this case, the group name is alsoresearcher9. So, the command is:sudo groupdel researcher9. PressEnter. -
Again, if the command is successful, you will see no output.
-
To verify that you have completed this task correctly, you can run the command
getent passwd researcher9. If the user has been deleted successfully, this command will return no output. Similarly, you can run the commandgetent group researcher9to check if the group has been deleted. This command will also return no output if the group has been deleted successfully.
Remember, you need to have superuser (root) privileges to run these commands. If you are not a superuser, you will need to prefix these commands with sudo.
Similar Questions
Task 3. Add the user to a secondary groupA couple of months later, this employee's role at the organization has changed, and they are working in both the Research and the Sales departments.In this task, you must add researcher9 to a secondary group (sales_team). Their primary group is still research_team.Use the usermod command with the -a and -G options to add researcher9 to the sales_team group as a secondary group.Note: Options for Linux commands are case-sensitive, so make sure you use a lowercase -a and an uppercase -G.Click Check my progress to verify that you have completed this task correctly.
A new employee has joined the Research department. In this task, you must add them to the system. The username assigned to them is researcher9.Write a command to add a user called researcher9 to the system.Next, you need to add the new user to the research_team group.Use the usermod command and -g option to add researcher9 to the research_team group as their primary group.
How do you delete the users record with id = 89 in this table?+-------+-------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------+-------------------------------------------------------------------------------------------------------------------------------+| users | CREATE TABLE `users` ( `id` int(11) DEFAULT NULL, `name` varchar(256) DEFAULT NULL, `age` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1 |+-------+-------------------------------------------------------------------------------------------------------------------------------+DELETE users WHERE id = 89;DELETE FROM users WHERE id = 89;DELETE FROM users;DELETE FROM users WHERE id IS EQUAL TO 89;
You want to delete a group called "testers," but you want to preserve any files owned by this group. Which command should you use?1.0 Markssudo delgroup -p testerssudo groupdel -r testerssudo groupdel testerssudo delgroup --preserve-files testerssudo delgroup -f testers
You want to delete a group called "testers," but you want to preserve any files owned by this group. Which command should you use?1.0 Markssudo delgroup --preserve-files testerssudo groupdel testerssudo groupdel -r testerssudo delgroup -f testerssudo delgroup -p testers
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.