Which command is used to kill a process in UNIX?
a) kill
b) stop
c) end
d) exit
Answer:
a) kill
Explanation:
The kill
command is used to terminate a process in UNIX. It works by sending a signal to a process, such as SIGTERM
(terminate) or SIGKILL
(forcefully terminate). You need to specify the Process ID (PID) of the process to terminate, which can be found using the ps
command.
For example, kill 1234
sends the default signal to process ID 1234, while kill -9 1234
forcefully terminates the process. It’s important to use the appropriate signal to avoid potential data loss or corruption, especially when terminating critical processes.
Learning how to use kill
properly ensures you can manage processes effectively, especially when handling unresponsive or resource-intensive tasks. It’s a powerful tool for system administration in UNIX environments.