0
0
Linux CLIscripting~10 mins

sudo for elevated privileges 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 run apt update with elevated privileges.

Linux CLI
sudo [1]
Drag options to blanks, or click blank then click option'
Aapt-update
Bupdate apt
Capt update
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Putting update before apt.
Using a hyphen in apt-update.
Omitting the package manager command.
2fill in blank
medium

Complete the command to edit the /etc/hosts file with elevated privileges using nano editor.

Linux CLI
sudo [1] /etc/hosts
Drag options to blanks, or click blank then click option'
Aedit
Bvi
Copen
Dnano
Attempts:
3 left
💡 Hint
Common Mistakes
Using edit which is not a valid command.
Using open which is not a terminal editor.
Using vi if unfamiliar with it.
3fill in blank
hard

Fix the error in the command to list files in /root directory with elevated privileges.

Linux CLI
sudo ls [1] /root
Drag options to blanks, or click blank then click option'
A-la
B-a
C-l
D-al
Attempts:
3 left
💡 Hint
Common Mistakes
Using only -l or -a alone.
Using -al which also works but is not the expected answer here.
Omitting options.
4fill in blank
hard

Fill both blanks to create a command that installs curl package using apt with elevated privileges and automatically confirms prompts.

Linux CLI
sudo apt [1] curl [2]
Drag options to blanks, or click blank then click option'
Ainstall
B-y
Cremove
D-f
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove instead of install.
Omitting the -y flag and getting stuck on prompts.
Using -f which forces fix but is not for confirmation.
5fill in blank
hard

Fill all three blanks to create a command that shows the last 10 lines of /var/log/syslog file with elevated privileges and continuously updates the output.

Linux CLI
sudo [1] [2] /var/log/syslog [3]
Drag options to blanks, or click blank then click option'
Atail
B-f
C-n 10
Dhead
Attempts:
3 left
💡 Hint
Common Mistakes
Using head instead of tail.
Omitting -f and missing live updates.
Using wrong order of options.