Sobes.tech
Junior — Middle

How can a process be terminated in Linux using the command line?

sobes.tech AI

Answer from AI

In Linux, to terminate a process from the command line, the kill command is usually used with the process ID (PID). For example:

kill 1234

where 1234 is the PID of the process. By default, the SIGTERM (15) signal is sent, which terminates the process gracefully.

If the process does not respond, you can send the SIGKILL (9) signal, which forcefully terminates the process:

kill -9 1234

You can also use the pkill command to terminate a process by name:

pkill process_name

Or killall:

killall process_name

To view process PIDs, you can use ps, top, or pidof.

How can a process be terminated in Linux using the… - sobes.tech