Complete the command to list all running processes.
ps [1]The ps -x command lists all running processes including those without a controlling terminal.
Complete the command to stop a running process by its PID.
kill [1]The kill command followed by the process ID (PID) stops that process. Here, 1234 is an example PID.
Fix the error in the command to run a program in the background.
[1]myscript.sh &./ prefix causing 'command not found'.To run a script in the background, prefix it with ./ if it's in the current directory.
Fill both blanks to show the process tree with all processes.
pstree [1] [2]
The pstree -p -a command shows the process tree with PIDs and command line arguments.
Fill all three blanks to create a dictionary of running processes with PID as key and command as value.
processes = [1]: [2] for [3] in $(ps -e -o pid=,comm=)}}
This code splits each line from ps output to get PID and command, then creates a dictionary.