Explore essential Linux process management commands with this quiz focusing on ps, top, and kill. Assess your knowledge of process listing, monitoring, and termination techniques in Unix-like operating systems.
Which ps command option displays all currently running processes on the system along with detailed information such as user, PID, CPU, and memory usage?
Explanation: The 'ps aux' command lists all running processes on the system with comprehensive details, including information for all users. The 'ps ux' option omits processes from other users, limiting the output. 'ps -f' shows processes in a full-format listing but defaults to the current shell's processes only. 'ps al' provides a long format but displays limited or filtered process sets, not all processes.
In the top command interface, which key should you press to sort the displayed processes by memory usage instead of the default CPU usage?
Explanation: Pressing 'M' in top sorts the processes by memory usage, helping users find processes consuming the most RAM. The 'C' key sorts by command line, while 'P' sorts by CPU usage, which is often the default. 'N' sorts processes by PID number. Remember, letter case matters in many Linux commands.
To terminate a process immediately using its PID 1234, which command would you use to send the SIGKILL signal?
Explanation: 'kill -9 1234' sends the SIGKILL signal, which forcefully stops the specified process. 'killall 1234' looks for processes named '1234', not the PID. 'kill -15 1234' sends a gentle SIGTERM, not an immediate forceful termination. 'kill -l 1234' lists signal names and numbers, not kill the process.
After running ps aux, you notice a process with a status of 'Z'. What does this status indicate about the process?
Explanation: A 'Z' in the process status column indicates a zombie process, which means the process has completed execution but still has an entry in the process table. A sleeping process would have an 'S' status, while a stopped process would be marked as 'T'. A running process is shown with an 'R' status.
Which command will terminate all processes named 'firefox' for all users on the system?
Explanation: 'killall firefox' sends the default termination signal to all processes named 'firefox', regardless of user. 'kill firefox' is incorrect because kill expects a PID, not a process name. 'ps -kill firefox' is not a valid option; ps is for process listing, not termination. 'top -kill firefox' is not a real command structure in Linux.