0
0
Linux CLIscripting~10 mins

Why process control manages running programs in Linux CLI - Test Your Understanding

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

Complete the command to list all running processes.

Linux CLI
ps [1]
Drag options to blanks, or click blank then click option'
A-z
B-l
C-a
D-x
Attempts:
3 left
💡 Hint
Common Mistakes
Using -z which is not a valid option.
Using -l which shows detailed info but not all processes.
Using -a which shows processes with terminals only.
2fill in blank
medium

Complete the command to stop a running process by its PID.

Linux CLI
kill [1]
Drag options to blanks, or click blank then click option'
A1234
B-1
C-9
D-5
Attempts:
3 left
💡 Hint
Common Mistakes
Using a signal option like -9 without a PID.
Using a signal option instead of the PID.
Not providing any argument.
3fill in blank
hard

Fix the error in the command to run a program in the background.

Linux CLI
[1]myscript.sh &
Drag options to blanks, or click blank then click option'
Astart
B./
Crun
Dexecute
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' or 'start' which are not valid commands.
Omitting the ./ prefix causing 'command not found'.
4fill in blank
hard

Fill both blanks to show the process tree with all processes.

Linux CLI
pstree [1] [2]
Drag options to blanks, or click blank then click option'
A-p
B-a
C-A
D-u
Attempts:
3 left
💡 Hint
Common Mistakes
Using options that don't show PIDs or arguments.
Using only one option instead of both.
5fill in blank
hard

Fill all three blanks to create a dictionary of running processes with PID as key and command as value.

Linux CLI
processes = [1]: [2] for [3] in $(ps -e -o pid=,comm=)}}
Drag options to blanks, or click blank then click option'
Apid
Bline
Cline.split()[0]
Dline.split()[1]
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names not defined in the loop.
Not splitting the line to separate PID and command.