Which command is used to terminate a process in UNIX?
a) end
b) kill
c) stop
d) quit
Answer:
b) kill
Explanation:
The kill
command in UNIX is used to terminate a running process. It works by sending a signal to the process, which can either stop it immediately or allow for a more graceful shutdown, depending on the signal used (e.g., SIGKILL or SIGTERM).
Processes in UNIX have a unique Process ID (PID), and the kill
command is followed by the PID of the process to be terminated. For example, kill 1234
will stop the process with PID 1234. The kill -9
option forces an immediate termination.
Mastering the kill
command is important for troubleshooting hung processes or stopping resource-intensive applications. It ensures that administrators can maintain control over the processes running on their system.