Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to list all users on a Linux system.
Linux CLI
cat /etc/[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using /etc/hosts instead of /etc/passwd
Using /etc/shadow which is for passwords only
✗ Incorrect
The /etc/passwd file contains user account information, so listing it shows all users.
2fill in blank
mediumComplete the command to add a new user named 'alice'.
Linux CLI
sudo [1] alice Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using userdel which deletes users
Using passwd which changes passwords
✗ Incorrect
The useradd command creates a new user account.
3fill in blank
hardFix the error in the command to change user 'bob' password.
Linux CLI
sudo [1] bob Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using useradd which adds users
Using usermod which modifies user properties but not passwords
✗ Incorrect
The passwd command is used to change a user's password.
4fill in blank
hardFill both blanks to create a user 'charlie' with a home directory and default shell /bin/bash.
Linux CLI
sudo [1] -m -s [2] charlie
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using usermod instead of useradd
Setting shell to /bin/sh instead of /bin/bash
✗ Incorrect
useradd creates the user, -m makes a home directory, and -s /bin/bash sets the shell.
5fill in blank
hardFill all three blanks to list all users with UID greater than 1000 from /etc/passwd.
Linux CLI
awk -F: '{{ if ($3 [1] [2]) print $1 }}' /etc/[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>'
Using /etc/shadow instead of /etc/passwd
✗ Incorrect
This command uses awk to print usernames where UID (field 3) is greater than 1000 from /etc/passwd.