Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to list all groups on the system.
Linux CLI
cat /etc/[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using /etc/passwd instead of /etc/group
Using /etc/shadow which stores passwords
Using /etc/hosts which stores network info
✗ Incorrect
The file /etc/group contains all the groups on a Linux system.
2fill in blank
mediumComplete the command to add a new group named 'developers'.
Linux CLI
sudo [1] developers Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'useradd' which adds users, not groups
Using 'usermod' which modifies users
Using 'addgroup' which is not standard on all systems
✗ Incorrect
The 'groupadd' command creates a new group on the system.
3fill in blank
hardFix the command to add user 'alice' to the group 'staff'.
Linux CLI
sudo usermod -aG [1] alice Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong group name
Forgetting the '-a' option which appends the group
Using 'usermod' without '-G' option
✗ Incorrect
The '-aG' option adds the user to the specified group without removing from others. 'staff' is the target group.
4fill in blank
hardFill both blanks to create a new user 'bob' with primary group 'developers'.
Linux CLI
sudo useradd -g [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up username and group
Using wrong group name
Forgetting to specify username
✗ Incorrect
The '-g' option sets the primary group. The username is 'bob'.
5fill in blank
hardFill both blanks to extract the primary group of user 'charlie'.
Linux CLI
groups [1] | cut -d ' ' -f [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong delimiter
Using wrong field number
Forgetting username
✗ Incorrect
The 'groups' command shows groups for 'charlie'. The output is cut using space as delimiter, field 3 shows the primary group name.