UNIX Question and Answer – Group Management
UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test
1. Which command is used to create a new group with a specific GID (Group ID) in UNIX?
a) addgroup
b) groupcreate
c) groupadd
d) creategroup
Answer: c) groupadd
Explanation: The groupadd command is used to create a new group with a specific GID in UNIX.
2. What is the purpose of the -U option with the groupmod command?
a) Change the group owner
b) Remove the group password
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.
3. Which command is used to change the group owner of a symbolic link in UNIX?
a) changegroup
b) chgrp
c) chown
d) setgroup
Answer: b) chgrp
Explanation: The chgrp command is used to change the group owner of a symbolic link in UNIX.
4. 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.
5. 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.
6. 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.
7. 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.
8. 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.
9. 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.
10. 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.
11. 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.
12. 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.
13. 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.
14. 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.
15. 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.
16. 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.
17. 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.
18. 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.
19. 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.
20. 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.
21. 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.
22. 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.
23. 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.
24. 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.
25. 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.
26. Which command is used to create a new group with a specific GID (Group ID) in UNIX?
a) addgroup
b) groupcreate
c) groupadd
d) creategroup
Answer: c) 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) Change the group owner
b) Remove the group password
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) changegroup
b) chgrp
c) chown
d) setgroup
Answer: b) 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.