kill

End a process by its ID

What it does

kill sends a process a signal. The default is TERM, a polite request to exit: the program gets to save its data and close its files. Take the PID from ps or top.

If a process hangs and ignores TERM, kill -9 helps: the KILL signal cannot be caught, and the system stops the process at once. You cannot end other users' processes without sudo.

Careful. After kill -9 the program has no chance to save anything: unsaved data is lost, and temporary files and locks may stay behind. Try a plain kill first.

Syntax

kill <PID>
kill -9 <PID>

Examples

Related commands

Practise · All commands