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
Ask process 4821 to exit
kill 4821same as:
kill -15 4821,kill -TERM 4821,kill -SIGTERM 4821kill— send a signal; TERM ("please exit") by default4821— the process ID
Force the hung process 4821 to stop
kill -9 4821same as:
kill -KILL 4821,kill -SIGKILL 4821,kill -s KILL 4821kill— send a signal-9— KILL: stop at once, with no chance to clean up4821— the PID