Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to switch to the root user.
Linux CLI
su [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' alone switches to root but requires a dash after su.
Using '-c' runs a command, not switch user.
Using '-l' is for login shell, not username.
✗ Incorrect
The command 'su root' switches the current user to the root user.
2fill in blank
mediumComplete the command to switch to user 'alice' with a login shell.
Linux CLI
su [1] alice Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-c' runs a command instead of switching shell.
Using '-s' specifies shell, not login.
Using '-l' requires no username after it.
✗ Incorrect
The '-' option starts a login shell for the user 'alice'.
3fill in blank
hardFix the error in the command to run 'ls' as user 'bob'.
Linux CLI
su bob [1] ls Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-l' runs a login shell, not a command.
Using '-' switches user but does not run command.
Using '-s' specifies shell, not command.
✗ Incorrect
The '-c' option runs the command 'ls' as user 'bob'.
4fill in blank
hardFill both blanks to switch to user 'carol' and run the command 'whoami'.
Linux CLI
su [1] [2] whoami
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of username and option.
Using '-l' instead of '-c' to run command.
Omitting the username or command option.
✗ Incorrect
Use 'su carol -c whoami' to run 'whoami' as user 'carol'.
5fill in blank
hardFill all three blanks to switch to user 'dave' with a login shell and run 'env'.
Linux CLI
su [1] [2] [3] env
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing order of options and username.
Using '-' instead of '-l' for login shell.
Omitting '-c' when running a command.
✗ Incorrect
Use 'su dave -l -c env' to switch to 'dave' with login shell and run 'env'.