UNIX MCQs – Group Management (Part – 3)

UNIX Question and Answer – Group Management

UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test

1. What is the purpose of the -n option with the groupadd command?

a) Set the expiration date for the group

b) Prevent the creation of a group with the same name as an existing user

c) Set the maximum number of members for the group

d) Set the group password

Answer: b) Prevent the creation of a group with the same name as an existing user

Explanation: The -n option with groupadd prevents the creation of a group with the same name as an existing user in UNIX.


2. Which command is used to display the members of a specific group in UNIX?

a) listmembers

b) showmembers

c) getent group

d) members

Answer: c) getent group

Explanation: The getent group command displays the members of a specific group in UNIX.


3. What is the purpose of the -o option with the groupmod command?

a) Allow non-unique GIDs

b) Set the expiration date for the group

c) Change the group owner

d) Modify the group’s access control list (ACL)

Answer: a) Allow non-unique GIDs

Explanation: The -o option with groupmod allows non-unique GIDs (Group IDs) in UNIX.


4. Which command is used to change the group membership of multiple users in UNIX?

a) modifygroup

b) setgroup

c) usermod

d) chgroup

Answer: c) usermod

Explanation: The usermod command is used to change the group membership of multiple users in UNIX.


5. What is the purpose of the -N option with the groupadd command?

a) Set the expiration date for the group

b) Prevent the creation of a group with the same name as an existing user

c) Set the maximum number of members for the group

d) Set the group password

Answer: b) Prevent the creation of a group with the same name as an existing user

Explanation: The -N option with groupadd prevents the creation of a group with the same name as an existing user in UNIX.


6. Which command is used to list all groups a user is a member of in UNIX?

a) usergroups

b) groups

c) listgroups

d) showgroups

Answer: b) groups

Explanation: The groups command lists all groups a user is a member of in UNIX.


7. What is the purpose of the -d option with the groupdel command?

a) Remove the group’s directory

b) Prompt for confirmation before deletion

c) Remove the group from the system

d) Change the group name

Answer: a) Remove the group’s directory

Explanation: The -d option with groupdel removes the group’s directory along with the group in UNIX.


8. Which command is used to change the group owner of a file in UNIX?

a) chown

b) changegroup

c) setgroup

d) chgrp

Answer: d) chgrp

Explanation: The chgrp command is used to change the group owner of a file in UNIX.


9. What is the purpose of the -K option with the groupmod command?

a) Set the expiration date for the group

b) Set the maximum number of members for the group

c) Change the group description

d) Change the group owner

Answer: c) Change the group description

Explanation: The -K option with groupmod is used to change the description of a group in UNIX.


10. Which command is used to change the group ID (GID) of a group in UNIX?

a) modifygid

b) groupmod

c) changegid

d) setgid

Answer: b) groupmod

Explanation: The groupmod command is used to change the group ID (GID) of a group in UNIX.


11. What is the purpose of the -M option with the groupmod command?

a) Add or remove users from the group

b) Set the maximum number of members for the group

c) Change the group name

d) Set the group password

Answer: a) Add or remove users from the group

Explanation: The -M option with groupmod is used to add or remove users from the group in UNIX.


12. Which command is used to change the group membership of a user in UNIX?

a) chgroup

b) usermod

c) modifygroup

d) setgroup

Answer: b) usermod

Explanation: The usermod command is used to change the group membership of a user in UNIX.


13. What is the purpose of the -n option with the groupmod command?

a) Change the group name

b) Change the maximum number of members for the group

c) Change the group owner

d) Change the group ID

Answer: a) Change the group name

Explanation: The -n option with groupmod changes the name of a group in UNIX.


14. Which command is used to display the primary group of a user in UNIX?

a) primarygroup

b) usergroup

c) id

d) groups

Answer: c) id

Explanation: The id command displays user and group information, including the primary group, in UNIX.


15. What is the purpose of the -p option with the groupmod command?

a) Change the group owner

b) Change the group password

c) Set the maximum number of members for the group

d) Add users to the group

Answer: b) Change the group password

Explanation: The -p option with groupmod is used to change the password of a group in UNIX.


16. Which command is used to remove a user from a group in UNIX?

a) userdel

b) deluser

c) removeuser

d) usermod

Answer: d) usermod

Explanation: The usermod command is used to remove a user from a group in UNIX.


17. What is the purpose of the -o option with the groupmod command?

a) Allow non-unique GIDs

b) Set the expiration date for the group

c) Change the group owner

d) Modify the group’s access control list (ACL)

Answer: a) Allow non-unique GIDs

Explanation: The -o option with groupmod allows non-unique GIDs (Group IDs) in UNIX.


18. Which command is used to display detailed information about a specific group in UNIX?

a) groupinfo

b) showgroup

c) getent group

d) info

Answer: c) getent group

Explanation: The getent group command displays detailed information about a specific group in UNIX.


19. What is the purpose of the -i option with the groupmod command?

a) Prompt for confirmation before modification

b) Change the group ID

c) Set the expiration date for the group

d) Unlock a locked group

Answer: a) Prompt for confirmation before modification

Explanation: The -i option with groupmod prompts for confirmation before modifying a group in UNIX.


20. Which command is used to display the members of a specific group in UNIX?

a) members

b) showmembers

c) listmembers

d) getent group

Answer: d) getent group

Explanation: The getent group command displays the members of a specific group in UNIX.


21. What is the purpose of the -o option with the groupmod command?

a) Allow non-unique GIDs

b) Set the expiration date for the group

c) Change the group owner

d) Modify the group’s access control list (ACL)

Answer: a) Allow non-unique GIDs

Explanation: The -o option with groupmod allows non-unique GIDs (Group IDs) in UNIX.


22. Which command is used to change the group membership of multiple users in UNIX?

a) modifygroup

b) setgroup

c) usermod

d) chgroup

Answer: c) usermod

Explanation: The usermod command is used to change the group membership of multiple users in UNIX.


23. What is the purpose of the -N option with the groupadd command?

a) Set the expiration date for the group

b) Prevent the creation of a group with the same name as an existing user

c) Set the maximum number of members for the group

d) Set the group password

Answer: b) Prevent the creation of a group with the same name as an existing user

Explanation: The -N option with groupadd prevents the creation of a group with the same name as an existing user in UNIX.


24. Which command is used to list all groups a user is a member of in UNIX?

a) usergroups

b) groups

c) listgroups

d) showgroups

Answer: b) groups

Explanation: The groups command lists all groups a user is a member of in UNIX.


25. What is the purpose of the -d option with the groupdel command?

a) Remove the group’s directory

b) Prompt for confirmation before deletion

c) Remove the group from the system

d) Change the group name

Answer: a) Remove the group’s directory

Explanation: The -d option with groupdel removes the group’s directory along with the group in UNIX.


26. Which command is used to create a new group with a specific GID (Group ID) in UNIX?

a) creategroup

b) addgroup

c) groupcreate

d) groupadd

Answer: d) groupadd

Explanation: The groupadd command is used to create a new group with a specific GID in UNIX.


27. What is the purpose of the -U option with the groupmod command?

a) Remove the group password

b) Change the group owner

c) Unlock a locked group

d) Change the GID of a group

Answer: c) Unlock a locked group

Explanation: The -U option with groupmod is used to unlock a locked group in UNIX.


28. Which command is used to change the group owner of a symbolic link in UNIX?

a) chgrp

b) chown

c) changegroup

d) setgroup

Answer: a) chgrp

Explanation: The chgrp command is used to change the group owner of a symbolic link in UNIX.


29. What is the purpose of the -E option with the groupmod command?

a) Change the group description

b) Set the expiration date for the group

c) Change the maximum number of members for the group

d) Modify the group’s access control list (ACL)

Answer: a) Change the group description

Explanation: The -E option with groupmod is used to change the description of a group in UNIX.


30. Which command is used to change the primary group of a user in UNIX?

a) setprimarygroup

b) chgroup

c) usermod

d) primarygroup

Answer: c) usermod

Explanation: The usermod command is used to change the primary group of a user in UNIX.


31. What is the purpose of the -r option with the groupadd command?

a) Remove the group’s directory

b) Create a system group

c) Set the group password

d) Rename the group

Answer: b) Create a system group

Explanation: The -r option with groupadd is used to create a system group in UNIX.


32. Which command is used to display the primary group of a user in UNIX?

a) primarygroup

b) usergroup

c) id

d) groups

Answer: c) id

Explanation: The id command displays user and group information, including the primary group, in UNIX.


33. What is the purpose of the -p option with the groupmod command?

a) Change the group owner

b) Change the group password

c) Set the maximum number of members for the group

d) Add users to the group

Answer: b) Change the group password

Explanation: The -p option with groupmod is used to change the password of a group in UNIX.


34. Which command is used to remove a user from a group in UNIX?

a) userdel

b) deluser

c) removeuser

d) usermod

Answer: d) usermod

Explanation: The usermod command is used to remove a user from a group in UNIX.


35. What is the purpose of the -n option with the groupmod command?

a) Change the group name

b) Change the maximum number of members for the group

c) Change the group owner

d) Change the group ID

Answer: a) Change the group name

Explanation: The -n option with groupmod changes the name of a group in UNIX.


36. Which command is used to display the members of a specific group in UNIX?

a) listmembers

b) showmembers

c) getent group

d) members

Answer: c) getent group

Explanation: The getent group command displays the members of a specific group in UNIX.


37. What is the purpose of the -o option with the groupmod command?

a) Allow non-unique GIDs

b) Set the expiration date for the group

c) Change the group owner

d) Modify the group’s access control list (ACL)

Answer: a) Allow non-unique GIDs

Explanation: The -o option with groupmod allows non-unique GIDs (Group IDs) in UNIX.


38. Which command is used to change the group membership of multiple users in UNIX?

a) modifygroup

b) setgroup

c) usermod

d) chgroup

Answer: c) usermod

Explanation: The usermod command is used to change the group membership of multiple users in UNIX.


39. What is the purpose of the -N option with the groupadd command?

a) Set the expiration date for the group

b) Prevent the creation of a group with the same name as an existing user

c) Set the maximum number of members for the group

d) Set the group password

Answer: b) Prevent the creation of a group with the same name as an existing user

Explanation: The -N option with groupadd prevents the creation of a group with the same name as an existing user in UNIX.


40. Which command is used to list all groups a user is a member of in UNIX?

a) usergroups

b) groups

c) listgroups

d) showgroups

Answer: b) groups

Explanation: The groups command lists all groups a user is a member of in UNIX.


41. What is the purpose of the -d option with the groupdel command?

a) Remove the group’s directory

b) Prompt for confirmation before deletion

c) Remove the group from the system

d) Change the group name

Answer: a) Remove the group’s directory

Explanation: The -d option with groupdel removes the group’s directory along with the group in UNIX.


42. Which command is used to change the group owner of a file in UNIX?

a) chown

b) changegroup

c) setgroup

d) chgrp

Answer: d) chgrp

Explanation: The chgrp command is used to change the group owner of a file in UNIX.


43. What is the purpose of the -K option with the groupmod command?

a) Set the expiration date for the group

b) Set the maximum number of members for the group

c) Change the group description

d) Change the group owner

Answer: c) Change the group description

Explanation: The -K option with groupmod is used to change the description of a group in UNIX.


44. Which command is used to change the group ID (GID) of a group in UNIX?

a) modifygid

b) groupmod

c) changegid

d) setgid

Answer: b) groupmod

Explanation: The groupmod command is used to change the group ID (GID) of a group in UNIX.


45. What is the purpose of the -M option with the groupmod command?

a) Add or remove users from the group

b) Set the maximum number of members for the group

c) Change the group name

d) Set the group password

Answer: a) Add or remove users from the group

Explanation: The -M option with groupmod is used to add or remove users from the group in UNIX.


46. Which command is used to change the group membership of a user in UNIX?

a) chgroup

b) usermod

c) modifygroup

d) setgroup

Answer: b) usermod

Explanation: The usermod command is used to change the group membership of a user in UNIX.


47. What is the purpose of the -n option with the groupmod command?

a) Change the group name

b) Change the maximum number of members for the group

c) Change the group owner

d) Change the group ID

Answer: a) Change the group name

Explanation: The -n option with groupmod changes the name of a group in UNIX.


48. Which command is used to display the primary group of a user in UNIX?

a) primarygroup

b) usergroup

c) id

d) groups

Answer: c) id

Explanation: The id command displays user and group information, including the primary group, in UNIX.


49. What is the purpose of the -p option with the groupmod command?

a) Change the group owner

b) Change the group password

c) Set the maximum number of members for the group

d) Add users to the group

Answer: b) Change the group password

Explanation: The -p option with groupmod is used to change the password of a group in UNIX.


50. Which command is used to remove a user from a group in UNIX?

a) userdel

b) deluser

c) removeuser

d) usermod

Answer: d) usermod

Explanation: The usermod command is used to remove a user from a group in UNIX.

Related Articles

Linux MCQ

Welcome to Linux Multiple Choice Questions (MCQ) Section Embark on a journey through the world of...