0
0
Linux CLIscripting~10 mins

groups and group management in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to list all groups on the system.

Linux CLI
cat /etc/[1]
Drag options to blanks, or click blank then click option'
Ashadow
Bgroup
Cpasswd
Dhosts
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
2fill in blank
medium

Complete the command to add a new group named 'developers'.

Linux CLI
sudo [1] developers
Drag options to blanks, or click blank then click option'
Auseradd
Busermod
Caddgroup
Dgroupadd
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
3fill in blank
hard

Fix 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'
Astaff
Busers
Cadmin
Dsudo
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong group name
Forgetting the '-a' option which appends the group
Using 'usermod' without '-G' option
4fill in blank
hard

Fill 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'
Adevelopers
Bbob
Cstaff
Dalice
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up username and group
Using wrong group name
Forgetting to specify username
5fill in blank
hard

Fill 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'
Acharlie
C3
D:
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong delimiter
Using wrong field number
Forgetting username