Linux Processes: Tools and Ecosystem Quiz Quiz

Explore essential Linux process management concepts with this quiz focusing on commands, signals, and monitoring tools in the Linux ecosystem. Strengthen your understanding of how to interact with and control processes efficiently using core utilities.

  1. Checking Process Status

    Which command displays a real-time, updated list of running processes along with their resource usage on a Linux system?

    1. top
    2. ps
    3. ping
    4. pop

    Explanation: The 'top' command provides a dynamic, real-time view of running processes and their resource usage on Linux. 'ps' shows a static snapshot rather than live updates. 'ping' is used for network testing, not process monitoring. 'pop' is not related to process management, making 'top' the only correct answer for this scenario.

  2. Sending Signals to Processes

    Which command and signal combination is typically used to gracefully terminate a process with process ID 1234?

    1. kill -15 1234
    2. kill -9 1234
    3. kill -1 1234
    4. kill -0 1234

    Explanation: Using 'kill -15' sends the SIGTERM signal, which is a common way to gently ask a process to exit, allowing cleanup. 'kill -9' (SIGKILL) forcefully terminates without cleanup and is less safe. 'kill -1' sends SIGHUP, often used to reload a process. 'kill -0' does not kill the process; it only checks if it's running. Therefore, 'kill -15 1234' is preferred for graceful termination.

  3. Identifying Parent Processes

    How can you determine the parent process ID (PPID) of a process running with process ID 1420?

    1. ps -o ppid= -p 1420
    2. ls -l 1420
    3. grep 1420
    4. pwd 1420

    Explanation: The 'ps -o ppid= -p 1420' command displays only the parent process ID of process 1420. 'ls -l 1420' lists file details and doesn't work for processes. 'grep 1420' searches for the number in files or output, but won't directly show the PPID. 'pwd 1420' is used to print the working directory, not process information. Thus, 'ps -o ppid= -p 1420' is correct.

  4. Process Backgrounding and Foregrounding

    If you start a script and want to send it to the background after it's running in the foreground, which sequence of keystrokes and command should you use?

    1. Ctrl+Z, then bg
    2. Ctrl+C, then bg
    3. Ctrl+X, then fg
    4. Ctrl+S, then kill

    Explanation: Pressing 'Ctrl+Z' suspends the foreground process, and running 'bg' resumes it in the background. 'Ctrl+C' stops the process, rather than suspending it. 'Ctrl+X' has no effect on process control in this context, and 'fg' brings a background job to the foreground instead. 'Ctrl+S' can pause terminal output but does not affect process control, and 'kill' ends the process.

  5. Monitoring New Processes Continuously

    What command allows you to monitor new processes as they are created in real time, displaying each new command as it starts?

    1. pstree -p
    2. watch ps aux
    3. pgrep -n
    4. sudo auditd

    Explanation: 'watch ps aux' repeatedly runs 'ps aux', letting you observe process changes in near real time. 'pstree -p' shows process hierarchies but does not auto-update as new processes are created. 'pgrep -n' finds the newest matching process but doesn't continuously monitor. 'auditd' is an auditing daemon, which is complex and not specific to live process monitoring like 'watch ps aux.'