Exam LFCS All QuestionsBrowse all questions from this exam
Question 44

Which of the following commands kills the process with the PID 123 but allows the process to "clean up" before exiting?

    Correct Answer: D

    The command 'kill -TERM 123' sends the SIGTERM signal to the process with PID 123. This signal requests the process to terminate but allows it to perform necessary cleanup operations before exiting. Other options either use invalid signals or do not grant the process the chance to clean up before termination. Therefore, 'kill -TERM 123' is the correct command.

Discussion
BuruguduystunstugudunstuyOption: D

The command that kills the process with the PID '123' but allows the process to "clean up" before exiting is 'kill -TERM 123'. Option D is the correct answer. The 'kill' command is used to send a signal to a process, causing it to terminate. The '-TERM' option specifies the 'SIGTERM' signal, which is a request to terminate the process. This signal allows the process to clean up before exiting. The other options do not accurately describe the behavior of the 'kill' command: Option A: The '-PIPE' option is not a valid option for the 'kill' command. Option B: The '-KILL' option specifies the 'SIGKILL' signal, which is a request to terminate the process immediately. This signal does not allow the process to clean up before exiting. Option C: The '-STOP' option specifies the 'SIGSTOP' signal, which is a request to stop the process. This signal does not terminate the process, and it does not allow the process to clean up before exiting.