inline Find and kill a process from the terminal

To find a running process on the machine the ps-command is used (with arguments to show all running processes) in combination with grep:

$ ps aux | grep [process]
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
...

Here, [process] is the name of the process you want to find. The name of the executable can be a good start for guessing the name if you’re not sure.

In the resulting output, find the PID of the process. Then, the kill-command can be used to end it:

# gracefully:
$ kill -SIGTERM [pid]
# force
$ kill -SIGKILL [pid]

This will then end the specified process.

If the process you need to kill is owned by a different user, adding sudo might be necessary.

Comments

comments powered by Disqus